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 doHash(str, seed) { | |
var m = 0x5bd1e995; | |
var r = 24; | |
var h = seed ^ str.length; | |
var length = str.length; | |
var currentIndex = 0; | |
while (length >= 4) { | |
var k = UInt32(str, currentIndex); | |
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
require "rubygems" | |
require "rbench" | |
def omg_slow | |
return 1 | |
end | |
def omg_fast | |
1 | |
end |
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
require 'rubygems' | |
require 'tokyo_tyrant' | |
TYRANT = TokyoTyrant::Table.new | |
AMOUNT_RECORDS = 8000 | |
$TYRANT_ID = 0 | |
RECORD = { | |
"component_version" => "X", | |
"state" => "Analyze", |
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
#!/usr/bin/env ruby | |
# use this to install the same gems you have installed under one ruby in another | |
# run "gem list > ~/Desktop/gems.txt" | |
# run "ruby install_gems.rb /Users/r38y/Desktop/gems.txt" | |
gems = IO.readlines(ARGV.first) | |
gems.map! do |g| | |
stuff = g.split(' ') | |
gem_name = stuff.delete_at(0) | |
stuff.map{|v| v.gsub(/[\(\)\,]/, '')}.map{|v| "sudo gem install #{gem_name} -v=#{v}"} |