This file contains 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
// DOM | |
var nFreqs = 3 | |
var bars = [] | |
for (var i = nFreqs; i>0; i--) { | |
var el = document.createElement('div') | |
el.style.height = '20px' | |
el.style.background = 'steelblue' | |
el.style.margin = '2px' | |
document.body.appendChild(el) | |
bars.push(el) |
This file contains 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 text3dParticles = require('text-3d-particles') | |
var opts = | |
{ width: 400 | |
, height: 400 | |
, text: '★' | |
, foreground: '#707070' | |
, background: '#f6f6f6' | |
, duration: 12000 | |
, density: 15 |
This file contains 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 hq = require('hyperquest') | |
var es = require('event-stream') | |
var tr = es.through(function(data){ | |
console.log('about to error') | |
throw new Error('but it never happens') | |
this.queue(data) | |
}) | |
var rs = hq('http://requirebin.com').pipe(tr) |
This file contains 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 hq = require('hyperquest') | |
var through = require('through2') | |
var tr = through.obj(function(data){ | |
console.log('about to error') | |
throw new Error('but it never happens') | |
this.queue(data) | |
}) | |
var rs = hq('http://requirebin.com').pipe(tr) |
This file contains 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 through = require('through') | |
var stream = through() | |
// stream.on('error', console.error.bind(console)) | |
stream.emit('error', new Error('rawr')) |
This file contains 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 hq = require('hyperquest') | |
var es = require('event-stream') | |
var asap = require('asap') | |
var tr1 = es.through(function(data){ | |
console.log('about to error silently') | |
throw new Error('never shows in console') | |
this.queue(data) | |
}) |
This file contains 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
// index.js | |
'use strict'; | |
var app = require('express')(); | |
var jsonParser = require('body-parser').json({limit: '1mb'}); | |
var db = require('./routes/db.js'); | |
var doc = require('./routes/document.js'); | |
app.put('/:db', jsonParser, db.createDB); |
This file contains 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 value = require('observ') | |
var array = require('observ-array') | |
var struct = require('observ-struct') | |
var ObservSync = require('../') | |
var local = struct({ | |
aValue: value('hi'), | |
anArray: array([value(42)]), | |
_clock: value(1) // necessary to handle conflicts? |
This file contains 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
[ | |
{ | |
"type": "gif", | |
"url": "http://38.media.tumblr.com/c95fa243d37e5db0d9ba12d2e42bac8f/tumblr_nfthdwoptV1s8udf8o1_500.gif", | |
"artist": "sweetums" | |
}, | |
{ | |
"type": "gif", | |
"url": "http://33.media.tumblr.com/2055a1248fa34e87a0b341ed0d45d8f1/tumblr_nfq3onCPsb1s8udf8o1_500.gif", | |
"artist": "sweetums" |
This file contains 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 raf = require('raf') // requestAnimationFrame polyfill | |
var Isomer = require('isomer') // 3ds | |
var ease = require('ease-component') // easing | |
// duration of loop / speed of animation | |
var duration = 2000 | |
// create a canvas element and add it to the page | |
var canvas = document.createElement('canvas') | |
var ctx = canvas.getContext('2d') |