Skip to content

Instantly share code, notes, and snippets.


  • Paradise
Block or report user

Report or block jhrr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
$ PATH=$(npm bin):$PATH; git diff-tree --no-commit-id --name-only -r HEAD | xargs prettier --write
View artists-example.xml
<?xml version="1.0" encoding="UTF-8"?>
<image height="450" type="primary" uri="" uri150="" width="600" />
<image height="771" type="secondary" uri="" uri150="" width="600" />
<name>The Persuader</name>
<realname>Jesper Dahlbäck</realname>
$ docker exec -i $CONTAINER pg_restore --dbname=$DATABASE --verbose --clean -U $USER < pg_dump --format custom $DATABASE
View Elasticsearch install and uninstall.txt
#!/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
View .style.yapf
# .style.yapf
# Configuration file for the python formatter yapf.
# This configuration is based on the generic
# configuration published on GitHub.
# AUTHOR krnd
# VERSION v1.0
jhrr /
Created May 20, 2019
Methods to merge two git repos into one.
# 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.
jhrr /
Created Mar 18, 2019 — forked from jgillman/
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
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
$ docker-compose down
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker rm $(docker ps -a -q)
$ brew install postgresql
$ brew services start postgresql
$ initdb /usr/local/var/postgres -E utf8 --locale=en_GB.UTF-8
$ psql -h localhost -d postgres
# 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 .
You can’t perform that action at this time.