Items on ‘Code’

Git for deployment… or not?

Tuesday, February 23rd, 2010

I’ve been reading lots about using git for deployment, but it doesn’t feel right. We’ve used SVN and git for deploying to single servers for years but I still think it’s fiddly and nasty. If I was forced to .jar it all up and deploy it would this make me a cleaner development. I dunno, so I asked StackOverflow.

(more…)

Pack it up with Jammit

Monday, November 30th, 2009

I’ve found recently that complex designs aren’t just more difficult to build, but have significant effects on browser performance. To improve the performance of our site, we used CDN (Amazon S3 hosting the files), we removed background images and we tweaked the server configuration no end.

Now, something you find out very soon when you start optimising pages is that your browser can’t make more than 2 requests to a given domain at any time. So, when you hits Amazon.com we get the HTML, then we connect back to amazon.com to get the CSS, images and JavaScript to make the page pretty and clever. These extra bits – collectively called resources – can only be downloaded 2 at a time from a given domain name.

This matters because your beautiful page, with its drop-shadows, fancy JavaScript and massive background image all needs to be downloaded before the user can enjoy just how lovely it is. BUT… if you have 10 images sitting on 1 server your browser can only get 2 at a time. This slows things down.

Part of the answer is a CDN – a content delivery network – whose sole role is to host resources on a different domain from your website. So the images for example.com might be hosted on static.example.com, or even on static1.example.com, static2.example.com and static3.example.com. The more domains, the more connections your browser can make.

You can also read a very good description of implementing a CDN with Rackspace’s Cloud services.

So, that’s method number one. Another method is to reduce the number of resources that have to be downloaded. Instead of downloading 100 images, download 2. Google Web Toolkit does this out of the box, by bundling up individual images for you.

A rails package I just came across does the same thing – check out http://documentcloud.github.com/jammit/ mentioned in Rails Inside.

Writing, Writing and waiting for Google Wave

Friday, September 4th, 2009

Back from a long summer holiday and lots to do. Having just put singup.org live we seem to have an endless stack of new work as well. (Ok, I didn’t put singup.org live – I was on Holiday.)

On top of planning a new series of articles for Linux Magazine on High performance and cloud computing, I’ll be busy bringing by previous GWT article up to date with the latest version.

Waiting excitedly for Google Wave on Sept 30th.

phake – generating PHP code

Wednesday, July 8th, 2009

I wrote a load of code called johnny5 about 4 years ago which could generate itself. That was the test – if the code generation code was good enough to generate the code generating code. It could. It was great and I did nothing with it.

Now, I have rewritten it as a phake script so you can generate little projects in as few lines as:

phake gen small-project my-project

(more…)

phake – make, in PHP. Nearly.

Monday, June 22nd, 2009

Today I pushed a relatively stable version of ‘phake’, a make-like environment written in PHP.

I’ve written this with a few things in mind: there are too many stand-alone PHP scripts in the world. Too many of those scripts don’t have easy to understand options. And, developers are lazy.

Grab it from: http://github.com/danfrost/phaker/tree/master
(more…)

1 a day…

Friday, October 24th, 2008

Learn by not doing – by watching, in fact.

If you haven’t got your head around Rails yet then watch one of these a day and you’ll get up to speed soon…

See www.railscasts.com

Hiring lazy developers

Sunday, June 15th, 2008

Writing at article on capistrano today, I was reminded of the quote from Larry Wall in his book on Perl Programming:

We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.

I’ve just been recruiting for a new developer, and one of the tests we always give developers pretty much tests their laziness. If they resort to rebuilding everything from the Browser up, it’ll take days. If the cheat, short-cut but get the thing working then they’re lazy – and hired.