Skip to content

Instantly share code, notes, and snippets.

View smithamax's full-sized avatar

Dominic Smith smithamax

View GitHub Profile
@smithamax
smithamax / 0_reuse_code.js
Created October 21, 2015 01:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@smithamax
smithamax / mediator.js
Created December 23, 2011 00:19 — forked from ryanflorence/mediator.js
Localized Pub Sub
var mediator = function (obj) {
var channels = {};
if (!obj) obj = {};
obj.sub = function (channel, subscription) {
if (!channels[channel]) channels[channel] = [];
channels[channel].push(subscription);
};