This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rtcDataStream = require('rtc-data-stream') | |
var quickconnect = require('rtc-quickconnect') | |
var generateName = require('sillyname'); | |
// setup DOM | |
var output = document.createElement('textarea') | |
output.style.width = "100%" | |
output.style.height = "80%" | |
output.style.resize = "none" | |
document.body.appendChild(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) | |
} | |
function h() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rx = require('rx-dom') | |
main() | |
// Search Wikipedia for a given term | |
function searchWikipedia(term) { | |
var cleanTerm = window.encodeURIComponent(term) | |
var url = 'http://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=' + cleanTerm + '&callback=JSONPCallback' | |
return Rx.DOM.jsonpRequest(url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var esprima = require('esprima') | |
var escodegen = require('escodegen') | |
var treeify = require('treeify').asTree | |
var match = require('pattern-match') | |
var isArray = require('is-array') | |
// setup registry | |
var registry = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var quickconnect = require('rtc-quickconnect'); | |
var createDataStream = require('rtc-dcstream'); | |
quickconnect('http://rtc.io/switchboard', { room: 'dnode-test' }) | |
.createDataChannel('primary') | |
.on('channel:opened:primary', function(id, dc) { | |
var stream = createDataStream(dc) | |
connectionReady(stream) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var quickconnect = require('rtc-quickconnect'); | |
var createDataStream = require('rtc-dcstream'); | |
var dnode = require('dnode'); | |
quickconnect('https://switchboard.rtc.io/', { room: 'dnode-test' }) | |
.createDataChannel('primary') | |
.on('channel:opened:primary', function(id, dc) { | |
var stream = createDataStream(dc) | |
connectionReady(stream) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ethereum Browser - MIST Analogue | |
============== WHAT ============ | |
### Goals: | |
(1) Identity Management | |
(2) Wallet App | |
(3) Contract Browser | |
(4) Dapp runtime environment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var koa = require('koa'); | |
var app = koa(); | |
// logger | |
app.use(function *(next){ | |
var start = new Date; | |
yield next; | |
var ms = new Date - start; | |
console.log('%s %s - %s', this.method, this.url, ms); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* addGenerator() { | |
var i = 0; | |
while (true) { | |
i += yield i; | |
} | |
} | |
var adder = addGenerator(); | |
adder.next().value; // 0 | |
adder.next(5).value; // 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std=["top", "window", "location", "external", "chrome", "document", "define", "global", "cr", "ntp", "templateData", "Handler", "i18nTemplate"];Object.keys(window).filter(function(item){return std.indexOf(item)===-1}) |