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
#! /bin/bash | |
array=( $@ ) | |
len=${#array[@]} | |
app=${array[$len-1]} | |
args=${array[@]:0:$len-1} | |
buffer_file=/tmp/last_heroku_run_`date +%N` | |
/usr/bin/heroku run "$args; echo \$?" --app $app 2>&1 | tee $buffer_file |
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
if open_jobs < idle_workers.count | |
scaledown_workers | |
elsif all_workers_working? && jobs_queued? && (instances_count - workers.count) < open_jobs | |
scaleup_workers | |
end |
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
[alias] | |
b = branch | |
a = add | |
c = commit -sv | |
cm = commit -svm | |
ca = commit --amend | |
co = checkout | |
cp = cherry-pick | |
d = diff | |
f = fetch |
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
function h { heroku ${@:1:($#-1)} --app ${@: -1} ; } | |
function hp { h $@ production_app_name ; } | |
function hs { h $@ staging_app_name ; } | |
alias hpc="hp run console" | |
alias hsc="hs run console" | |
alias hpl="hp logs -t" | |
alias hsl="hs logs -t" |
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
--- | |
test: | |
commands: | |
setup: | |
commands: |
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
config.assets.debug = false | |
config.action_controller.asset_host = "https://d1qi4917vekr3d.cloudfront.net" |
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
group :assets do | |
gem 'sass-rails' | |
gem 'coffee-rails' | |
gem 'uglifier' | |
gem 'yui-compressor' | |
gem 'compass-rails' | |
end |
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
config.logger = Logger.new(STDOUT) |
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
gem 'unicorn' |
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
#Base on https://gist.github.com/1401792 | |
worker_processes 4 # amount of unicorn workers to spin up | |
timeout 30 # restarts workers that hang for 30 seconds | |
preload_app true | |
before_fork do |server, worker| | |
# Replace with MongoDB or whatever | |
if defined?(ActiveRecord::Base) | |
ActiveRecord::Base.connection.disconnect! | |
Rails.logger.info('Disconnected from ActiveRecord') |