Skip to content

Instantly share code, notes, and snippets.

@bthesorceror
bthesorceror / example.js
Created January 12, 2018 05:33
Promises
function loadFile(filename) {
let script = ... create script with file
let promise = new Promise()
script.onload = function () {
promise.resolve()
}
return promise
generics.Vehicle = (function () {
class Entity {}
class Vehicle {
constructor() {
super();
this.entity = Entity
}
}
@bthesorceror
bthesorceror / index.js
Created September 9, 2013 14:02 — forked from DamonOehlman/index.js
requirebin sketch
// require the media capture helper from rtc.io
var media = require('rtc-media');
// capture video and render it to the document body
media().render(document.body);
@bthesorceror
bthesorceror / gist:6140967
Created August 2, 2013 15:47
Test Failure
AssertionError: agent1 rejected, but should NOT have been
at ChildProcess.<anonymous> (/Users/brandon/hashrocket/node/test/simple/test-tls-server-verify.js:217:14)
at ChildProcess.EventEmitter.emit (events.js:103:17)
at Process.ChildProcess._handle.onexit (child_process.js:794:12)
Command: out/Release/node /Users/brandon/hashrocket/node/test/simple/test-tls-server-verify.js