Skip to content

Instantly share code, notes, and snippets.

@anantn
anantn / firebase_workers.js
Created December 27, 2012 22:11
Firebase: Implementing a worker queue pattern using firebase_queue_pop.js
var Firebase = require("./firebase-node.js");
function Queue(ref) {
this._ref = ref;
}
Queue.prototype.pop = function(cb) {
this._ref.startAt().limit(1).once("child_added", this._pop.bind(this, cb));
}
@anantn
anantn / tamejs_gum.js
Created October 18, 2012 01:14
TameJS wrapper for getUserMedia
function myGetUserMedia(constraints, cb)
{
function errCb(code)
{
cb(code, null);
}
function successCb(stream)
{