Archive for the "Dump" Tag

JS Bin for Collaborative JavaScript Debugging

The weekend before last (28-Sep 2008) I blitzed through an idea I had on the shelf for about 6 months and put it live under the name JS Bin.

How to default a variable in XSLT

Since I couldn’t find this anywhere on the web, and I’m working on a project that has had me very quickly learn XSLT, here’s how to default a value in XSLT – useful if you’re looking to grab a variable via the query string, and it may not be there in the first place.

Query String to Object via regex

Just sharing a nice little code snippet that makes use of regular expressions instead of loops for converting.

Code Dumper

Code Dumper is a personal project of mine that I’ve used to practise some new skills on. It’s a code dumping repository with a couple of features that I think makes it unique from the other code bins. Where possible, I’ll blog about how particular aspects of the project so that they can be re-used […]

Pronounceablely Random

If you work in a secure(ish) environment then you’ll be changing passwords on a regular basis. An old colleague and I came up with a script that would generate a password based on fictional words from a dictionary lookup. Then we/he realised that this could actually be generated on the fly, be completely random and […]

Idiot Proofing the jQuery.ready

I’m always writing quick prototypes of ideas I’ve got, and often they’ll include some quick jQuery. However, for reasons unbeknownst to me, about 1/3 of the time I forget to wrap the statements in a .ready() function, and since I have the habit of putting my script tags in the head – the code never […]

JavaScript namespaces

Based on the Prototype namespacing made easy, except this doesn’t require Prototype. String.prototype.namespace = function(separator) { var ns = this.split(separator || ‘.’), p = window, i; for (i = 0; i < ns.length; i++) { p = p[ns[i]] = p[ns[i]] || {}; } }; This isn’t so much to ditch Prototype, but to encourage using […]