Skip to content

Instantly share code, notes, and snippets.

View fixr's full-sized avatar

Freddie Peña fixr

View GitHub Profile
@fixr
fixr / heroku_scaler.rb
Created October 4, 2012 22:12 — forked from JustinLove/heroku_scaler.rb
Sidekiq Herkou autoscaler with heroku-api gem
require 'heroku-api'
module Background
class HerokuScaler
def initialize(
type = 'worker',
app = ENV['HEROKU_APP'])
@client = Heroku::API.new # ENV['HEROKU_API_KEY'] must be present
@type = type
@app = app
@fixr
fixr / workitem.command.rb
Created November 9, 2010 23:46
workitem.command
def command= (com)
com = com.is_a?(Array) ? com : com.split(' ')
if com[1]
if com[0] == "jump"
com[1] = (com[2].nil? ? com[1] : com[2])
com.delete_at(2) if com[2]
else
com[1] = com[1].to_i
end