Skip to content

Instantly share code, notes, and snippets.

View parndt's full-sized avatar

Philip Arndt parndt

View GitHub Profile
@parndt
parndt / gist:1822547
Created February 14, 2012 02:13
My ~/.bash_profile contains this prompt thanks to @ndbroadbent
# Returns the current git branch (returns nothing if not a git repository)
parse_git_branch() {
\git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
parse_git_dirty() {
[ -n "$(\git status --short 2> /dev/null)" ] && echo "±"
}
# Returns the current ruby version.
@parndt
parndt / Gemfile
Created March 19, 2012 21:57 — forked from joemsak/Gemfile
source 'http://rubygems.org'
gem 'rails', '~> 3.0.11'
gem 'foreman'
gem 'unicorn'
gem 'airbrake'
gem 'delayed_job'
gem 'compass', '~> 0.12.alpha'
gem 'acts-as-taggable-on', '~>2.1.0'
spree_active_shipping/app/models/spree/calculator/fedex/base.rb:2: warning: toplevel constant Fedex referenced by Spree::Calculator::Fedex
spree_active_shipping/app/models/spree/calculator/fedex/express_saver.rb:2: warning: toplevel constant Fedex referenced by Spree::Calculator::Fedex
spree_active_shipping/app/models/spree/calculator/fedex/express_saver.rb:2: warning: toplevel constant Fedex referenced by Spree::Calculator::Fedex
spree_active_shipping/app/models/spree/calculator/fedex/first_overnight.rb:2: warning: toplevel constant Fedex referenced by Spree::Calculator::Fedex
spree_active_shipping/app/models/spree/calculator/fedex/first_overnight.rb:2: warning: toplevel constant Fedex referenced by Spree::Calculator::Fedex
spree_active_shipping/app/models/spree/calculator/fedex/ground.rb:2: warning: toplevel constant Fedex referenced by Spree::Calculator::Fedex
spree_active_shipping/app/models/spree/calculator/fedex/ground.rb:2: warning: toplevel constant Fedex referenced by Spree::Calculator::Fedex
spree_a
$ cat ~/.bash_profile | grep bert
alias bert='JS=false bundle exec rspec ./*/spec && JS=true bundle exec rspec ./*/spec'
17:49:35: [master|1.9.3p194] /code/parndt/refinerycms$ bert
Run options: include {:focus=>true}
...............................................................................................................................................................................................................................................................................................................................................................................................................
Top 10 slowest examples:
Pages with translations add a page with title for both locales succeeds
0.92132 seconds ./pages/spec/requests/refinery/admin/pages_spec.rb:355
@parndt
parndt / gist:2714521
Created May 16, 2012 22:26
rubygems > 1.8.12 fail on rbx
10:24:45: [2.0.0dev] ~$ gem install bcrypt-ruby -v 3.0.1
ERROR: While executing gem ... (NoMethodError)
undefined method `slice!' on nil:NilClass.
10:25:03: [2.0.0dev] ~$ gem --version
1.8.24
10:25:12: [2.0.0dev] ~$ rbx -v
rubinius 2.0.0dev (1.8.7 b2570c39 yyyy-mm-dd JI) [x86_64-apple-darwin12.0.0]
# pro tip
gem 'refinerycms-core', :git => 'git://github.com/resolve/refinerycms.git', :branch => '2-0-stable'
gem 'refinerycms-dashboard', :git => 'git://github.com/resolve/refinerycms.git', :branch => '2-0-stable'
gem 'refinerycms-images', :git => 'git://github.com/resolve/refinerycms.git', :branch => '2-0-stable'
gem 'refinerycms-pages', :git => 'git://github.com/resolve/refinerycms.git', :branch => '2-0-stable'
gem 'refinerycms-resources', :git => 'git://github.com/resolve/refinerycms.git', :branch => '2-0-stable'
# Can be simply:
@parndt
parndt / gist:3051466
Created July 5, 2012 04:59
Merge pull requests the old fashioned way
function confirm()
{
echo "${1:-Are you sure? [Y/n]}"
read -r response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)
false
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
def setup_environment
# Configure Rails Environment
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
@parndt
parndt / .bash_profile
Created September 10, 2012 01:27
Put Orcon Usage information in your OS X Terminal upon login
# Put this in your ~/.bash_profile down the bottom or somewhere
echo "Current usage: $(cat ~/.orcon_usage)"
$ heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.1
rake aborted!
libruby.so.1.9: cannot open shared object file: No such file or directory - /app/vendor/bundle/ruby/1.9.1/gems/pg-0.14.1/lib/pg_ext.so