Skip to content

Instantly share code, notes, and snippets.

@ernestom
ernestom / git-remove-permanently.sh
Created December 21, 2011 20:02
Script to permanently remove paths from git's tree and index.
#!/bin/bash
#
# Removes the given paths permanently from the git index and tree.
#
set -e
function stats {
echo
echo "Git Objects:"
git count-objects -v
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@ernestom
ernestom / renamer.py
Created December 20, 2011 22:31
Python script to search and replace uncomplicated terms recursively in a given directory, always asking for confirmation.
"""
Recursively does a search & replace in the given directory.
Usage: python renamer.py <dir> <search> <replace>
"""
import os
import re
import sys
from fabric.colors import red