Skip to content

Instantly share code, notes, and snippets.

View goloroden's full-sized avatar
💭
The best way to predict the future is to invent it.

Golo Roden goloroden

💭
The best way to predict the future is to invent it.
View GitHub Profile
@goloroden
goloroden / gist:1485958
Created December 16, 2011 12:59
Combining Funcs
Func<User, bool> whereStatus = u => u.Status == status;
Func<User, bool> whereQuery =
u => u.Lastname.Contains(q) || u.Firstname.Contains(q) || u.UserId.Contains(q);
Func<User, bool> where = ...?
// What's requires: where = whereStatus && whereQuery
@goloroden
goloroden / app.coffee
Created July 10, 2011 18:17
EBCs in CoffeeScript
# Resolve dependencies.
EventEmitter = (require 'events').EventEmitter;
# Define EBCs.
class HelloWorldGenerator extends EventEmitter
generate: ->
this.emit 'generated', 'Hello World!'
class UpperCaseTransformer extends EventEmitter
transform: (text) ->