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
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST http://beta.sofarsounds.com/api/v1/sessions -d "{\"user\":{\"email\":\"user@example.com\",\"password\":\"secret\"}}" | |
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE http://beta.sofarsounds.com/api/v1/sessions/\?auth_token\=JRYodzXgrLsk157ioYHf | |
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST http://beta.sofarsounds.com/api/v1/registrations -d "{\"user\":{\"email\":\"user1@example.com\",\"password\":\"secret\",\"password_confirmation\":\"secret\"}}" |
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
=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') |
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
# in psql prompt | |
# connect to db | |
\c databasename | |
# update counter | |
SELECT setval('tablename_columnname_seq', (SELECT MAX(columnname) FROM tablename)+1); | |
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 config alias.co checkout | |
git config alias.com commit | |
git config alias.pu !"git fetch origin -v; git fetch upstream -v; git merge upstream/master" | |
git config alias.mrg '!git commit -m "merge"' |
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 fetch upstream | |
git merge upstream/master |
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
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 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 -a gsa-live --expire | |
heroku pgbackups:restore HEROKU_POSTGRESQL_GREEN -a gsa-staging `heroku pgbackups:url -a gsa-live` |
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
psql -h localhost | |
\c gsa_development; | |
REINDEX DATABASE gsa_development; | |
SELECT MAX(id) FROM taggings; | |
SELECT nextval('taggings_id_seq'); | |
SELECT setval('taggings_id_seq', (SELECT MAX(id) FROM taggings)+1); |
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 hey | |
def hi | |
if true | |
end | |
end | |
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
mate /etc/hosts | |
*add lines to hosts file / comment out to use sites* | |
dscacheutil -flushcache |