Skip to content

Instantly share code, notes, and snippets.

# EM.run {
# iw = ImapWatcher.new(user, pass);
#
# iw.watch! {
# p "sup, yall got new mail"
# }
# }
#
require 'rubygems'
require 'eventmachine'
var Gossiper = require('gossiper').Gossiper;
var seed = new Gossiper(9000, []);
seed.start();
var n = 0;
var gs = [];
var start_time = undefined;
var count = 100;
for(var i = 9001; i < 9001+count;i++) {
var msgpack = require('msgpack');
var fs = require('fs');
var crypto = require('crypto');
var hash = function(data) {
var h = crypto.createHash('md5');
h.update(data);
return h.digest('hex');
}
var data = fs.readFileSync(process.argv[2]);
diff --git a/src/msgpack.cc b/src/msgpack.cc
index 5374c3b..6bf6c36 100644
--- a/src/msgpack.cc
+++ b/src/msgpack.cc
@@ -233,8 +233,11 @@ msgpack_to_v8(msgpack_object *mo) {
return a;
}
- case MSGPACK_OBJECT_RAW:
- return String::New(mo->via.raw.ptr, mo->via.raw.size);
class SkinnyJeanDb < ActiveRecord::Base
self.abstract_class = true
end
SkinnyJeanDb.establish_connection(:adapter => 'sqlite3', :database => @sqlite_db_path)
class Pageview < SkinnyJeanDb; end
Pageview.count
begin
# try to call SSL::SSLSocket#io.
@sock.io.shutdown
rescue NoMethodError
# @sock is not an SSL::SSLSocket.
@sock.shutdown
end
# /etc/conf.d/ttserver: config file for /etc/init.d/ttserver
# TCP port TokyoTyrant server should listen on
TYRANT_PORT="1978"
# Location of the TokyoTyrant server database
# Also put addional options here, eg, #bnum
# See 'ttserver' man page
TYRANT_DB="/var/lib/tokyotyrant/tokyotyrant.tcb"
--- source/ext/dl/depend.old 2011-07-25 23:32:16.000000000 +0000
+++ source/ext/dl/depend 2011-07-25 23:32:34.000000000 +0000
@@ -32,15 +32,15 @@
call.func: $(srcdir)/mkcall.rb ./dlconfig.rb
@echo "Generating call.func"
- @$(RUBY) $(srcdir)/mkcall.rb > $@
+ @$(RUBY) $(srcdir)/mkcall.rb | tee $@
callback.func: $(srcdir)/mkcallback.rb ./dlconfig.rb
require 'atomic'
class RateLimit
def initialize(ops_per_second, max_bucket_size = ops_per_second)
@ops_per_second = ops_per_second
@max_bucket_size = max_bucket_size
@sec_per_op = 1.0 / @ops_per_second
@bucket = Atomic.new(0)
@incr_lock = Atomic.new(0)

The next morning Rollins came out wearing only a tiny pair of athletic shorts – tattoos and muscles on full display. Freda and Juliana ogled him shamelessly as he made fun of my canvas sneakers and pressured me to come lift weights in his garage. I politely declined. He asked me to make a pot of coffee and, assuming Rollins drank a strong brew, I heavy-handed it to the tune of approximately double-strength. I handed him a cup and he took a sip and immediately spat it in the sink. “You call this COFFEE??” he bellowed. “Pour that shit out and I’ll show you how to brew a MAN’S pot of coffee!!!” His brew was about three times as strong as mine, and it kept me in a manic state of agitation for the entire visit.