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
find . -name *.rb -type f -exec sed -i 's/named_scope/scope/g' {} \; |
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
find ./spec/ -name *_spec.rb -type f -exec sed -i "/require \"spec\"/d" {} \; |
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
git checkout -b squashed_feature | |
git rebase -i master | |
pick fda59df commit 1 | |
squash x536897 commit 2 | |
squash c01a668 commit 3 |
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
update-rc.d -f SERVICE remove |
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
Dir.glob("#{Rails.root}/app/models/*.rb").collect{|m| m.split("/").last.split(".").first.camelize.constantize } | |
models = ActiveRecord::Base.subclasses.collect(&:name).collect(&:constantize) | |
models.each{|m| puts m; print "Columns: #{m.column_names}"; puts ""; print "Protected: #{m.attr_protected.to_a}"; puts ""; print "Accessible: #{m.attr_accessible.to_a}"; puts "\n\n" } | |
# example output | |
# | |
#User | |
#Columns: ["id", "email", "encrypted_password", "salt", "confirmation_token", "remember_token", #"created_at", "updated_at", "company_id", "status"] | |
#Protected: ["id", "type", "status", "company_id"] |
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
git branch -r --merged develop | sed 's/ *phil\///' | grep -v 'master$' | grep -v 'develop$' | grep -v '^ dave' | grep -v '^ kevinbrowne' | xargs -I% git push phil :% | |
# mostly likely change the first part to master. use this branch to test if things have been merged in | |
# sed part. use this to remove the name of your remote in my case phil. most likely to be origin | |
# grep any branches you want to keep | |
# last part. change name to your remote | |
# you can do a dry run by removing the last section |
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
git branch --merged develop | grep -v 'master$' | grep -v 'develop$' | xargs git branch -d | |
# find all local branches merged in to develop | |
# dont delete master or develop branches | |
# then do it |
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
sudo date -s "2 MAR 2012 18:00:00" |
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
# apt-get | |
# build-essential gcc libreadline6-dev libxslt-dev libxml2-dev zlib1g-dev libcurl4-openssl-dev libpcre3-dev | |
# http://www.blog.bridgeutopiaweb.com/post/install-rvm-passenger-nginx-and-rails-3-on-ubuntu-lucid-lynx/ | |
rvm install 1.9.2 | |
rvm 1.9.2 --passenger |
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
# users, roles | |
create user blah with password 'blah'; | |
drop user blah; | |
# db creation | |
create database DATABASE with owner OWNER; |