Skip to content

Instantly share code, notes, and snippets.

View pnovotnak's full-sized avatar

Peter Novotnak pnovotnak

View GitHub Profile
@pnovotnak
pnovotnak / git-lb
Last active March 23, 2023 06:02
List most recently used branches, with option to check out
#!/usr/bin/env bash
# Requires bash 4+ (not shipped with macos)
set -e
set -o pipefail
most_recent_branches() {
git reflog show --pretty=format:'%gs ~ %gd' --date=relative \
| grep 'checkout:' | grep -oE '[^ ]+ ~ .*' \
@pnovotnak
pnovotnak / license.txt
Created November 2, 2016 07:39
Django loaddata Command that Accepts Stdin
Copyright © 2016 Baptiste Mispelon, Peter Novotnak
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
### Keybase proof
I hereby claim:
* I am pnovotnak on github.
* I am pnovotnak (https://keybase.io/pnovotnak) on keybase.
* I have a public key whose fingerprint is 2792 8A11 7497 9397 47D8 C3DF FEC4 1E21 37EF D57E
To claim this, I am signing this object:
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv env", so your project folder
# has a env folder at the top level, next to your version control directory.