Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
package main | |
import ( | |
"image" | |
"image/jpeg" | |
"log" | |
"os" | |
) | |
func main() { |
# Hook into unicorn, unicorn middleware, not rack middleware | |
# | |
# Since we need no knowledge about the request we can simply | |
# hook unicorn | |
module Middleware::UnicornOobgc | |
MIN_REQUESTS_PER_OOBGC = 5 | |
MAX_DELTAS = 20 |
package main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
export t=$(date +%s) | |
lockfile $t #create lock. Try running `lockfile $t` in another shell. | |
rm -f $t #delete lock |
namespace :redis_failover do | |
task :monitor_client do | |
require 'redis_failover' | |
zookeepers = ENV['ZOOKEEPERS'] | |
if !zookeepers && zookeepers_file = ENV['ZOOKEEPERS_FILE'] | |
if File.exists?(zookeepers_file) | |
zookeepers = File.read(zookeepers_file).chomp | |
end |
This playbook has been removed as it is now very outdated. |
class HammingCode | |
attr_reader :data_bits | |
def initialize(number) | |
@number = number | |
@data_bits = number.to_s(2) | |
end | |
def parity_bits | |
indexes = [] | |
current_index = 3 |
/* | |
* Cubism source for Papertrail | |
* https://papertrailapp.com/ | |
*/ | |
cubism.context.prototype.papertrail = function(token) { | |
var source = {}; | |
source.metric = function(expression, title) { | |
var lookup = {}; |