A selection of JavaScript snippets that I've cobbled together over time.