Some JS snippets