A collection of useful js snippets