Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
var express = require('express') | |
var app = express.createServer(); | |
var JSHINT = require('jshint').JSHINT; | |
app.use(express.bodyParser()); | |
app.get('/', function(req, res){ | |
res.send('hello world'); | |
}); |
(function(def){ | |
def('myModule', ['someDependency', 'somethingElse'], function(someDependency, somethingElse){ | |
//return the module's API | |
return {}; | |
}); | |
}( | |
// wrapper to run code everywhere | |
typeof define === 'function' && define.amd? |
// A response to jashkenas's fine proposal for minimalist JavaScript classes. | |
// Harmony always stipulated classes as sugar, so indeed we are keeping current | |
// JavaScript prototype semantics, and classes would only add a syntactic form | |
// that can desugar to ES5. This is mostly the same assumption that Jeremy | |
// chose, but I've stipulated ES5 and used a few accepted ES.next extensions. | |
// Where I part company is on reusing the object literal. It is not the syntax | |
// most classy programmers expect, coming from other languages. It has annoying | |
// and alien overhead, namely colons and commas. For JS community members who |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
$ = function (document) { | |
var element = Element.prototype, | |
nodeList = NodeList.prototype, | |
foreach = [].forEach; | |
element.on = function () { | |
element.addEventListener.apply(this, arguments); | |
return this; | |
}; | |
# Logs | |
logs | |
*.log | |
# Runtime data | |
pids | |
*.pid | |
*.seed | |
# Directory for instrumented libs generated by jscoverage/JSCover |
function getLine(offset) { | |
var stack = new Error().stack.split('\n'), | |
line = stack[(offset || 1) + 1].split(':'); | |
return parseInt(line[line.length - 2], 10); | |
} | |
global.__defineGetter__('__LINE__', function () { | |
return getLine(2); | |
}); |
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
// by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
// Quartz Debug says. Who knows, maybe it's lying? | |
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
Based on installing Ubuntu 10.04 (lucid) and cloning the live environment (calling local environment dev.jsbin.com)
Add core packages:
sudo apt-get update
sudo apt-get install libpcre3-dev build-essential libssl-dev git-core varnish sendmail
sudo su -
sendmailconfig
cd /opt/