Skip to content

Instantly share code, notes, and snippets.

@afahy
afahy / node-and-npm-in-30-seconds.sh
Created April 8, 2011 20:08 — forked from isaacs/node-and-npm-in-30-seconds.sh
Installing node.js and npm
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@afahy
afahy / gist:315955
Created February 26, 2010 17:53 — forked from paulirish/gist:315916
// everyone's new favorite closure pattern:
(function(window,document,undefined){ ... })(this,this.document);
// minified:
(function(b,a,c){ ... })(this,this.document);
// which means all uses of window/document/undefined inside the closure
// will be single-lettered, so big gains in minification.
// it also will speed up scope chain traversal a tiny tiny little bit.