js and c snippets