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
heroku pgbackups:capture --app <appname> | |
curl -o private/latest.dump `heroku pg:backups public-url --app <appname>` | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d <appname>-development private/latest.dump |
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
$ irb | |
> puts Dir['app/**/*'].sort_by{ |f| File.mtime(f) }.map{|f| "#{f} #{" " * (80-f.length)} #{File.mtime(f).strftime('%m%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
Tested on: Rails 3.2, Mongoid 2.0.1, pg 0.12.0 gem | |
Using Clearance (not devise) | |
1. remove mongoid gem(s) | |
2. add pg gem | |
3. in application.rb re-add ActiveRecord | |
4. for all models | |
- inherit from < ActiveRecord::Base |
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
// Run without 'bash' to see the commands called. To be run from the root of the application folder (above the app directory) | |
$ find app -name '*.erb' | \ | |
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | \ | |
bash | |
// And a script to remove all erb files via git (remove 'git' if not in git yet) | |
$ find app -name '*.erb' | \ | |
xargs ruby -e 'ARGV.each { |i| puts "git rm #{i}"}' | \ |
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
javascript:domain=%22www.mydomain.com%22;a=document.location.href.match(/http:\/\/([^\/]+)\/(.+)/);if(a[1].match(domain)){document.location=%22http://localhost:3000/%22+a[2]}else{document.location=%22http://%22+domain+%22/%22+a[2]} |