Skip to content

Instantly share code, notes, and snippets.

View jeanmartin's full-sized avatar
💻
working

Jan Schwenzien jeanmartin

💻
working
View GitHub Profile
Service.api_key = "<API_KEY>"
results = Service.ask!("What is this?")
=> [{ a: "b", c: 78.12 }]
curl https://api.service.com/v1/detect \
-H "Authorization: Bearer <API_KEY>" \
-d q=What+is+this
=> {"results":[{"a":"b","c":83.77}]}
@jeanmartin
jeanmartin / cap.rb
Created May 26, 2011 06:59
Kill resque workers using rake task, let god handle the restart
after "deploy:restart", "resque:stop_workers"
namespace :resque do
task :stop_workers, :except => { :no_release => true } do
run "cd #{current_path} && rake RAILS_ENV=#{rails_env} resque:stop_workers"
end
end