Skip to content

Instantly share code, notes, and snippets.

View notduncansmith's full-sized avatar
🐢

Duncan Smith notduncansmith

🐢
View GitHub Profile
/* NOTE: Comments need to be in multiline format like this, instead of "// Comment" */
window.location = "web+sublime://~/working/"
@notduncansmith
notduncansmith / app.coffee
Last active August 29, 2015 14:15
In-memory graph datastore with friendship and notification support in <100 lines
# Bring in static test data
data = require './data'
# Spin up graph store
Rel = require('./rel')()
# Set up the friendships
Rel.put [
data.events.aliceBefriendsBob
data.events.carolBefriendsBob
@notduncansmith
notduncansmith / app.coffee
Last active August 29, 2015 14:11
Dynamic template globals in Summit
Summit = require 'summit'
app = new Summit()
router = app.router()
router.get '/', (respond, views) ->
respond views.app
router.get '/theme/:theme', (app, req) ->
app.templateGlobals.theme = req.params.theme