Skip to content

Instantly share code, notes, and snippets.

View putermancer's full-sized avatar

Ben Loveridge putermancer

View GitHub Profile
@putermancer
putermancer / gist:641533
Created October 22, 2010 23:05
remove trailing whitespace
# ^V + TAB to get the tab character, since sed doesn't like \t
find . -type f -name "*.py" -print0 | xargs -0 sed -i '' -e 's/[ ]*$//g'
@putermancer
putermancer / bzr2git.py
Created October 13, 2010 21:18
Migrate a bzr repo (with history) to git
#!/usr/bin/env python
import os, shutil, subprocess, time
from optparse import OptionParser
USAGE = """%prog [options] name
Converts a bzr repository into a git repository and preps it for git-flow"""
def run(*cmds):
output = []
# git track alias - easily set up a remote-tracking branch
[alias]
track = "!sh -c '[ $# = 2 ] && git branch --track \"$1\" \"$2\" && exit 0 || [ $# = 1 ] && git branch --track \"$1\" origin/\"$1\" && exit 0 || echo \"usage: git track <branch> [remote_branch] \\n\\nIf remote branch is not specified, the default is to use origin/<branch>\" && exit 1' -"
@putermancer
putermancer / devscreen.sh
Created September 22, 2010 16:04
development screen session shortcut
#!/bin/bash
# Simple way to create a main development screen in the
# right base directory, or re-attach to the one that is
# already setup.
# I create a symlink or alias 's' so I am always one keystroke
# away from my dev screen.
if screen -ls | grep main > /dev/null
@putermancer
putermancer / gist:591964
Created September 22, 2010 16:01
Set up a local solr instance on mac
# Setting up a local solr instance on a mac
# install solr with homebrew
brew install solr
# create the base solr index directory
mkdir -p /data/solr
# make sure you can write to the solr logs
sudo chown -R `whoami` /usr/local/Cellar/solr/
--- Info.plist.orig 2010-07-19 21:38:00.000000000 -0600
+++ Info.plist 2010-07-20 08:18:24.000000000 -0600
@@ -26,13 +26,13 @@
<array>
<dict>
<key>BundleIdentifier</key>
- <string>com.apple.Terminal</string>
+ <string>com.apple.VisorTerminal</string>
<key>BundleVersionsRE</key>
<array>