Skip to content

Instantly share code, notes, and snippets.

View QuintinAdam's full-sized avatar
:shipit:

Quintin Adam QuintinAdam

:shipit:
  • Wayfinder
  • Japan
View GitHub Profile
@QuintinAdam
QuintinAdam / db.rake
Created October 18, 2016 01:08 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@QuintinAdam
QuintinAdam / .powenv
Last active August 29, 2015 14:22 — forked from beneggett/.powenv
# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi
# load environment of current project ruby
if

Setting up your environment can be difficult when you're first starting with Ruby. We want to get the following installed:

  • Git
  • Ruby 2.2
  • A text editor

The setup instructions are broken down by the following platforms: Mac

Mac OS

@QuintinAdam
QuintinAdam / .powenv
Created December 1, 2013 05:58 — forked from beneggett/.powenv
# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi
# load environment of current project ruby
if