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 r = require('rethinkdbdash')(); | |
setInterval(function() { | |
r.table("logs").insert({ | |
date: r.now() | |
}).run({noreply: true}) | |
, 1000) | |
r.table("logs").changes().run().then(function(feed) { |
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
function retry(isDone, next) { | |
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
var id = window.setInterval( | |
function() { | |
if (isDone()) { | |
window.clearInterval(id); | |
next(is_timeout); | |
} | |
if (current_trial++ > max_retry) { | |
window.clearInterval(id); |
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 cluster = require('cluster'); | |
if(cluster.isMaster) { | |
cluster.fork() | |
.on('online', function() { | |
this.disconnect(); | |
}); | |
} else { | |
process.on('internalMessage', function(msg) { | |
console.log('internalMsg', msg); |
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
// vue internals | |
var _ = require('../util') | |
var Path = require('../parsers/path') | |
// original implementation using native sort | |
var original = function (arr, sortKey, reverse) { | |
if (!sortKey) { | |
return arr | |
} | |
var order = 1 |
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
// Identify User | |
ax.user({ | |
id: "USER ID", //If the id is an email AIDAX will contextalize the id | |
properties: { | |
property1: "value", | |
property2: "value" | |
}, | |
migrate: true //optional parameter to migrate old user data in this session to the new user. Default is true | |
}); |
OlderNewer