Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew
express.use(connect.static({maxAge: 12345})); |
export default function() { | |
return 'hai'; | |
} |
def multiply(x, y) | |
x * y | |
end | |
p [1,2,3].map(&method(:multiply, 2)) | |
# ArgumentError :( |
describe('A test', function() { | |
set('data', function() { | |
return { some: 'stuff' }; | |
}); | |
set('subject', function() { | |
return new FooThing(data); | |
}); | |
it('does stuff', function() { |
var d = document.createElement('div'); | |
d.innerHTML = 'a load of html that you got back from the server'; | |
var contents = d.querySelector('div.whatever').innerHTML; |
Right now, this assumes you are using Snow Leopard.
Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew
var http = require('http'), | |
fs = require('fs'); | |
http.createServer(function(req, res){ | |
var path = (req.url === '/' ? './index.html' : '.' + req.url); | |
fs.readFile(path, 'utf-8', function(err, data){ | |
if(!err){ | |
console.log('Serving: ', req.url); | |
res.writeHead(200); | |
res.end(data); |
var canvas = document.getElementsByTagName('canvas'), | |
img = new Image(); | |
img.onload = function(){ | |
Array.prototype.slice.call(canvas).forEach(function(el){ | |
el.getContext('2d').drawImage(img, 0, 0); | |
}); | |
}; | |
img.src = 'http://thegurglingcod.typepad.com/.a/6a00d8341c387d53ef0148c84decb8970c-320wi'; |
Handlebars.registerHelper 'if_equal', (val1, val2, fn) -> | |
if val1 == val2 | |
return fn() | |
else if fn.inverse | |
return fn.inverse() |