Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tobiash on github.
  • I am thabermann (https://keybase.io/thabermann) on keybase.
  • I have a public key whose fingerprint is 3000 F08B C2DD D522 FA4F A5DA 1C30 B8BB FBD9 C07D

To claim this, I am signing this object:

@tobiash
tobiash / controller.coffee
Created June 7, 2012 13:02
Generic Pre/Post filters
_ = require("underscore")._
Q = require("q")
logger = require('./logger').logger(@)
util = require 'util'
prepost = require './prepost'
beget = require './util/beget'
# Use ExpressJS route implementation
Route = require("express/lib/router/route")
@tobiash
tobiash / qredis.coffee
Created June 6, 2012 20:30
Q + node_redis
# Applies Q.nbind to all redis operations and returns a wrapped client
_ = require("underscore")._
Q = require "q"
nbindOps = (client) ->
functions = _.functions client
# All the ops are available as upper/lowercase functions, I exploit this
# to filter out the Redis operations from the other functions of the client
#
@tobiash
tobiash / categorypages.plugin.coffee
Created May 17, 2012 16:44
Dynamically generate pages for Docpad (from categories)
path = require 'path'
fs = require 'fs'
balUtil = require 'bal-util'
Backbone = require 'backbone'
module.exports = (BasePlugin) ->
class Category extends Backbone.Model
constructor: ->