This file contains hidden or 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
redis 127.0.0.1:6379> blpop a, 1 | |
(nil) | |
(1.49s) | |
redis 127.0.0.1:6379> blpop a, 1 | |
(nil) | |
(1.02s) | |
redis 127.0.0.1:6379> blpop a, 1 | |
(nil) | |
(1.51s) | |
redis 127.0.0.1:6379> blpop a, 1 |
This file contains hidden or 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
> rake bench | |
Testing with Rails 3.2.1 | |
Using standard socket IO (jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]) | |
Run options: --seed 22292 | |
# Running tests: | |
Testing 2.0.0 with jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java] | |
Found memcached 1.4.13 in PATH | |
user system total real |
This file contains hidden or 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
src/dalli> JRUBY_OPTS=--1.9 ruby test/benchmark_test.rb | |
Testing with Rails 3.2.1 | |
/Users/mperham/.rvm/gems/jruby-1.6.7@dalli/gems/minitest-2.11.4/lib/minitest/unit.rb:647 warning: already initialized constant VERSION | |
/Users/mperham/.rvm/gems/jruby-1.6.7@dalli/gems/minitest-2.11.4/lib/minitest/unit.rb:1021 warning: already initialized constant PASSTHROUGH_EXCEPTIONS | |
/Users/mperham/.rvm/gems/jruby-1.6.7@dalli/gems/minitest-2.11.4/lib/minitest/unit.rb:1024 warning: already initialized constant SUPPORTS_INFO_SIGNAL | |
Using standard socket IO (jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]) | |
Run options: --seed 40696 | |
# Running tests: |
This file contains hidden or 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
ArgumentError: invalid %-encoding (Men's Advance Lightweight Zip Tee | |
Channeled construction increases performance, decreases weight. 100% polyester wicks, breathes and dries quickly. Chitosan anti-microbial finish controls odor. | |
**break** | |
Wicking, fast drying, antimicrobial fabric is lightweight and comfortable | |
Flat-lock seams are rotated away from abrasion areas for comfort | |
2" stand-up collar and 8" front zip for thermoregulation |
This file contains hidden or 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
desc "convert a latin1 database with utf8 data into proper utf8" | |
task :convert_to_utf8 => :environment do | |
puts Time.now | |
dryrun = ENV['DOIT'] != '1' | |
conn = ActiveRecord::Base.connection | |
if dryrun | |
def conn.run_sql(sql) | |
puts(sql) | |
end | |
else |
This file contains hidden or 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
trap 'INT' do | |
puts 'Got Ctrl-C' | |
puts Thread.current | |
puts Thread.main | |
puts Thread.main.status | |
# BUG BUG BUG | |
# This does not result in the main thread waking up from | |
# the Thread.stop call below. | |
Thread.main.run | |
puts Thread.main.status |
This file contains hidden or 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
/Users/mperham/.rvm/gems/ruby-1.9.3-p125@sidekiq/gems/sinatra-1.3.2/lib/sinatra/base.rb:1305: warning: assigned but unused variable - e | |
/Users/mperham/.rvm/gems/ruby-1.9.3-p125@sidekiq/gems/sinatra-1.3.2/lib/sinatra/base.rb:1241:in `encoded': warning: URI.escape is obsolete | |
/Users/mperham/.rvm/gems/ruby-1.9.3-p125@sidekiq/gems/sinatra-1.3.2/lib/sinatra/base.rb:1242:in `encoded': warning: URI.escape is obsolete | |
/Users/mperham/.rvm/gems/ruby-1.9.3-p125@sidekiq/gems/sinatra-1.3.2/lib/sinatra/base.rb:1241:in `encoded': warning: URI.escape is obsolete | |
/Users/mperham/.rvm/gems/ruby-1.9.3-p125@sidekiq/gems/sinatra-1.3.2/lib/sinatra/base.rb:1242:in `encoded': warning: URI.escape is obsolete | |
(eval):1: warning: method redefined; discarding old app_file | |
/Users/mperham/.rvm/gems/ruby-1.9.3-p125@sidekiq/gems/sinatra-1.3.2/lib/sinatra/base.rb:987: warning: previous definition of app_file was here | |
/Users/mperham/.rvm/gems/ruby-1.9.3-p125@sidekiq/gems/sinatra-1.3.2/lib/sinatra/base.rb:1004: warning: method redefined; discard |
This file contains hidden or 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
# Put this at the bottom of your config/deploy.rb | |
# Requires config file ~/.campfire.yml with your API token from | |
# your Campfire "My Info" page: | |
# | |
# token: lkjsadfsaduoi1u31oui3eh1kj2h | |
# roomid: 123456 | |
# subdomain: acmeco | |
class Room | |
attr_accessor :config |
This file contains hidden or 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 ( | |
"os" | |
"fmt" | |
"strings" | |
"flag" | |
"http" | |
"html" | |
) |
This file contains hidden or 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
class TaxCode | |
GENERATORS = { | |
:us => lambda { |id| "US-#{id}" }, | |
:br => lambda { |id| "#{id + 9}-BRA" }, | |
} | |
def self.generate(code, id) | |
gen = GENERATORS[code] || raise ArgumentError, "No generator for country #{code}" | |
gen.call(id) | |
end |