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 'sidekiq' | |
module Sidekiq | |
# Encapsulates a single job awaiting retry | |
class Retry | |
attr_reader :score, :item | |
def initialize(score, item) | |
@score = score | |
@item = Sidekiq.load_json(item) |
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
## | |
# Broadcast a message to Campfire | |
# | |
# campfire = Campfire.new(options) | |
# campfire.say("#{self.class.name} finished successfully!") | |
# campfire.say("trombone", :Sound) | |
# | |
def say(msg, type=:Text) | |
http = Net::HTTP.new("#{options[:subdomain]}.campfirenow.com", 443) | |
http.use_ssl = true |
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
# This works for me in 1.9.3-p125 but not in p194. | |
# Can anyone explain why? | |
require 'net/http' | |
http = Net::HTTP.new("theclymb1.campfirenow.com", 443) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
request = Net::HTTP::Get.new("/login") | |
response = http.request(request) | |
raise response.inspect if response.code != '200' |
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
class ActiveRecord::Base | |
mattr_accessor :shared_connection | |
@@shared_connection = nil | |
def self.connection | |
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
end | |
end | |
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
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
YAML.parse(BELOW) fails, I believe due to the shipCompany line below which contains a single backtick. | |
``` | |
--- !ruby/object:Delayed::PerformableMethod | |
args: [] | |
method_name: :push_to_wh | |
object: !ruby/ActiveRecord:Cart | |
attributes: | |
split_to: |
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
DEPRECATION WARNING: Layout found at "admin/customer_service" for Admin::CustomerServiceController but parent controller set layout to "admin/customer_service". Please explicitly set your layout to "admin/customer_service" or set it to nil to force a dynamic lookup. (called from realtime at /Users/mperham/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/benchmark.rb:308) |
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
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 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 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 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 |