Web

As a web developer I spend far too much time surfing the net and playing with websites; so when I find something really good (or bad) I write about it here.

Plugins Galore

10 Nov 2011
web

A set of plugins for wildfire & phpwax that handle common tasks

read more »

Localyser

10 Jul 2011
web

An attempt to crowd source UK postcodes.

read more »

PHP Iterators, RecursiveIterators and RecursiveRegexIterators

11 Nov 2010
web

As one the of big parts of our php wax framework we recursively scan over a set of directories and find all the php files. This can be seriously slow if you're not careful. As part of a set of improvements coming to wax we took another look at this and found the wonderful RecursiveRegexIterator.

read more »

Regular Expressions

10 Nov 2010
web

At some point in time you always end up having to write a regular expression to parse something. In the web, it's normally because the site/service you want to use doesn't provide and API, so you end up scrapping the page and having to rip the data out. Sometimes you need them for something simple, like finding links inside a block of plain text.

The common problem, I can never remember them and end up redoing them each time, so I'm listing some here.

read more »

Background Caching

15 Oct 2010
web

A new feature of phpwax that we've been working on is a handy new way of handling the layout cache. With the new method, the user should only ever get 1 slow request to a page, after that point the cached version is always served.

read more »

Load Balancing (Nginx / Apache) and Cache

15 Sep 2010
web

With quite a few of our more recent sites (a couple of biggies in the works...ssshh) speed and load distribution is very important. When you have 100 people a second trying to view a page every ms counts.

Although there are more elaborate ways (normally expensive, sometimes tech issues) which can provide blistering speed we use a good open source alternative.

read more »

Playing With Google Charts API

15 Feb 2010
web

With the up coming Multipack Hack day to work on a green focused end product I thought I'd make use of the newly released data from the government and google charts new api to make something useful.

I've gone for recycling per region during 2005/2006 in 1000s of tonnes and plugged in a few different chart types. When I get a bit more time will improve this.

All the javascript is inline (I know, very naughty..) so feel free to use whatever you want; although some backlinks would be nice!

read more »

Amazon S3 Does Version Control

23 Jan 2010
web

Amazon have set up version control on their S3 system ; it is currently in Beta (isn’t everything?) but looks like it could be very handy.

Having a scan over it the main problem I see is that instead of storing diffs between the versions of file they are storing the entire file again as a new object. As storage on s3 is insanely cheap anyway, you wouldn’t think its that big a deal, but think about it for a second.

If you are editing a high res video and storing it on s3, you could see your bills sky rocket. Lets say the video is 1gb, and you need to make lots of amends and get client approval for each one. With normal version control (something like dropbox I think is a suitable comparison here) you’d only be saving the changes between the original file and the current one. With s3 it’s an entire new file.

That is where you could easily end up using 10gb of storage by just amending a single file a few times. I can understand why, storing entire copies is easier then trying to figure out a diff engine capable of handling obscene file sizes.

read more »

WAAs New Website

15 Jan 2010
web

As I never seem to have the time to blog about much any more; it’s taken me far too long to mention this.

WAA used to have a reasonable website (I didn’t like all the pink). It was, most importantly, a valid XHTML site with only a single bit of flash. This version of their site had plenty of content, was updated regularly (until Chris Tomlinson left) with a really good page rank in google (If memory serves it was a 6).

What replaced it (not long after I left) was an abortion of a flash website, which I have already berated in an earlier post. Flash websites can still do well, if content is exposed properly. Theirs wasn’t. The number of times it was updated you could count on a single hand and they had removed pretty much every single article that had ever been written for that site. This is old ground; I’ve already moaned about it many times.

Towards the end of last year (2009) they launched a new website; and it wasn’t flash! Instead it is a good quality html website with some fresh content. A positive move for a change; lets see what happens.

read more »

More Git Hub Pages...

12 Jan 2010
web

Last year I moved my blog over to use git hub pages which makes use of liquid & jekyll to compile your website to a static version.

Git hub pages have now become my choice for any simple project website (just like my little front end to google’s closure optimiser) and to that end I’ve found a whole bunch of useful resources which will hopefully save digging around in the future.

So now I know how to use them well; just need to make a better design for this blog!

read more »

Google Closure Javascript Library

10 Nov 2009
web
google closure

