I hereby claim:
- I am calvinfo on github.
- I am calvinfo (https://keybase.io/calvinfo) on keybase.
- I have a public key whose fingerprint is A454 9029 F458 3705 25AC 9309 592B 56C5 AC5D 12A0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/** | |
* Set up our uncaught exception handler | |
**/ | |
process.on('uncaughtException', function(err){ | |
log.critical('uncaught', err); | |
setTimeout(function(){ | |
// cleanup... | |
}, 1000); | |
}); |
var helenus = require('helenus'); | |
pool = new helenus.ConnectionPool({ | |
hosts : ['localhost:9160'], | |
keyspace : 'segmentio', | |
timeout : 3000 | |
}); | |
pool.on('error', function(err){ | |
console.error(err.name, err.message); |
var _ = require('underscore'), | |
rabbit = require('rabbit-pool'), | |
logging = require('logging')(module); | |
var exchange, | |
handlers = {}, | |
messages = []; |
{ | |
"alignment_chars": | |
[ | |
"=", | |
":" | |
], | |
"alignment_prefix_chars": | |
[ | |
"+", | |
"-", |
{ | |
"sublimelinter": "load-save", | |
"jshint_options": | |
{ | |
"browser": true, | |
"eqeqeq": true, | |
"evil": true, | |
"expr": true, |
error_handler = Proc.new { |status, msg| print status, msg } | |
Analytics.init(secret: "mysecret", on_error: error_handler) |
(function () { | |
var traits = analytics.user.traits() | |
, session = traits.session | |
, now = +(new Date); // shim for Date.now in older browsers | |
if (!session || (now - session) > 60*60*1000) { | |
// Track things which happen once a session | |
analytics.track('Once a session'); |
analytics.ready(function() { | |
if ($("#mixpanel_distinct_id").length > 0) { | |
var interval = setInterval(function () { | |
if (window.mixpanel.get_distinct_id) { | |
$("#mixpanel_distinct_id").val(window.mixpanel.get_distinct_id()); | |
clearInterval(interval); | |
} | |
}, 300); | |
} | |
}); |
function subscribe(queue) { | |
logger.info('API logger queue created.'); | |
queue.bind('ingestion', '#'); | |
var options = { ack : true, prefetchCount : 1000 }; | |
queue.subscribe(options, function (payload, headers, deliveryInfo, message) { | |
importer.log(payload, function (err) { | |
try { | |
if (err) message.reject(true); // requeue the message |