Is nginx going to overtake IIS?
According to Netcraft, in May 2012 it’s getting very close.
According to Netcraft, in May 2012 it’s getting very close.
I always assumed getElementById, being native code, is faster than any “manual” implementation where you manually store all the IDs in a JS map.
This JSPerf says it’s not true.
Annoyingly, svn add is not recursive. If you have upgraded a project and a whole bunch of new files are added in various folders, there is no easy way to add them all in one go from the shell. Except for this:
Structuring CSS has long been a struggle, due the limitiations of the language. There seem to be a growing consesus that some of the best practices, particularly the admonition against “classitis” and introducing non-semantic elements, are actually detrimental. Here’s a roundup of some discussions on the issue.
Continue reading
If you have a large movie file you want to burn to DVD with iDVD, and would like to split it into chapters automatically, here’s what to do.
Continue reading
The new iPad launch caused a flurry of activity as web developers are trying to get to get grips with the Retina display. Continue reading
Movies as told by geeks, some lovely games, Chrome deveoper tools, performance tips, WebGL, and more.
Continue reading
The task: creating a RESTful Python backend for a simple recipe manager. Continue reading
To have a $ in your replace strings in Javascript regular expressions, it needs to be escaped with another $ ($$) not a slash (\$):
Just had a little play with LabChirp, a no frills yet powerful sound generator for Windows.
The task: setting up tools for generating and testing a webapp from the command line. Continue reading
What I did to install Apache HTTP server 2.2 and PHP 5.4 on OS X Snow Leopard.
Continue reading
The task: as part of creating the CMS for recipes, this week’s challenge involves converting plist data from an OS X app. Continue reading
US wind patterns, a 3D jewellery storage, the evil of localStorage, a step up from a css reset. Continue reading
The task: as part of creating the CMS for recipes, this week’s challenge involves fetching data stored in Google Spreadsheets and converting them to XML. Continue reading
To quickly find the number of days between two dates, you can type this in the JS console
title some words will change the title of your cmd shell in Windows to some words instead of C:\Windows\system32\cmd.exe. Handy if you have a few of them open and can’t tell them apart.
The task: to get started with creating the simplest CMS for recipes, which will use the HTML 5, Buster.js / Sinon for TDD. This week’s challenge includes setting things in motion using simple ST2 templates. Continue reading
An example of how to use functions in JS regular expressions to imitate the /e flag other languages have
"abb Cdd-Eff.ghh 1AAA".toLowerCase().replace( /(^|[^a-z0-9-])([a-z])/g , function(m,m1,m2,p){ return m1+m2.toUpperCase(); } ); Continue reading
//output: Abb Cdd-eff.Ghh 1aaa
Safari has a debug contextual menu, which can be enabled by typing the following into Terminaldefaults write com.apple.Safari IncludeInternalDebugMenu 1
The task: a Python script to clean up old Jenkins deployments from the filesystem and the database. Continue reading
Firefox is going to support SPDY, Google’s alternative to the HTTP protocol. More on SPDY
The task: reverting to a known stable build with Jenkins.
Continue reading
A very clear post in Open Sourcery PUT or POST: The REST of the Story about the difference between PUT and POST in REST. What the post doesn’t make clear enough, though, is that PUT requests can be cached, while POST aren’t.
The task: summarize notes from a lecture about scaling PHP apps. Continue reading
A geeky approach to layout and typography – full lecture on Vimeo. Continue reading
The task: coming up with a branching strategy to work with Subversion and Jenkins. Continue reading
The task: setting Jenkins up to recreate a WordPress site from data stores in a repository. Continue reading
The task: setup a simple CI system for my Linode using Subversion, Jenkins, and Ant.
Continue reading
One liner to start an HTTP server from any folder in OS X: alias server='open http://localhost:8000 && python -m SimpleHTTPServer'/via Jeffrey Way
Assorted ImageMagick commands to combine images (I use them for screenshots of interesting sites). Latest: arranging images in a grid
Continue reading
The task: collect HTML5 canvas tutorials and assess them. Continue reading
Mozilla’s David Mandelin has published an interesting slideshow about JS optimization. Here are the takeaway points in case it disappears. Continue reading
The task: distill my Google Apps Script (GAS) know-how into a Spreadsheets boilerplate, and document it. Continue reading
CSS is in serious danger of becoming sexy. If animations, transitions, and CSS shaders weren’t enough, layout modules are on the way.
Snippets are pieces of text, with or without placeholders, that you can have your editor paste in when you type a shortcut. Many editors have them; here’s how to create them with the Sublime Text 2 editor. Update: found some unofficial Snippets documentation
Continue reading
The task: a Python shell script that calls webkit2png repeatedly to take screenshots of a website at various intervals. The script will be called webkit2loop. Continue reading
Virtual Router allows you to set up a WiFi hotspot from your Windows 7 machine. Or you can do the same from the command line without any extra software. Continue reading
The task: a PHP shell script to read JSON data (from a file, or CouchDB for extra points), and use it to manage tasks in one’s Calendar. The script will simply be called jsonToGoogleTasks.
Continue reading
The configuration properties for the jasmin maven plugin in XML format. From the the Jasmine maven plugin homepage and the plugin source
Continue reading
I am sure I have missed an obvious config setting, but the quickest way I found to display passed tests in Jasmine when the page loads, without having to click on the checkbox, is with a JS function that uses the proxy / decorator pattern. Continue reading
A very simple Weekly Challenge to get me started. The task: create a series of aggregators of RSS and twitter feeds, and a simple HTML scraper, using Yahoo! Pipes. Continue reading
Interesting day at the GDD Berlin. Didn’t learn anything that blew me away, but it was good to see Google’s enthusiasm for sharing their technology with developers. Still not convinced about DART, but the food wasn’t bad.
[Update] all the slides from GDD Berlin are now available online
Continue reading
As I am moving to the Sublime Text editor, here are some Eclipse shortcuts before I forget them through lack of use. Continue reading
With so much exciting web technologies being developed, getting time to play with them all can be difficult. So I am trying weekly challenges, where I give myself a simple task, and a week to solve it using a technology of my choice. Continue reading
For my reference, a list of PHPUnit assertions from the PHPUnit book Continue reading
If you are not happy with the jQuery.validate plugin displaying error messages within label tags (because they are clickable for checkboxes, or for whatever reason), set errorElementto the name of the tag you’d like to use, e.g.$("#form").validate({ errorElement: "span??? });
More examples on Mitch Labrador’s Tech Blog
Extract, transform, and load (ETL) is a process in database usage and especially in data warehousing that involves: (E) Extracting data from outside sources; (T) Transforming it to fit operational needs (which can include quality levels); (T) Loading it into the end target (database or data warehouse). Continue reading
It seems the ‘Factory Reset’ option in the ‘Security’ setting of the HTC Hero has been removed. Here’s a way of doing a hard reset that actually works.
Continue reading
A workaround for when Java developers hardcode local paths in maven scripts and commit the pom files to source control – something would be the name of the path, clean install war:inplace is just a sample command:
mvn -Psomething="/PATH/TO/SOMETHING" clean install war:inplace
It isn’t immediately obvious, but Evernote offers advanced search operators. Continue reading
Google Maps introduces weather – in the pulldown menu at the top right corner of the map itself. Continue reading
There is an interesting screencast by Chuck Rossi, release manager, on how they manage the release process at Facebook. Worth seeing, but if you haven’t got the time, here’s a quick executive summary. Continue reading
The more time I spend coding in Javascript, the more PHP feels old and clumsy. Many developers feel that way, and that’s probably why they introduced a small, JS-like improvement in PHP 5.4 – short arrays: $a = [1, 2, 3, 4];
$a = ['one' => 1, 2, 'three' => 3, 4];
I have been using Capsule, a CRM, for a couple of years, to help me manage the endless stream of emails from recruiters. It has some good features, but it is not really suited to freelancers. It may work well for sales people, though. Perhaps. Continue reading
While front end developers debate about polyfills, a slightly more controversial Javascript library, Sugar.js, promises to “let you do more with less code”. I am still in two minds about this. Continue reading
There are a few different ways of handling MySQL in in PHP. Ext/mysql, i.e. the functions that start with mysql_xxx, is the oldest and most well known. It is also insecure, doesn’t use all the database features, and will be phased out and in future releases. Use mysqli instead, or at least pdo_mysql. Continue reading
Paul Kinlan’s Web Intents post ends with “This project will fundamentally change and improve the way we build applications on the web today for our users”. A strong statement – and to be fair, the project does look interesting.
Still very early days though.
So far there is a WebIntents API on github, some examples on Intent: Share and some examples on webintents.org.
CSS3 transitions fire off a TransitionEnd event when they end, so that you can attach a Javascript handler to it. The only (minor) inconvenient is that the event takes different names depending on the platform. Continue reading
Some of the more bleeding edge features of Chrome are switched off by default. You can switch some on by visiting ‘about:flags’ in Chrome. For the rest, you’ll have to start the browser from the command line and type the option manually. On a mac you do that by typing open -a /Applications/Google\ Chrome.app/ --args --YOUR-FLAGS-HERE
Here’s a list of Chrome command line switches Continue reading
I always used to wonder where to put unix based scripts on my Mac without them getting in the way. The solution is simple: create a bin folder in your home directory, and add it to the path: export PATH=~/bin:$PATH(from the Advanced Command Line Screencasts)
Here is some code to create a new taxonomy term for each post of a given category. Continue reading
If you edit your .bash_profile you will need to either quit your current terminal window and open a new one, or run this command to reload the settings: source ~/.bash_profile.
Quicksilver has been moribund for a while*, and it was only a matter of time before I switched to Alfred. The switch was much simpler than I anticipated – I had the two apps running side by side until I was satisfied I could do the same things with both. Didn’t take long at all.
* apparently not – see comments Continue reading
Auto-revisions can be very useful, but I find they just fill up the database with needless data, so I disable them with this line in wp-config.php:
define( ???WP_POST_REVISIONS???, false ); Continue reading

Plastic labelling can be misleading, because you need to know what the numbers mean to know whether an item is safe to re-use as your lunchbox. Most aren’t. Continue reading
Here is a bookmarklet to generate HTML code for external links you can paste in your WP editor (or any editor for that matter). Just drag it to your browser’s link toolbar.
Just installed the Awesome Screenshot browser extension by diigo.com on Chrome – very happy with it. So far it’s the best extension of its type I have tried. You can quickly just save the screen grab as is, or you can annotate it first, which is very helpful. 5 stars.
Google have just extended Google Apps Script to work in Google Docs too. API Documentation is available.
I installed the latest version of Google Chrome on my Mac, and next time I logged on I got a Little Snitch alert – GoogleSoftwareUpdate was trying to connect to Google. Apparently this happens with all Google software, like Google Earth etc. Here’s how to get rid of it. Continue reading
Google Apps Script (GAS) is an implementation of Javascript that runs on Google cloud servers and allows access to Google services. Support is still somewhat flaky, but if you are already familiar with Javascript it is an exciting technology to get into. In this simple Google Apps Script primer, we will use a Google Docs spreadsheet to learn the basics Continue reading
Running the status command in the command line version of subversion returns a list of files with a one letter code in front of each file name. Here’s a list of those one letter codes and what they mean.
svn status Continue reading
M src/index.php (etc)
UPDATE: don’t waste your time with Quicksilver. Use Alfred instead.
I was happily running YUI Docs when suddenly it stopped working with the error: “DeprecationWarning: the sets module is deprecated”. Turns out that YUI Docs doesn’t like any code above the first Javadoc block.
One of the nice things about OS X is that it has Unix under the bonnet. That means you can install all sorts of geeky software like ImageMagick or xdebug; but, knowing where to put things can be confusing if you are new to it. Here’s a quick guide to the folder in OS X, particularly the Unix (or strictly speaking, FreeBSD) side. Continue reading
In OS X, PDF files can be concatenated manually using Preview. But if you are happy using Terminal there’s an easier way, thanks to a Python script installed by default in /System/Library/Automator Continue reading
Everyone at work seems excited about Domain-driven design. Here are some useful links Continue reading
Having to deal with boring admin landlord admin. This may be useful, so I thought I’d share it.
Continue reading
Occasionally cheese lovers ask me to recommend them good, less known Italian cheeses. Here’s my list.
Continue reading
Looking for files inside an archive, without having to extract them first? Using Apple’s Terminal, or any Unix / Linux bash shell:
find /dir/ -iname archive.tar -print0 | xargs -0 tar t -f | grep "filename you are searching for" find /dir/ -iname archive.zip -print0 | xargs -0 unzip -l | grep "filename you are searching for" find /dir/ -iname archive.rar -print0 | xargs -0 unrar l | grep "filename you are searching for"
To list files that were changed in the last day, sorted by size, using Apple’s Terminal, or any Unix / Linux bash shell: sudo find / -type f -mtime -1 -print0 | xargs -0 du -sk | sort -nr(thanks mynamewasgone!)
Continue reading
Actually titled ‘La Farfalletta’ (the small butterfly) this is a short children poem written by the milanese Luigi Sailer in the 1850s. Trilussa, a roman poet, added a risqu?? extension it in 1917. Continue reading
XML Sitemaps are documents which list all the pages in a site, including some metadata for each page. They are useful for search engine indexing. Arne Brachhold has created a great free sitemap plugin for WordPress called Google XML Sitemaps Continue reading
Finally finished redesigning the site. Still testing it and cleaning it up, but it’s pretty much there. The old one was a bit fiddly, and I wanted to separate the blog from the portfolio proper. Also, I intend to add more Ajax and Flash functionality, bit by bit as I have time.
A quick way to remove empty elements from an array is using array_filter without a callback function.
$myArray = array_filter( $myArray ); This will also remove 0s (zeroes) though. Continue reading
To copy a directory tree ignoring all the .svn folders, use this
cd DIR_FROM Continue reading
find . \! \( -name . -or -name ".svn" -or -path "*/.svn/*" \) -print | cpio -padv PTH_TO
As from version 5.2, PHP comes with built-in data filtering. Which makes validating emails and URL very, very easy. Continue reading
Rar is a popular archive format on the web. When I need to unarchive several rar files at once, I use RarLab’s command line tool. Here’s how.
Continue reading
When you take a screenshot of a window with Mac OS X Leopard (CMD+CTRL+SHIFT+4, then spacebar), and paste it into Photoshop, it will be surrounded by an annoying black frame around it. Here’s how to get rid of it. Continue reading
You can set use the input task to make Ant ask for parameters on the command line at runtime. Continue reading
In my increasingly more and more frustrating attempt at finding some use for OpenOffice, I tackled file formats, including batch file conversion. As you can expect for an application written in Java, it wasn’t easy. Continue reading
I tried to have a play with the OpenOffice 3.0 db app to see how it would work on OSX as a way to input data into mySql databases. Continue reading
To change the command line prompt on bash, my shell of choice, you need to edit the file .bash_profile in your home directory. To do that, UNIX machos will tell you to use vi. This I find only slightly less painful than walking on my knees on dried chickpeas, and I won’t touch it (I won’t even touch vim, its marginally less awkward cousin). Continue reading
To have an ASP page send an email with non-ASCII European text (Cyrillic, Greek, Czech, etc) you’ll need to use UTF-8. Continue reading
Writing an excel worksheet to a browser is pretty simple – all you need is the correct response type, and to format the data using an HTML table. Continue reading
Enumerators are collections of data that can be iterated through. Although useful, they are not compliant with ECMAScript standards, and therefore I prefer not to use them. Some objects in the ASP environment however, such as Request.Form, are provided as Enumerators, and need to be converted them to standard JScript objects. Here’s a couple of routines to do so. Continue reading
A quick way to skew random numbers towards 0 is to raise them to some powers – the higher the power, the higher the skew. Obviously not the most efficient way of doing it, but could be useful in certain occasions where performance is not an issue.
var num = Math.pow( Math.random(), 2 );