Google have released their internal javascript library (no, this isn't about GWT, that is something different) and called it Closure. Odd name and one that is already heavily in use

Naming issues aside, the library offers a whole host of functions (like all the other major libraries) for dom manipulation, event handling, asynchronous calls etc. There are a couple of nice extras that it does have over other libraries.

Instead of loading the entire library in (which would be huge) you can just load the bits you need using the require call. Nice start, but it gets better....

read more »

The Next Revision...

22 Oct 2009
web

I got bored with my site design a few months back, finding it to fiddly and image heavy; so time for a change. Something simple this time, clean, plain, and a scatter in a few bright colours for contrast.

After searching around for a while I found the rather cool abstract vector image (sitting on the left ) over at pink moustache – strange name, cool image.

Mainly just something to break the whiteness and introduce the colour scheme used to signify categories.

I think this is about the 5th iteration of my site, switching platforms and designs along the way. My site is now sitting over on github – just need to add an external comments system …

EDIT (January 24 2010): Well that version was short lived, it was very ugly so changed it this weekend! Much better this way.

read more »

Git Hub Pages...

01 Sep 2009
web

Ooo, the very cool github that handles all your GiT repository needs has now introduced ‘pages’. This can be an entire repo or a single branch (called gh-pages).

It uses Jekyll and renders textile, markdown or good old html. For more details you can have a look at the official page or a really nice blog post I found talking about how to use them as a blog

read more »

Tiny JS Featured in Smashing Magazine!

22 Jun 2009
web

My pet project, Tiny JS made it in to a recent article on Smashing Magazine regarding javascript tools, resources etc!

Great way to start a Monday!

read more »

OS X Web Development (Revisited)

06 Jun 2009
web

Although I covered this once before, many updates of OS X have come and gone, so it is about time to re write the post!

This new post will cover how to setup and install all the bits you need to get a good working environment for a LAMP developer, click though to read it in full!

read more »

IE 6 Repeating Characters Bug

29 Apr 2009
web

Ok, so I’ve just discovered another wonderful way to trigger this bug. Apparently putting html comments inbetween floated containers makes the last character repeat! The joys of IE….

read more »

IE 6 Bug - Repeating Characters (Revisited)

28 Apr 2009
web

Ok, so I’ve just discovered another wonderful way to trigger this bug. Apparently putting html comments inbetween floated containers makes the last character repeat! The joys of IE….

read more »

Preferred Stylesheets...

18 Feb 2009
web

Recently I came across a very strange issue while converting an existing website. As I’m just porting it over to our framework no design or styling work was required, so I’d just been copying the header and footer files into our layout system when I noticed something.

This site was using HTML 4.01 and all the stylesheet links had a title attribute, this trigged an obscure issue I had never encounted before. According in the HTML 4 spec setting a title attribute converts the stylesheet to a preferred stylesheets and only one of these can be loaded in at any time. This meant a whole bunch of styling would disappear even though its clearly visible in firebug etc. For more information take a look at this article.

read more »

Flash - aha - Saviour of the Internet?

20 Oct 2008
web

Flash has its place; it’s great for adverts, playing movies and anything that really, really needs smooth animation, but whole websites? I think not

I’ve always had an issue with Flash being used in such a fashion. Yes, google can now index some of it, but only if it’s been coded properly and in a search engine friendly way. During a recent project (for the Impreza S microsite) we had several discussions about how best to present the creative we had for this site

In the end flash won, but with lots of consideration towards how google et al. Firstly, not all of the site is in Flash (yey!) the navigation is HTML and interacts with the flash. A few other things like sitemaps help the site to be friendly. p. The reason for our decission to go with Flash is mainly due to the colour changer. Regardless of how good the ajax libraries are (jQuery in particular) they currently don’t handle image switching quite so smoothly. The final reason was the page transition; I still find it somewhat unusual and a bit disorienting, but a good effect.

On the whole I feel the site is nicely done (good job Sheldon!) and considering the timeline for it, it is a sterling example of how flash sites should be handled.

On the other hand, some flash sites worry me. Certain so called ‘creative’ agencies who decide that just because they’re creative they need their site to be ‘creative’ – which to them means Flash. In most of these cases you will find that the reason for the entire site being flash is something stupid like ‘we want our logo to be animated and interesting’

There are many such sites out there, you just have to look for them. When you find them ask this question: ‘Is that silly little logo / animated character / smooth page transition / custom font worth the issues with accessibility, maintenance, readability etc’

read more »

So many OS', not enough machines..

25 Jun 2008
web

If like me you have to test your work for the mass market (that means windows) and cater for the majority (yes, that means IE6 and 7) but you are of more discerning tastes and don’t enjoy viruses, malware and endless updates (in other words, you don’t use windows) then you probably use a Mac (yes I do!). So how do you get around the problem? Simple answer, virtualisation.

Basically this means that you can install a piece of software of your machine that lets you emulate another operating system. Most of the established solutions cost money, not much (around £40), but still more than nothing.

After trying both VMware and parallels found them to be very very useful, but at the same time memory and processor hungry. For example, say I have the infamous double margin IE display bug and I’m trying to find the right container to add the display attribute to. I Have textmate open, photoshop (as I’m still working on the design), firefox, safari and VMware; switching to and from applications becomes sluggish.. There is a better way..

VirtualBox, developed by Sun, is faster and smoother than the others I have used and has an OpenSource version! Goodbye VMware!

The only draw back is that the free download doesn’t have support for wireless cards on macs, but otherwise it’s brilliant. Supports lots of operating systems (almost every flavour of linux I can think of) and is very fast. Great example of this, full reboot of plain windows xp (with service pack 2) in under 1 minute…

read more »

Firefox Day!

16 Jun 2008
web

Firefox, the developers best friend, is due to get a big update tomorrow… A shiny new version will be let lose on the world. Yes I do know about the release candidates, betas and alphas but they don’t really count; when was the last time your mother downloaded something like that?

Anyway, to mark the release they are planning to break the world record for most downloads of a single piece of software in one day. Good luck, I for one will be downloading it, lets just hope their servers can cope!

Take a look at Spread Firefox website for more details.

read more »

Geek in the Park 2008!

20 May 2008
web

The time is almost here for the Multipacks semi regular (hopefully will be regular, this will be the 2nd time) summer time extravaganza; Geek in the Park!

As previously the event is aimed at geeks and their families with the day being split in to two; the afternoon picnic and the evening talk

The afternoon picnic last time was a resounding success with lots of people from all over the country coming down to point and laugh at us trying to play football… The only downside being a lost Frisbee and an almost lost ball (this time we’ll try not to play by the river, honest!). Thanks again to the rowers for rescuing the ball

This years evening talk is aimed at being a bit more interactive and we should have some great speakers (once its all confirmed). So keep an eye on the website and come on over for some geek fun in the sun (hopefully!).

read more »

Developing Locally in Leopard

11 May 2008
web

Your mac is set up and ready to go, but how exactly do you go about setting Apache up in OS X Leopard these days? Well it's it a bit more like linux now with the demise of Network Manager (I think thats what it was called, been a while since I used tiger), but its not too hard, honest!

Firstly decide what suffix your going to use for your local machine, be sensible and use something meaningful like .local or .dev. Dig out your apache vhost file (httpd-vhosts.conf) and set up the file.

Click on though to read more on how to get it up and running.

read more »

April fools!

01 Apr 2008
web

Ok, play time for all the web geeks.. Best of the best so far..

read more »

How To Setup OS X Leopard for LAMP Development

29 Mar 2008
web

Having recently received my lovely new work Macbook Pro and have been setting it up for some serious PHP and MySQL development. Some of these stages were seriously difficult to find and it took myself and Sheldon Els (also on his shiny new Macbook Pro) a while to figure out; so we thought we would share..

read more »

Retro Gaming...

28 Mar 2008
web

Inside every geek/nerd lies the heart of a gamer; whether its a fast paced FPS or an all encompassing RPG sprites and polygons make our strained eyes twinkle. Harking back to the good old days is becoming more popular as the simplicity is appealing.

While indulging a bit of nostalgia I came across a great site which has converted the legendary Arkanoid to a web game made from javascript! Have a play here.

read more »

Netscape No More

29 Feb 2008
web

As of the 1st of March 2008 Netscape is officially dead and buried. That date is the last day parent company AOL will support the browser.

Netscape was one of the first modern generation browsers with, at it’s peak, over 90% of people using it (in the days of 4.7!) but has recently slumped to a miniscule 0.6%. This huge swing in fortune was the decisive factor and the end of Navigator was set last year by the various boards and management at AOL.

Netscape Navigator was a very important piece of software laying down the ground rules for almost every other browser including the IE series and will go do in history.

In spirit it will on in the form of Firefox, Flock and various other Mozilla based browsers. The Mozillia foundation was created by former Netscape staff who were made redundant in 2003; since then they have once again had large scale success with Firefox now corning over 20% of the worlds browsers.

read more »

Real Programmers

02 Feb 2008
web

xkcd.com with another cracking piece of nerd comedy!

read more »

IE 6 Bug - Repeating Characters

01 Feb 2008
web

After coming across this really annoying bug many times I thought it was about time I made a note of it somewhere.

When you starting mixing floated containers with non floated containers the IE 6 only parameter hasLayout triggers to -1 causing all sorts of chaos in your layout; most notably tail characters repeating themselves. This is a big pain in the ass and is a little devil to fix.

To get your layout working again you have to get hasLayout back to 1. This can be done in several ways but the most successful seems to be by adding display:inline onto the containers (and sometimes the items inside) style declarations and crossing as many body parts as you can (for luck).

Other methods for fixing this is to set margin-right:-3px or to change which parts are floated (if your layout allows).

read more »

Loading...

31 Jan 2008
web

Like many web developers I find myself creating more interactive pages with ajax elements and lots of imagery. When these images come from things such as flickr pools or rss feeds the load time can be dramatically increased leaving big blank sections on your page.

The best way to still load all your remote content in and inform the user of what is going is to use a loading image. I can never find a a decent one when I need it most, so this site I came across is great! You can select a suitable style, background colour and foreground colour and the site creates a gif for you!

Try it out yourself here.

read more »

IE8 Stupidity

24 Jan 2008
web

Maybe I spoke to soon when I congratulated the IE8 development team on creating a browser capable of passing Acid2 as it now looks as though they have thrown away all their hard work be being stupid.

With the switch between older versions of IE they implemented a malformed doc type detector to enable what was commonly known as ‘quirks mode’ so the site would render using the previous engine. At first look you’ve got to think that this was bad as you could end up with thousands of broken sites which relied on the old, faulty engine. And thats the point.

The only way to get old sites which only worked with faulty / flawed rendering engines is to make sure that when the users of the site install a new browser the site breaks. After all these users start complaining making the site work correctly suddenly appeals a lot more.

This is NOT what has happened with IE 8.

Instead MS and their development team decided to flout previous acceptable methods and create a meta tag to signify the site should use then newly compliant engine. So why exactly would anyone spend time and money turning their old site? As far as they are concerned the site works, who cares if its standard compliant.

Yes its tough being the browser that most people use and with such a bad record of adhering to standards a big switch to a compliant engine and site that was made for your old engine wont work and your stuck answering thousands of email complaints. Is this a goog enough reason… I don’t think so; grow some balls and break the sites are meant to be broken!

If you want to see opinions of world renowned web experts on this stupid decision, take a look at opera watch.

read more »

Flickr-tastic

18 Nov 2007
web

Several months ago the amazingly popular website Flickr opened up its service and functionality to the general public by means of an impressive API. Of course a large proportion of the internet users don’t know what an API is never mind feel the need to use one.

However, as part of the php-wax framework development I created a very basic plugin to use the Flickr API. You can see an example of its use on the front page of this website. Once the framework has been released and out of beta I will write a proper article about its uses with code examples.

read more »

A Search Engine to Call my Own

17 Nov 2007
web

Recently I had an unusual but intriguing question posed by a work colleague. Could I create some sort of bot to scan sites relevant to some keywords and market area specified by a client so the client could keep an eye on current events in their field. On first look I almost dismissed it, then i thought about it for a while…

How about a facility inside their CMS which would let them list these keywords and then some how from these keywords pull back a list of appropriate websites. Then from this list (and of course allowing users to add some more of their own) search for pages containing another set of keywords and then using some statics track the rise and fall of these keywords over a set duration.

Not a bad idea i thought, so i looked into implementing it and came across another great utility provided by yahoo. Yes it’s another api, but this one is useful. The web search REST service allows anyone to query yahoo’s search engine, specifying all sorts of parameters and retrieve the results in multiple formats including serialised php and xml.

Great! Now all I need is the client to agree to it and I’ll be making a meta search engine.

read more »

XKCD - 1337

10 Nov 2007
web

One of my regular online reads along with the long standing Dilbert is a web comic called xkcd. It’s very geeky, but lots of fun. Recently they have just produced some of the funniest issues ever in the shape of a 5 part monster about the way of the hacker.p. Anyway, the links are:Part 1Part 2Part 3Part 4Part 5

read more »

It Lives!

16 Oct 2007
web

After many months of putting it off and getting distracted (dam WoW!) I have finally put some time in and got my new site sorted… Well, mostly

Lets start at the beginning; I am one of the developers working on a new php framework called php-wax. I won’t get into details in this post (please see another post – when i write it!) but basically it does what rails did for ruby. Once the framework got to a certain point we started to develop a CMS system to go with it to allow simple updating of content and make everyday minor updates simple.

This new site is an example of how flexible these can be and lots nicer then messing around trying to hack wordpress to do something new. Two big changes to the standard combination are the custom comments module and an alteration to how the content is found, allowing categories to be used in a similar fashion to the sections list

On a side note the home page also uses some cool javascript and php-wax’s flickr API (something I wrote a while back, ok for the basics not tried anything too daring with it yet) to create a slide show of my most recent photos. If this is well received I will probably use it and jmodal boxes on actual content pages

Anyway, where was I… The comments module is a custom module inserted into the CMS, hopefully I will get round to tidying it up and convert it into a plugin to make future use nice and easy.

That is one of the great features of php-wax, the fact you can run one simple command and do lots of great things. This ranges from installing plugins to deploying the website onto a live server. Anyway, thats enough talk about the technology of the site and time to move onto its purpose

As with every web developer I’m only as good as my last site, so I’ll be adding a portfolio section to showcase what I’ve been working on along with the usual sport and hobbies.

read more »

MS vi?

20 Mar 2007
web

See how things might have been if Microsoft had done vi! See here.

read more »