Permalink
Browse files

cut some sections

  • Loading branch information...
1 parent 38e60e9 commit 82f72510646a6b94bbba9078be7e93f75281f746 @substack committed Sep 28, 2012
@@ -11,6 +11,9 @@ function createStream () {
var ms = model.createStream();
var es = emitStream(emitter);
+ mdm.on('connection', function (c) {
+ c.pipe({ state : ms, events : es }[c.meta]).pipe(c);
+ });
process.nextTick(function () {
ms.pipe(mdm.createStream('state')).pipe(ms);
@@ -11,10 +11,14 @@ function createStream () {
var ms = model.createStream();
var es = emitStream(emitter);
+ mdm.on('connection', function (c) {
+ c.pipe({ state : ms, events : es }[c.meta]).pipe(c);
+ });
process.nextTick(function () {
ms.pipe(mdm.createStream('state')).pipe(ms);
es.pipe(mdm.createStream('events')).pipe(es);
+
model.set('connections', (model.get('connections') || 0) + 1);
});
@@ -11,10 +11,14 @@ function createStream () {
var ms = model.createStream();
var es = emitStream(emitter);
+ mdm.on('connection', function (c) {
+ c.pipe({ state : ms, events : es }[c.meta]).pipe(c);
+ });
process.nextTick(function () {
ms.pipe(mdm.createStream('state')).pipe(ms);
es.pipe(mdm.createStream('events')).pipe(es);
+
model.set('connections', (model.get('connections') || 0) + 1);
});
@@ -11,6 +11,9 @@ function createStream () {
var ms = model.createStream();
var es = emitStream(emitter);
+ mdm.on('connection', function (c) {
+ c.pipe({ state : ms, events : es }[c.meta]).pipe(c);
+ });
process.nextTick(function () {
ms.pipe(mdm.createStream('state')).pipe(ms);
@@ -15,6 +15,9 @@ function createStream () {
var ms = model.createStream();
var es = emitStream(emitter);
+ mdm.on('connection', function (c) {
+ c.pipe({ state : ms, events : es }[c.meta]).pipe(c);
+ });
process.nextTick(function () {
ms.pipe(mdm.createStream('state')).pipe(ms);
@@ -11,7 +11,6 @@ function createStream () {
var ms = model.createStream();
var es = emitStream(emitter);
-
mdm.on('connection', function (c) {
c.pipe({ state : ms, events : es }[c.meta]).pipe(c);
});
@@ -30,7 +30,7 @@ md.on('connection', function (c) {
});
em.on('part', function (addr) {
document.querySelector('#log').textContent
- += 'join ' + JSON.stringify(addr) + '\n';
+ += 'part ' + JSON.stringify(addr) + '\n';
});
}
});
@@ -30,7 +30,7 @@ md.on('connection', function (c) {
});
em.on('part', function (addr) {
document.querySelector('#log').textContent
- += 'join ' + JSON.stringify(addr) + '\n';
+ += 'part ' + JSON.stringify(addr) + '\n';
});
}
});
@@ -12,6 +12,7 @@ function Box () {
var pressed = false;
div.addEventListener('mousedown', function (ev) {
+ ev.stopPropagation();
pressed = {
x : ev.clientX - (self.x || 100),
y : ev.clientY - (self.y || 100)
@@ -20,6 +21,7 @@ function Box () {
var to;
div.addEventListener('mousemove', function (ev) {
+ ev.stopPropagation();
if (!pressed) return;
var pos = {
@@ -34,6 +36,7 @@ function Box () {
});
div.addEventListener('mouseup', function (ev) {
+ ev.stopPropagation();
pressed = false;
});
}
View
@@ -3,10 +3,6 @@ writable
through
pause
JSONStream
-duplexer
scuttlebutt
-emit-stream
-dnode
-mux-demux
shoe
freestyle
View
@@ -6,7 +6,7 @@ basedir=$(node <<EOF
EOF
)
-slide_number=0
+slide_number=-1
i=0
for slide in $(cat order.txt); do
slides[$i]=$slide
View
@@ -0,0 +1,8 @@
+var fs = require('fs');
+var src = fs.readFileSync('timing.txt', 'utf8');
+var time = src.split('\n').reduce(function (sum, line) {
+ var x = line.match(/(\d+)m(\d+)s/);
+ if (!x) return sum;
+ return sum + Number(x[1]) * 60 + Number(x[2]);
+}, 0) / 60;
+console.log(time);
View
@@ -0,0 +1,8 @@
+01:00 readable (0m45s)
+02:00 writable (0m48s)
+03:00 through (1m10s)
+04:00 pause (1m36s)
+05:30 JSONStream (1m27s)
+07:00 scuttlebutt (1m58s)
+09:00 shoe (1m05s)
+12:00 freestyle (8m10s)
View
@@ -0,0 +1,9 @@
+var t0=Date.now();
+setInterval(function () {
+ var x = (Date.now() - t0) / 1000 / 60;
+ var m = Math.floor(x);
+ var s = Math.floor((x - m) * 60);
+ var mm = (m < 10 ? '0' : '') + m;
+ var ss = (s < 10 ? '0' : '') + s;
+ process.stdout.write(mm + ':' + ss + '\r');
+}, 1000);

0 comments on commit 82f7251

Please sign in to comment.