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 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); |
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 _ = require('underscore'), | |
rabbit = require('rabbit-pool'), | |
logging = require('logging')(module); | |
var exchange, | |
handlers = {}, | |
messages = []; |
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
{ | |
"alignment_chars": | |
[ | |
"=", | |
":" | |
], | |
"alignment_prefix_chars": | |
[ | |
"+", | |
"-", |
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
{ | |
"sublimelinter": "load-save", | |
"jshint_options": | |
{ | |
"browser": true, | |
"eqeqeq": true, | |
"evil": true, | |
"expr": true, |
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
error_handler = Proc.new { |status, msg| print status, msg } | |
Analytics.init(secret: "mysecret", on_error: error_handler) |
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 () { | |
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'); |
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
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); | |
} | |
}); |
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 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 |
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 columnName = ['prefix', 'suffix'] | |
, value = 'val' | |
, timestamp = new Date() | |
, column = new helenus.Column(columName, value, timestamp); | |
cf.insert(rowKey, column, options, 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
var fs = require('fs') | |
, stream = require('stream'); | |
function Through () { | |
this.processed = 0; | |
} | |
Through.prototype = new stream.Transform(); | |
function End () {} |
OlderNewer