This file contains hidden or 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
| # From http://opinionated-programmer.com/2011/02/profiling-spork-for-faster-start-up-time/ | |
| Spork.prefork do | |
| # ... your normal prefork block goes here ... | |
| module Kernel | |
| def require_with_trace(*args) | |
| start = Time.now.to_f | |
| @indent ||= 0 |
This file contains hidden or 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 :myapp do | |
| task :reset_passwords => :environment do | |
| desc 'set all passwords to Test1234 to login locally' | |
| exit(1) unless Rails.env.development? | |
| User.all.each do |user| | |
| user.password = user.password_confirmation = "Test1234" | |
| user.save | |
| end | |
| end | |
| end |
This file contains hidden or 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 AddFieldToUser < ActiveRecord::Migration | |
| def self.up | |
| ActiveRecord::Base.establish_connection "user_#{Rails.env}" | |
| add_column :users, :field, :type | |
| end | |
| ... | |
| end |
This file contains hidden or 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
| gem 'ruby_parser' | |
| gem 'hpricot' | |
| gem 'haml' |
This file contains hidden or 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
| task :fix_updated_at => :environment do | |
| desc 'fix updated_at dates on requests' | |
| Request.record_timestamps = false | |
| Request.all.each do |r| | |
| r.update_attribute(:updated_at, r.calculated_updated_at) | |
| end | |
| end |
This file contains hidden or 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
| function gc { | |
| if [ -z "$1" ]; then | |
| git checkout master | |
| else | |
| git checkout $1 | |
| fi | |
| } |
This file contains hidden or 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
| [branch "master"] | |
| remote = origin | |
| merge = refs/heads/master | |
NewerOlder