Blog

PHP-Closure

26 February 2010

At the beginning of 2006 Erik and I started a 20% project to write a JS library for Google. Today it is used by many projects within Google and was recently open sourced.

On its own, the Closure Library isn’t very compelling for the average web developer. The dynamic loading is intended for unit tests and development, and using it in production would cause users to download masses of unused code.

Luckily for us, the Closure Compiler was open sourced at the same time. The compiler knows about a lot of the idioms used in the Closure Library and does a really good job of removing dead code and optimizing what remains. The team also launched a web service with a RESTful API so you don’t even have to run the compiler yourself.

Even with the web service, the development-debug cycle isn’t ideal. So when I found myself wanting to use some of the Closure Library for my new photo site I hacked together a PHP class that provides a convenient interface to the compiler web service, caches the optimized code, and recompiles when the sources have changed. Pretty basic, but quite useful I think.

I know PHP is looked down upon by many programmers, but it is easy, convenient, and widely available. If you have a PHP based site and want to use the Closure Library and/or the Compiler, it might be worth heading over to the project page and seeing if it might be useful.

[php-closure]

Photofolio

22 February 2010

This site was home to my photographs for many years, beginning while I was still shooting film cameras and scanning negatives, and going through my first Digital Ixus and onto the Canon 10D.

Coming relatively late to the party, I joined Flickr at the start of 2008 and haven’t looked back since. The thing that is most compelling for me is the social aspect, something that a personal photo site could never achieve. It pushes me to take more photos and to try to be more creative.

With this in mind I felt the photos left on this site were getting dated and unrepresentative; photos from university ski trips and my early travelings in China, Vietnam, and Indonesia. Instead I’ve put together a portfolio of sorts.

So Flickr is my photostream, Picasa gets random albums for sharing with family and friends, and while I don’t feel I’ve found a particular style yet, this site gets my best attempt at a photographic portfolio.

Check it out and let me know what you think.