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
| heroku addons:add pgbackups --remote staging | |
| heroku addons:add pgbackups --remote production | |
| heroku pgbackups:capture --remote production | |
| heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging |
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
| 1) backup production database: | |
| heroku pgbackups:capture --expire --remote production | |
| 2) obtain url string to backup from step 1: | |
| heroku pgbackups:url --app production_app_name --remote production_app_branch_name | |
| 3) transfer backup from production to staging app: | |
| heroku pgbackups:restore DATABASE 'production_app_backup_url_string_from_step_2' --app production_app_name --app staging_app_branch_name |
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
| hydra = Typhoeus::Hydra.new :max_concurrency => 5 | |
| urls = %w(http://www.google.com/ http://engadget.com/ | |
| http://rubyonrails.org/ http://railscasts.com/) | |
| responses = [] | |
| urls.each do |url| | |
| req = Typhoeus::Request.new url | |
| req.on_complete do |resp| | |
| if resp.success? | |
| responses << resp.body |
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 ApplicationController < ActionController::Base | |
| # Tell Devise to redirect after sign_in | |
| def after_sign_in_path_for(resource_or_scope) | |
| some_url(:protocol => 'http') | |
| end | |
| # Tell Devise to redirect after sign_out | |
| def after_sign_out_path_for(resource_or_scope) | |
| some_url(:protocol => 'http') | |
| 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
| first_name | last_name | employer | |
|---|---|---|---|
| Fred | Flintstone | Bedrock Quarry | |
| Clark | Kent | The Daily Planet | |
| Ralph | Kramden | Metro Bus | |
| Joe | Friday | LAPD | |
| David | Hansson | 37Signals | |
| Jim | Weirich | EdgeCase |
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
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
NewerOlder