Skip to content

Instantly share code, notes, and snippets.

@walling
walling / assetgraph-require-sys-grep.txt
Created November 22, 2011 14:55
AssetGraph 0.3.18 - require sys module
$ egrep -Hrn 'require\(.sys' *
node_modules/less/bin/lessc:5: sys = require('sys');
node_modules/less/benchmark/less-benchmark.js:3: sys = require('sys');
node_modules/jsdom/lib/jsdom/level2/events.js:8: sys = require("sys");
node_modules/jsdom/lib/jsdom/browser/index.js:1:var sys = require('sys'),
node_modules/jsdom/lib/jsdom/browser/htmltodom.js:102: var sys = require('sys');
node_modules/jsdom/node_modules/htmlparser/utils_example.js:3:var sys = require("sys");
node_modules/jsdom/node_modules/htmlparser/profile.js:3:var sys = require("sys");
node_modules/jsdom/node_modules/htmlparser/testdata/api.html:319:<pre><code>var sys = require('sys'),
@walling
walling / serial.coffee
Created July 27, 2011 10:55
Serial/Parallel
module.exports = serial = (spec) ->
steps = (func for key, func of spec when key != 'catch')
raise = (err) -> if spec.catch then spec.catch err else throw err
next = (err, args...) ->
return raise(err) if err
steps.shift().apply(next, args) if steps.length > 0
next._count = 0
next._result = []
next.parallel = ->
next._count++
@walling
walling / async.coffee
Created July 19, 2011 00:23 — forked from tcr/async.coffee
Lean and Mean Serial function in CoffeeScript
# Lean and Mean Serial DSL for CoffeeScript
# (based of https://gist.github.com/1090670 by timcameronryan)
serial = (spec) ->
commands = (func for key, func of spec when key != 'catch')
next = (err, args...) ->
return spec.catch(err) if err
commands.shift().apply(next, args) if commands.length > 0
next null
return