Skip to content

Instantly share code, notes, and snippets.

View randomcamel's full-sized avatar

Chris Doherty randomcamel

View GitHub Profile
@randomcamel
randomcamel / separate_worker.rb
Last active December 11, 2015 14:48
Trying to separate out the process that submits jobs from the process that executes them. Under 1.8.7, the Worker doesn't pick up the job submitted by the 'run' case: the join() command just waits.
require 'rubygems'
require 'ruote' # 2.3.0.2
require 'ruote/storage/fs_storage'
def get_storage
Ruote::FsStorage.new("ruote_issue_work")
end
class MyParticipant < Ruote::Participant
@randomcamel
randomcamel / bunny_test.rb
Created January 4, 2012 04:47
Script to load a queue and then cause the error 'Error subscribing to queue qtest.broadcast (Bunny::ProtocolError)'
#!/usr/bin/env ruby
require 'rubygems'
require 'bunny'
# Chris Doherty, confused by Bunny::Queue#subscribe semantics.
# run with `ruby bunny_test.rb load` followed by `ruby bunny_test.rb consume`.
class BunnyTest
@randomcamel
randomcamel / sinatra-multiple-values-fail
Created September 6, 2011 20:21
Sinatra failing to produce multiple param values
Sinatra 1.2.6 doesn't appear to properly handle multiple values for a form parameter. 'params[:my_param_name]'
only returns the last one supplied. I've verified that Chrome is sending the full list, and the list appears in
the rack.request.query_string variable (but not the rack.request.params variable).
get '/lame' do
erb :lame
end
post '/lame' do
puts params.inspect
shopt -u cdable_vars
shopt -s cdspell
shopt -u checkhash
shopt -s checkwinsize
shopt -s cmdhist
shopt -u compat31
shopt -u dotglob
shopt -u execfail
shopt -s expand_aliases
shopt -u extdebug
@randomcamel
randomcamel / rvm_dir_change
Created May 24, 2011 21:55
RVM changing directories, unhappily
+ builtin cd customization_server
+ local result=0
+ __rvm_project_rvmrc
+ local working_dir
+ [[ -n /Users/randomcamel/.rvm/scripts ]]
+ source /Users/randomcamel/.rvm/scripts/initialize
++ [[ -n 3.2.48(1)-release ]]
++ shopt -s extglob
++ export rvm_path=/Users/randomcamel/.rvm
++ rvm_path=/Users/randomcamel/.rvm