- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
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
// load redis client | |
var r = require('redis').createClient(); | |
// set data for key | |
r.set('key', data); | |
// add data to key (list) | |
r.lpush('key', data); | |
// trim list to specific length |
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 crypto = require('crypto'); | |
/** | |
* Calculates the hash/checksum of a string. Default algorithm is MD5. | |
* | |
* @param {String} str | |
* @param {String} algorithm | |
* @return {String} checksum | |
* @api public | |
*/ |
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
// Use built in or binary modules | |
var crypto = require('crypto'); | |
var hash = crypto.createHmac("sha1",key).update(signatureBase).digest("base64"); |
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(A) { | |
var registered_ids = {}, | |
id_to_module_map = {}, | |
interim_actions = {}, | |
cleanup_actions = {}, | |
clicked_ids = {}, | |
queueing = {}; | |
function register_id(id, callbacks, required_module) { | |
id = id.replace('*', '.*'); |
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 p = require('./point'); | |
> var o = new p.Point(); | |
> o.setX(6); | |
> o.setY(9); | |
> console.log(o.get()); | |
{ x: 6, y: 9 } |
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 startFast; | |
var startSlow; | |
var size = 1000000; // million | |
var loopCount = 0; | |
var setTimeoutTest = function () { | |
loopCount++; | |
if ( loopCount == ( size - 1 ) ) { | |
console.log( 'setTimeout result: ' + ( new Date() - startFast ) + 'ms' ); |
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 (ctr,t) { | |
function inc () { ctr++ } | |
function display (ntps,ntpsStr,i,lps,lpsStr,ratioStr) { | |
ntps= ctr*1e3/(Date.now()-t); //nextTicks per second | |
ntpsStr= ", nextTicksPerSecond: "+ ntps.toFixed(1); | |
ctr= 0, i= 100e6, t= Date.now(); | |
while (i--) { inc() } |
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 express = require('express'); | |
var redis = require('redis'); | |
const serverType = process.argv[2]; | |
const serverHost = process.argv[3]; | |
const serverPort = parseInt(process.argv[4]); | |
const redisPort = 6379; | |
const redisHost = '127.0.0.1'; |
OlderNewer