Handy for when working on single-page apps
npm install -g server-herehere(if you're in a folder with files you want to serve)
here --dir [directory to load files from] --port [port to use]
| web: node index.js |
| # Prep /usr/local | |
| sudo chown $USER:admin /usr/local/ | |
| # Install homebrew | |
| ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" | |
| brew doctor | |
| # Install git, imagemagick, redis, mongodb, postgres | |
| brew install git imagemagick redis mongo postgres | |
| ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents |
| if [ -f ".rvmrc" ]; then | |
| source ".rvmrc" | |
| fi |
| function Parent() {} | |
| Parent.prototype.a = 'Foo' | |
| Parent.prototype.aGetter = function() { | |
| return this.a | |
| } | |
| function Child() { | |
| inherit(this, Parent) | |
| } |
| var fs = require('fs') | |
| , logfile = './logs/output.log' | |
| , errfile = './logs/error.log' | |
| function logger(dest) { | |
| return function() { | |
| return fs.createWriteStream(dest, {flags: 'a'}); | |
| } | |
| } |
| function MyClass() { | |
| // ... | |
| } | |
| // AMD and window support | |
| if (typeof define === "function") { | |
| define(function () { return new MyClass(); }); | |
| } else if (typeof global.alertify === "undefined") { | |
| global.myClass = new myClass(); | |
| } |
| ln -s $(pwd) ~/.pow/$(basename $(pwd)) |
| function Child() { | |
| Parent.call(this); | |
| } | |
| extends(Child, Parent); |