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
$ PATH=$(npm bin):$PATH; git diff-tree --no-commit-id --name-only -r HEAD | xargs prettier --write |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<artists> | |
<artist> | |
<images> | |
<image height="450" type="primary" uri="" uri150="" width="600" /> | |
<image height="771" type="secondary" uri="" uri150="" width="600" /> | |
</images> | |
<id>1</id> | |
<name>The Persuader</name> | |
<realname>Jesper Dahlbäck</realname> |
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
$ docker exec -i $CONTAINER pg_restore --dbname=$DATABASE --verbose --clean -U $USER < pg_dump --format custom $DATABASE |
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
#!/usr/bin/env sh | |
# checks to see if running | |
launchctl list | grep elasticsearch | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist | |
launchctl remove homebrew.mxcl.elasticsearch | |
pkill -f elasticsearch |
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
# .style.yapf | |
# | |
# DESCRIPTION | |
# Configuration file for the python formatter yapf. | |
# | |
# This configuration is based on the generic | |
# configuration published on GitHub. | |
# | |
# AUTHOR krnd | |
# VERSION v1.0 |
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
# Brings over all tags/branches keeping history intact for the | |
# incoming remote data. | |
$ cd path/to/source-repo | |
$ git remote add target path/to/target | |
$ git fetch target --tags | |
$ git merge --allow-unrelated-histories target/some-branch | |
$ git remote remove target | |
# Or, to merge just the one branch this works but it loses all | |
# the extra history that the above method preserves. |
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
# 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 |
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
$ docker-compose down | |
$ docker volume rm $(docker volume ls -qf dangling=true) | |
$ docker rm $(docker ps -a -q) |
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
$ brew install postgresql | |
$ brew services start postgresql | |
$ initdb /usr/local/var/postgres -E utf8 --locale=en_GB.UTF-8 | |
$ psql -h localhost -d postgres |
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
# Emacs daemon functions. | |
emacs_server_ok() { | |
emacsclient -a "false" -e "(boundp 'server-process)"; | |
} | |
# Open a file, in the current shell, using the emacs daemon. | |
e() { | |
if [[ "${1}" == '' ]]; then | |
emacsclient --tty . |