Blog
-
Pure CSS Tree Menu
The new selectors in CSS3 are very powerful, and allow for some interesting ways of creating interactivity on a website that doesn't rely on JavaScript. Typically, a lot of these new techniques are available in the majority of web browsers being used with the obvious exception of IE up tp and including 8, which limits their usefulness when compared with current JavaScript solutions, but that shouldn't…
-
Using PHP to make a HEAD request to get a files size
I had a request recently to get the size of a large collection of files that were hosted on Amazons S3 storage and add the values to a database containing a list of these files that acted as a local cache. I saw two main ways to achieve this: mount the S3 storage and treat the files as if they were local, or query the files on the fly as the sizes are required. I went for the second method, which…
-
Using XSL to convert XML to SQL
The new Energizer Europe website has recently launched, and it has certainly been one of the biggest and complicated sites I've ever worked on. Part of this complexity came from the fact that it was to launch across more than 30 regions of Europe and in 10 languages. Now, there are many brilliant people out there who are fluently multi-lingual and can quite easily read and interpret website copy coming…
-
Generating sitemaps for large sites
I recently had a requirement at work to product a sitemap (in the form of a basic list of URLs in a text document). Normally, I'd have a look at one of the various online sitemap generators, but they tend to stop indexing at a few hundred pages and require payment to index the rest; and the site in question contained around 7000 pages, spanning across mobile and desktop. Faced with this, I set about…
-
Roman to Decimal Conversion
I stumbled across a recent post on Stack Overflow where someone was asking how to convert from Roman numerals to decimal with PHP. The answers already there seemed more complicated than the ought to be, so I figured I'd write a quick function for it myself. This is only a very basic attempt, and doesn't take into account certain rules, like Roman digits which shouldn't be repeated, and what values…
-
Animated Glowing Line Drawing in Canvas
Following on from my last coding article showing how to create animated glowing lines in canvas this was an attempt at creating a simple animated drawing of a basic line art shape with the same glowing line technique. Because I wanted to be able to see the shape being drawn it had to be as a series of steps which could be broken down into manageable chunks. I also wanted the code to be flexible enough…