Got my first Amazon EC2 instance up and running for nodejs development

28 Feb

Thanks to cuppster.

GIT command line coloring

17 Jan

PS1='\[\e[1;32m\]$(__git_ps1 " (%s)")\[\e[m\]'
PS1="\[\e[1;36m\]\h:\W\[\e[m\]$PS1\[\e[1;36m\]> \[\e[m\]"

Mobile html5 compatibility matrix

14 Sep

Here is a list of html5 features and their implementation status on various mobile devices

Hilarious – logo gone wrong

20 Feb

Here is a collections of examples of company logos that leave the viewer with the wrong idea!

On version control, automated builds and continuous integration and web development

14 Feb

Most web developers don’t know the first thing about version control. That’s probably not entirely fair. They’ll download the latest version of their CMS, plugins, extensions and whatever from GitHub or even from some subversion repository. But ask them if they keep their own code in version control and you’ll  probably just get a blank stare. When I started in the this branch I was initially shocked to see my mentor editing a live site online. Well I got over that, put on my new cowboy hat and got down hacking out code, throwing at a server and forgetting about it.

But recently a client stated that they wanted their new TYPO3 website to done just like their java based sites with version control, automated builds and continuous integration.

Version control

Quite liberating really. I mean really, what’s all the fuss about? Pft. There are backups of the live site (well if I host them there are). If you have to work further on the site you can just tar it up copy it to your development machine and get cracking on the new code. Most of the time we are coding alone so there is no need merge our code with that of another. If the changes are significant then we can just make periodic backups of the work in progress… Ah. That last point. Periodic backups of the work in progress. That’s actually a good reason to use version control. That’s actually what you are doing by making backups.

By using formal version control you get all sorts of tools to help you track your changes, retrieve versions that did work (if you lost the plot after coding a bit too deep into the night), compare files and all sorts of other handy things. The thing is that lots of people do this every day and some of those people have thought long and hard about how to provide general and effective solutions to problems related to version control.

Once you’ve got your sources into a subversion or Git repository and you’re happily making branches, commiting changes and merging back to the trunk you might want to think about an automated build process.

Automated builds

Automated build scripts define the process required to convert your source code to a working deployable program, website or whatever other deliverable software. I like to use Apache Ant for build automation. There are other tools and you can read all about them here.

Now I have to admit that the build process for a website written in PHP is more or less trivial. The source code is all ready to run. If you really want to knock yourself out you can let your build produce a tar but that’s about it as far as building is concerned. There is nothing to compile, except maybe minify some javascripts and remove whitespace from stylesheets but that’s really about it.

On thing that an automated build really helps with configutation management. If you have factored out all the configuration in yours site then you can incorperate the application of the correct configuration into your build process. That means that you can isolate the configuration of all your environments into one file (or one set of files) and chose which configuration set to use when running an automated build of your site.

Continuous integration

Once you have version control and an automated build you can hang it all in a continuous integration environment. A continuous integration environment runs in the background or on a dedicated machine and performs a build based on some trigger. It can be used manually by using the build now button. If can be confugured to run periodically to produce a nightly build for example. Or it can be configured to run whenever changes are committed to the version control system.

Using a continous intergration environment is a nice way to glue your version control, build scripts and configuration management together to produce hassle free repeatable build results.

Selected tools

I’m using Git for version control, Apache Ant t for my build scripts and Hudson as my continuous integration environment.

On version control, automated builds and continuous integration

Test your browser’s HTML5 support

02 Feb

Busy busy busy. New contract at the BKWI for four months building a large TYPO3 site, a little bit of work still to do on AHK’s Beroepkunstenaar, couple of weeks work still to do on the 9-box iPhone app, new site for Casting Consultants v2.0, WordPress site in exchange for a photo shoot… Not much time keep up my blog and pet projects 🙁

Oh well. No rest for the wicked!

Anyway here is a link to a handy site that will check the HTML5 support of your browser.

Old school meets new school

21 Jan

Here is blog post from what looks like a twitters developer. He’s telling us to be careful when adding event handlers for events that can fire a lot (like window scroll). The problem is that if you load up the event handler with lots of code then the system will become unresponsive because the event is fired too often.

If you have ever written a device handler (once upon a time you may have written a mouse handler just for fun) then you will know that in your interrupt handlers you should do the absolute minimum (like saving the mouse x and y deltas and nothing else). Then on a timer (or even better when when mouse coords are queried) you should do the CPU intensive(r) processing.

I am pleased to see that these old school skill are being invented by the new school programmers.

Google CDN

20 Jan

I often find myself writing the following

<script type=”text/javascript” src=”/js/jQuery.min.js”></script>

and thinking, “this is silly, why don’t I fetch it from” Without really having a good reason to choose either way I just kept on with what I knew, “if it aint broke…” right? Well today I came across this article and now I do have a reason to change my ways. Ok, ok, I’m a bit slow maybe (the article if from 2008) but better late than never.

<script type="text/javascript"
This is better for two reasons. 1) My server doesn't have to do any work to provide the file. 2) As more people use this method the chance that the file is cached increases, with a bit of luck jQuery will already be available on the client.

A follow up article on the same site makes it clear that there are are a few gotchas and explains how to handle them. Particularly the effect of using http: links in https: pages. Turns out that if you exclude the protocol specification in the link URL then the browser’s underlying protocol will be used instead.

<script type="text/javascript"

Then I started to wonder what other javascript resources were lying about Google’s CDN. Here are Google’s own contributions and here are some third party libraries like jQuery. Take a look at Google’s visualization library, I am particularly impressed by the suggestion that Google docs spreadsheet can be used as input for a visualization! Bit of a shame that it embeds a flash object thought :/

CSS background image hacks

19 Jan

All pretty obvious stuff but here’s a concise article about the ins and outs of using image sprites.

Things to do…Check out appcelerator

19 Jan

No time to check it out now. Might be interesting. I suspect it is a HTML5/javascript development environment with browser bootstraps for each target device but a colleague suggests that it’s a C++ environment. I’ll have to download it and check it out before I start on my next mobile app.

Stuart McFarlane

Mobile Media Constructs