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
module Capybara | |
def Capybara.auto_save_and_open_page=(val) | |
@auto_save_and_open_page = !!val | |
end | |
def Capybara.auto_save_and_open_page? | |
@auto_save_and_open_page ||= false | |
end | |
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
:copy_exclude => ['.git'] |
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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'bundler' do | |
watch('Gemfile') | |
# Uncomment next line if Gemfile contain `gemspec' command | |
# watch(/^.+\.gemspec/) | |
end | |
guard 'rails' do |
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
# note: there is work afoot to load pbf directly with osm2pgsql | |
# http://lists.openstreetmap.org/pipermail/dev/2010-October/020953.html | |
# but for now osmosis >= 0.37 works best | |
# install java/osmosis if you don't already have it | |
sudo apt-get install sun-java6-jre | |
wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-0.37.zip | |
unzip osmosis-0.37.zip | |
cd osmosis-0.37 | |
chmod +x bin/osmosis |
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 | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn web server | |
# Description: starts unicorn |
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
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz | |
$ tar xzvf ./nginx-0.8.52.tar.gz | |
$ rm ./nginx-0.8.52.tar.gz | |
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc | |
$ passenger-install-nginx-module | |
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation | |
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52 | |
# Where do you want to install Nginx to?: /opt/nginx |
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
set :application, "hermes" | |
set :repository, "git@your_repository:hermes.git" | |
set :user, 'root' | |
set :use_sudo, false | |
set :deploy_via, :remote_cache | |
set :scm, :git | |
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` | |
role :web, "xxx.com" # Your HTTP server, Apache/etc |
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
def output name=((default=true); "caius") | |
puts "name: #{name.inspect}" | |
puts "default: #{default.inspect}" | |
end | |
output | |
# >> name: "caius" | |
# >> default: true | |
output "avdi" |
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
namespace :deploy do | |
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
from = source.next_revision(current_revision) | |
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} | |
else | |
logger.info "Skipping asset pre-compilation because there were no asset changes" | |
end | |
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
Each line is composed of 4 different tokens: prefixes, name of country entity, continent, country numeric code. | |
1A|Sov. Mil. Order of Malta|EU|246 | |
3A|Monaco|EU|260 | |
3B6,3B7|Agalega & St. Brandon Is.|AF|4 | |
3B8|Mauritius|AF|165 | |
3B9|Rodriguez I.|AF|207 | |
3C|Equatorial Guinea|AF|49 | |
3C0|Annobon I.|AF|195 | |
3D2|Fiji|OC|176 |