javascript quick snippets