Custom Google Maps Marker Maker

Very nifty: upload your custom marker image, and it creates a shadow file, and the shape coordinates. Even creates a sprite containing the marker and shadow.

Text

Symfony’s logging component is great: it provides a highly customizable way to log exactly what you want, where you want it, the way you want it (even with FirePHP support). By default, a lot of information is being logged on development environments: both the kernel and DBAL do a great job of granulized logging.

On production environments, the default log setting is changed to a fingers crossed strategy, which means: don’t log anything until a certain severity threshold is reached. Really smart since you don’t really need to log successful requests, but do want to inspect logs when something went wrong.

There are situations however, where you want to minimize (or completely disable) logging. In my case, I had a large import which I implemented in a Command. Everything was working fine on my dev environment, but I got memory_limit errors on production. I figured this was because of the fingers crossed strategy, which requires every logged message to be stored in memory.

So I dug into the Monolog internals, and figured out that disabling the log is really easy. You just push a NullHandler on the stack, which catches every message that is logged, preventing other handlers to log it. I found two services being responsible for almost all logging:

foreach (array('monolog.logger.doctrine', 'logger') as $service) { 
    $logger = $container->get($service); 
    $logger->pushHandler(new \Monolog\Handler\NullHandler());
}

After doing this, nothing was being logged anymore, at least not in my case/configuration, YMMV.

What is Symfony2?

Great article, describing two things:

1. The web is not MVC

This is something I have been thinking about for years now, but I never fleshed out my thoughts about this. This pretty much sums up all my thoughts about this subject:

the MVC word is so overloaded and because nobody implements exactly the same MVC pattern anyway. The separation of concerns is all I care about.

[…]

I don’t like MVC because that’s not how the web works. Symfony2 is an HTTP framework; it is a Request/Response framework. That’s the big deal. The fundamental principles of Symfony2 are centered around the HTTP specification.

2. Why Symfony2?

Why use Symfony2 as opposed to other frameworks out there? Because it’s awesome: the Doctrine ORM is awesome, the template engine is awesome, the console is really awesome, the documentation is very extensive, the performance is superb…I’ll stop here, just read it and try it for your next project, I highly recommend it.

Text

The past few months I saw more and more mentions of Homebrew, as an alternative to MacPorts. When setting up a new Lion install, I figured it was worth checking out, see if all the positive posts were true. The supposed benefits of Homebrew:

  • Homebrew installs packages into their own isolated prefixes and then symlinked into /usr/local.
  • It uses the libs that are already installed on your mac.
  • Way better command line user interface
  • Homebrew and it’s installation scripts are hosted at Github
  • The installation scripts (aka recepies) and Homebrew itself are written in ruby.

Some benefits can be discarded right away:

  • The installation scripts are written in Ruby: So? It’s easy to understand a portfile. Maybe easier than Ruby even (if you don’t happen to know the language).
  • Packages are installes into an isolated prefix: Ports are installed in /opt/local/, which on my machine only has MacPorts, pretty isolated I’d say.
  • It’s hosted at Github: granted, I love Github, but MacPorts is still available on apublic repository.

The command line user interface of Homebrew is colored, which is an advantage over MacPorts, but other than that, I have no problems with MacPorts’ CLI: it’s just as easy to type port install php than brew install php.

That leaves one advantage: it uses the libs that are already installed on your Mac. Clearly, this is a benefit, and MacPorts should look to adopt this behaviour.

Given that Homebrew has no apparent disadvantages as opposed to MacPorts, I gave it a try. While it’s a bit faster, and I’m a sucker for a colored terminal, I ran into one dealbreaking issue, when installing a server:

The mcrypt extension is missing. Please check your PHP configuration.

OK, no problem. I ran into these types of issues frequently with MacPorts. Most of the time they were solved by running port install php5-mcrypt. But not on Homebrew: I googled the issue and came across two posts with solutions. Both solutions require me to manually download, configure and compile the extension and PHP itself. Wait, what? On MacPorts this is a one line install, but for Homebrew, this has to be described in a long post?

If this is the Homebrew way of doing things, count me out. I did a search for available PHP extensions, and found only Solr. MacPorts has about 110 extensions, and all for PHP5.

There is one very critical requirement for a package manager: a extensive list of available and up-to-date software. And by that standard, at least for now, Homebrew has its ass handed to it by MacPorts.

"To me, this suggests that while Microsoft is confident that they did their homework, they’re not actually confident in the product itself. Nor should they be, given the reaction."

parislemon:

Apple’s vision for the future of computing versus Microsoft’s vision for the future of computing.

Any questions?

Source: parislemon

Text

I did.

  • launch Automator
  • create a new Service
  • add a Shell-script task
  • make sure input is passed as arguments (not stdin)
  • paste this code:
    
    DVDDIR=$1
    OUTDIR=`dirname "$DVDDIR"`
    DVDNAME=`basename "$DVDDIR"`
    hdiutil makehybrid -udf -udf-volume-name "$DVDNAME" -o "$OUTDIR/$DVDNAME.iso" "$DVDDIR"
    
    

At the end, you should have something like this (mine’s in Dutch, sorry):

Save the workflow, and you should have a new item in your context menu.

Text

Sometimes you want to have a directory in your repository, but you don’t want that directory’s contents to be committed. A cache directory is a perfect example of this: when you want to make sure that checkouts/exports have that cache directory, but you don’t want developers to commit their caches.

You can use the svn:ignore property to achieve this. In Eclipse, right-click the folder and select Team > Set Property. Set the property to svn:ignore, the content to an asterisk, and make your you check the recursive checkbox, like this:

That’s it! Don’t forget to actually commit the folder to make this change effective. 

Recursively delete .svn directories

Also created a gist for common delete operations like this:

Cleaning up MacPorts

tl;dr:

sudo port clean --all installed
sudo port -f uninstall inactive