Useful JavaScript Patterns Snippets