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
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 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 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 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 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 'capybara' | |
require 'capybara/poltergeist' | |
Capybara.javascript_driver = :poltergeist |
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
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new(app, {js_errors:true, port:44678+ENV['TEST_ENV_NUMBER'].to_i, phantomjs_options:['--proxy-type=none'], timeout:180}) | |
end |
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
#Run with casperjs test codeshiptest.coffee | |
casper.start 'https://www.codeship.io/', -> | |
@.clickLabel 'Blog', 'a' | |
@.then -> | |
@.test.assertUrlMatch 'http://blog.codeship.io' | |
casper.run -> | |
@.test.done(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
#Run with casperjs test casperjstest.coffee | |
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)') | |
casper.start 'http://casperjs.org', -> | |
@.viewport(1024, 768); | |
@.thenClick('.dropdown-toggle') | |
@.then -> | |
@.clickLabel 'Tester API' | |
@.then -> | |
@.clickLabel 'Extending' |
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
#Run with casperjs test translate.coffee | |
casper.start 'http://translate.google.com/', -> | |
@.sendKeys('#source', 'Guten Tag'); | |
@.then -> | |
@.click '#gt-submit' | |
@.waitForText('Good day') | |
@.then -> | |
@.test.assertSelectorHasText '#result_box', 'Good day' | |
@.then -> |
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
#!/bin/bash | |
#Postgres Repository | |
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' | |
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - | |
apt-get install postgresql-9.2 postgresql-contrib-9.2 | |
#Install POSTGIS | |
apt-get install postgresql-server-dev-9.2 libgeos-dev libproj-dev libgdal-dev -y -q |