Skip to content

Instantly share code, notes, and snippets.

View hayes's full-sized avatar

Michael Hayes hayes

View GitHub Profile
@hayes
hayes / application.js
Last active December 10, 2015 20:38
basic controller inheritance
var Controller = require('base_controller');
var Application = module.exports = Controller.extend(function Application(init) {
init.before(function protectFromForgeryHook(ctl) {
ctl.protectFromForgery('13cf581adb4cd3c1cccce3604a6c044215f21679');
});
});
@hayes
hayes / compound-socket.js
Last active December 10, 2015 18:18
a quick way to get access to compound routing/controllers through socket.io
var sio = require('socket.io');
var fn = function () {};
var http = require('http');
module.exports = function (compound) {
var app = compound.app;
var server = http.createServer(app);
compound.server = server;
var io = compound.io = sio.listen(server);