Skip to content

Instantly share code, notes, and snippets.

@openjck
openjck / filter-branch-prepend-and-append
Created December 11, 2014 17:08
Using sed and filter-branch to prepend and append to Git commit messages without newlines
# Prepending text to the five most recent commit messages:
git filter-branch --msg-filter 'sed "s/\(.*\)/[prepended text] \1/g"' HEAD~5..HEAD
# Appending text to the five most recent commit messages:
git filter-branch --msg-filter 'sed "s/\(.*\)/\1 [appended text]/g"' HEAD~5..HEAD
@openjck
openjck / kuma-vagrant-reset.sh
Last active August 29, 2015 14:02
Take common steps to fix the Kuma development environment. Basically the equivalent of resetting Firefox or unplugging a router. Restarts as much as possible without losing data.
#!/bin/bash
# Configuration
KUMA_ROOT=/path/to/kuma
# Script
# https://www.youtube.com/watch?v=ckIMuvumYrg
pushd .
cd $KUMA_ROOT
vagrant halt
#!/bin/bash
# Adapted from: https://gist.github.com/mythmon/4151152
export LEEROY_URL="https://leeroybot.herokuapp.com/"
LEEROY_RERUN="https://raw.github.com/lonnen/leeroy-rerun/master/leeroy-rerun.py"
# Usage
[[ -z $1 ]] && {
echo "Rerun a Leeroy job for Kuma."