This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pulled out of a project authored by tpope && rbxbx | |
# not generic enough for general use, but a decent example of | |
# an application specific restful crud abstraction | |
module Incrudable | |
extend ActiveSupport::Concern | |
included do | |
expose(controller_name) { controller_name.classify.constantize.scoped } | |
expose(controller_name.singularize) |