fixes in code snippets

- jshinted snippets
- added OSX stuff to .gitignore