Skip to content

Instantly share code, notes, and snippets.

View oliverbarnes's full-sized avatar

Oliver Azevedo Barnes oliverbarnes

View GitHub Profile
class Person < ActiveRecord::Base
attr_accessor :cell_area_code, :cell_number
before_save :merge_cellphone
private
def merge_cellphone
self.cellphone = "(#{cell_area_code}) #{cell_number}"
@oliverbarnes
oliverbarnes / gist:1207693
Created September 10, 2011 00:25 — forked from darkside/gist:1207663
God override sudo with rvmsudo
namespace :god do
namespace :restart do
task :default, :roles => :app, :except => { :no_release => true } do
run "rvmsudo #{bin_god} restart #{application}"
end
desc "|capistrano-recipes| Restarts the app server"
task :app, :roles => :app, :except => { :no_release => true } do
run "rvmsudo #{bin_god} restart #{application}-#{app_server.to_s.downcase}"
end
@oliverbarnes
oliverbarnes / install_postgis_osx.sh
Created April 20, 2012 14:45 — forked from juniorz/install_postgis_osx.sh
Installing PostGIS 1.5.3 (old formula) for Postgres 9.1.3 (Mac)
#If you don't have Postgres installed yet:
# https://github.com/tsaleh/tammer-saleh/blob/master/views/posts/installing-postgresql-for-rails-3-1-on-lion.html.textil
#1. Install postgis 1.5.3. Latest is 2.0.0, so using url old formula on github
brew install https://raw.github.com/mxcl/homebrew/8a04a43763906e6a9bef68881acf997f3a6f6687/Library/Formula/postgis.rb
#2. Create a template to be used on creating GIS-enabled databases
createdb template_postgis
#3. Import Postgis Data
--
provider: twitter
uid: '15280529'
info:
  nickname: penguinbusiness
  name: Charlie Moseley
  location: Bellevue, WA
  image: http://a1.twimg.com/profile_images/281933747/kitamura_ava_normal.gif
  description: Developer, Otaku, Geek.
  urls:
@oliverbarnes
oliverbarnes / testing_qunit_setup.coffee
Last active December 22, 2015 11:29 — forked from anonymous/test_and_error.coffee
Initial integration test to make sure I have basic setup working correctly. Following this tutorial: http://ianpetzer.wordpress.com/2013/06/14/getting-started-with-integration-testing-ember-js-using-ember-testing-and-qunit-rails/ Using Rails 4
exists = (selector) ->
!!find(selector).length
module "Ember.js Library",
setup: ->
Ember.run App, App.advanceReadiness
teardown: ->
App.reset()