Skip to content

Instantly share code, notes, and snippets.

View mstum's full-sized avatar

Michael Stum mstum

View GitHub Profile
@tlhunter
tlhunter / health.js
Created October 24, 2012 18:32
/HEALTH
app.get('/health', function(req, res){
res.send({
pid: process.pid,
memory: process.memoryUsage(),
uptime: process.uptime(),
connections: server.connections
});
});
@tcr
tcr / async.coffee
Created July 18, 2011 21:13
Serial/Parallel functions in CoffeeScript
# Asynchronous DSL for CoffeeScript
serial = (f) ->
next = -> arr.shift().apply(null, arguments) if arr.length
arr = (v for k, v of f(next))
next()
null
parallel = (f, after = ->) ->
res = {}; arrc = 0