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 ConditionView = Backbone.View.extend({ | |
template: '#ponder-view-condition', | |
initialize: function() { | |
_.bindAll(this, 'appendStatement'); | |
this.model.get('children').on('add', this.appendStatement); | |
}, | |
render: function(layout) { |
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 fs = require('fs') | |
, config = JSON.parse(fs.readFileSync('./config.json')); | |
setInterval(function() { | |
console.log('config.foo = %s', config.foo); | |
}, 500); | |
process.on('SIGHUP', function() { | |
fs.readFile('./config.json', function(err, contents) { | |
if (err) return console.error(err); |
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 assert = require('assert'); | |
function pack(data, meta) { | |
var frames; | |
// an array of msgs means we want multipart | |
// frame each msg, then create an outer frame for the entire msg. | |
if (Array.isArray(data)) { |
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 ss = require('..') | |
, encoder = new ss.Encoder | |
, decoder = new ss.Decoder | |
, should = require('should') | |
, msgs; | |
// capture messages | |
decoder.onmessage = function(body, multi) { |
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 killChildren(callback){ | |
var keys = Object.keys(processes) | |
, count = keys.length; | |
keys.forEach(function(pid){ | |
var proc = processes[pid]; | |
delete processes[pid]; | |
proc.on('exit', function(){ | |
if (--count === 0) callback(); |
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
// require events module, we only need the emitter so we grab it off pronto. | |
var EE = require('events').EventEmitter; | |
// define our constructor and call the "EE" constructor function, this gets scoping all happy for you (think call "super" in PHP). | |
function Foo(){ | |
EE.call(this); | |
this.timer = null; | |
} |
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
/** | |
* Deps. | |
*/ | |
var express = require('express') | |
, es = require('event-stream') | |
, fs = require('fs') | |
, path = require('path'); |
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 Parser = require('../lib/parser'); | |
var parser = new Parser(); | |
parser.onreply = console.log; | |
parser.write('ERR'); | |
parser.write('O'); | |
parser.write('R\r\n'); | |
parser.write('CLIENT_'); |
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
{ | |
"redis host": "localhost", | |
"redis port": 6379, | |
"fluent buffer": "/tmp/buffer" | |
} |
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
/** | |
* Deps. | |
*/ | |
var redis = require('redis') | |
, fs = require('fs') | |
, csv = require('csv') | |
, rc = redis.createClient(); |