Skip to content

Instantly share code, notes, and snippets.

@zachrose
zachrose / js-tooling.md
Last active January 11, 2016 16:26
Front-end JavaScript Tooling Preferences

Front-end JavaScript Tooling Preferences

At the end of the day these are personal preferences that have worked for me in the past, but I'll try to sell them here with concrete benefits.

These preferences are dated early 2016, but have been stable for about a year and a half now.

Package Manager

Use NPM. Its the CPAN of JavaScript.

@zachrose
zachrose / apps.md
Last active January 27, 2016 19:03
One way to do front-end JavaScript apps

One way to do front-end JavaScript apps

HTML

Multiple pages in your app are just an illusion. Make one HTML document and put as many of your apps main states (pages, modals, etc) in it. Use CSS to hide and show them.

The idea here is to “statically allocate” as much of the view as possible, because it’s much easier to do that than to dynamically generate a hierarchical DOM and then keep track of what has and has not been generated. For something like a “detail view” of, say, bowties, just use one element and replace its contents every time your user looks at a new bowtie.

Besides, unless you’re building a desktop UI or something, most web apps have a limited number of states and pages anyways.

@zachrose
zachrose / reserved-words.txt
Created November 28, 2015 05:46
URL paths to reserve in a web app
about
admin
blog
calendar
contact
copyright
dashboard
email
errors
events
@zachrose
zachrose / gist:1332d95305503f268ede
Created September 1, 2014 00:20
Crash tolerant gulp watch on OS X
until (./node_modules/.bin/gulp watch);
do osascript -e 'display notification "Something broke." with title "Gulp"' >&2;
sleep 1;
done