Skip to content

Instantly share code, notes, and snippets.

View devdazed's full-sized avatar

Russ Bradberry devdazed

View GitHub Profile
@devdazed
devdazed / expresso_suite_runner.js
Created January 26, 2011 18:40
wraps expresso to allow for multiple async tests to be run simultaneously
var util = require('util'),
spawn = require('child_process').spawn,
expresso = 'expresso',
async = require('async');
async.parallel({
"My Test" : function(cb){ runTest('./test/my_test.js', "My Test", cb) },
"My Other Test" : function(cb){ runTest('./test/my_other_tests', "My Other Test", cb) },
},function(errors, results){
util.print("Tests:\n");
@devdazed
devdazed / mongo_vs_redis.rb
Created January 14, 2011 02:07
Testing increment, speed in Mongo and Redis
require 'redis'
require 'mongo'
require 'benchmark'
class MongoVsRedis
ITERATIONS = 100_000
MONGO_CRITERIA = {"_id"=>BSON::ObjectId.from_string("4d2fa98a858d68644662156d")}
REDIS_CRITERIA = "benchmark_test"
def initialize
@devdazed
devdazed / redis_key.rb
Created January 13, 2011 17:41
manage surrogate keys usign Redis
require 'redis'
require 'digest/sha1'
class RedisKey
def initialize
@redis = Redis.new
end
def surrogate_key(dimension, data)
nk = Digest::SHA1.hexdigest(data)