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]

GeoTrace

7 May 2007

Post-Cinco-de-Mayo-tequilla-hangover == no skydiving. Instead I knocked together a little experiment for a geographical traceroute. Not polished or well coded.

Now with XML

14 November 2005

I’ve been meaning to add XML feeds for a while now, but was prompted recently by people at work to finally do it.

You can now get a feed for my log and also feeds for my photos (in ATOM format). The photos feed supports filtering, so for example you could get a feed for my latest travel photos or a feed with only photos of San Francisco.

For the non-techy people reading this: XML feeds such as these are used by third-party websites and applications to bring together content from multiple sources such as news sites and weblogs. This allows users to easily find posts and entries from all the sites they are interested in. Example services are Blog Lines and Google Reader.

Site Changes

11 October 2005

I thought it was about time I updated this site, so over the next few days I’ll be making some changes. If you have any comments or spot any problems let me know.

Thirteenth Parallel

18 January 2005

It’s crazy to think that it was three years and five days ago that we released the first issue of "Thirteenth Parallel", an "e-zine" about web technologies. We only managed to run 7 issues before we found we didn’t have enough time to keep up with the monthly releases. However, even long after that we had big ideas about what we wanted to do with the project, and even started on several occasions to build a new site. Time is still a big problem for us, but I have finally gotten round to putting the articles back online in a simple, quick interface.

DHTML: Event Based Animation Demo

9 October 2004

At someone’s request I have set up an example demonstrating event based animations in DHTML. The "Toolkit" code is extracted from a Thirteenth Parallel project that never got completed, as such it is not all that stream lined or complete; however this example should illustrate a neat and quick way for developing complex animations.

To put the example into context: you could use an animation object and a 5-dimensional curve to animate an expanding panel while changing it’s colour (2d for the element’s y-position and height; 3d for the red, green and blue components of it’s colour). Also, because the animation object is not tied directly to any element or property, the on-animate event handlers could be used to animate anything from colours, widths and element positions, to frame sizes and window positions.