Skip to content

Instantly share code, notes, and snippets.

View jonathanlarsen's full-sized avatar

Jonathan Larsen jonathanlarsen

View GitHub Profile
Delete remote merged into master
git branch -r --merged | awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | xargs git push origin --delete
Delete local merged into current branch
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
Delete all remote not in egrep
git branch -a | egrep "remotes/origin/" | cut -d "/" -f 3- | egrep -v "(master|develop)" | xargs -n 1 git push --delete origin
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])