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
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"errors" | |
"fmt" | |
"io" | |
"os" | |
"strings" |
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
describe "WeakRef hash support" do | |
before do | |
@k = "key" | |
@w = WeakRef.new(@k) | |
@h = {@w => :value} | |
end | |
it "can be accessed with the original object" do | |
@h[@k].should == :value |
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
# Database setup and seeds loading | |
# See the block post : http://sigkill.tumblr.com/post/58933579738/test-database-setup-and-seeds-with-rails-rspec | |
module Seeder | |
@@__cache__ = {} | |
def self.load_seed(filename, prefix='app') | |
filename = Rails.root + "db/seeds/#{prefix}/#{filename}.seeds.rb" | |
seed_mod = @@__cache__[filename] ||= begin | |
mod = Module.new |
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 bash | |
set -e | |
cd ~/.rbenv/src | |
curl -LO 'ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p448.tar.gz' | |
tar xvzf ruby-1.9.3-p448.tar.gz && cd ruby-1.9.3-p448/ | |
./configure --prefix="$HOME/.rbenv/versions/1.9.3-p448" --enable-shared --with-opt-dir=/opt/local | |
make | |
make install |
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
sudo port install tk tcl readline apple-gcc42 openssl | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
cd ~/.rbenv && mkdir src && cd src | |
curl -LO 'ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz' | |
tar xvzf ruby-2.0.0-p247.tar.gz |
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
# Copyright 2011 10gen | |
# | |
# Modified by Antonin Amand <antonin.amand@gmail.com> to work with gevent. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
# encoding: utf-8 | |
""" | |
A python logging Handler that use ZeroMQ (ØMQ). | |
+------+ +------+ +-------+ | |
| app1 | | app2 | | app X | | |
+------+ +------+ +-------+ | |
| PUSH | PUSH | PUSH | |
| | | |
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
commit 7df6d1b37b57476771ee7ae764e3236eb0d22e8f | |
Author: Antonin Amand <antonin.amand@gmail.com> | |
Date: Sat Jan 3 18:42:57 2009 +0100 | |
fixes for 1.9 | |
diff --git a/extconf.rb b/extconf.rb | |
index bc00612..f502d4f 100644 | |
--- a/extconf.rb | |
+++ b/extconf.rb |