A few javascript helpers to copy/paste into a project.