Skip to content

Instantly share code, notes, and snippets.

View iyanski's full-sized avatar

iyanski iyanski

View GitHub Profile
@iyanski
iyanski / restore
Created October 4, 2017 16:12 — forked from jgillman/restore.sh
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db
@iyanski
iyanski / 0_reuse_code.js
Created March 2, 2017 06:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Run this one-liner from the Sublime Text console if you need to revert all open documents
[ view.run_command('revert') for view in sublime.Window.views(sublime.active_window()) ]