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
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}" |
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 :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 |
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 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 |
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
-- | |
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: |
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
exists = (selector) -> | |
!!find(selector).length | |
module "Ember.js Library", | |
setup: -> | |
Ember.run App, App.advanceReadiness | |
teardown: -> | |
App.reset() |