Skip to content

Instantly share code, notes, and snippets.

View putermancer's full-sized avatar

Ben Loveridge putermancer

View GitHub Profile
--- 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>
@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/
@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
# 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 / 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 = []
@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 / gitinit.sh
Created November 2, 2010 16:36
Quickly set up a shared git repository
REPONAME=${1%/} # trim trailing slash
if [ ! -d "$REPONAME" ]; then
# Make a temporary working directory
mkdir $REPONAME && cd $REPONAME
echo .DS_Store > .gitignore # ignore a common MacOS file
# make an initial commit
git init && git add .gitignore && git commit -m "initial commit"
else
@putermancer
putermancer / .gitconfig
Last active June 15, 2022 08:37
git aliases
[alias]
man = help
unadd = reset HEAD
#co = checkout
co = "!f(){ git checkout \"$@\" && git sup; }; f"
feature = "!git reset HEAD && git checkout -b feature/\"$1\" && git commit --allow-empty -m \"Created feature branch $1\" && git push --set-upstream origin feature/\"$1\" && echo Branch feature/$1 published to origin"
cp = cherry-pick
sma = submodule add
st = status
br = branch
@putermancer
putermancer / gist:847755
Created February 28, 2011 18:24
git + gitolite shell access, user-based
#!/bin/bash
shift # get rid of -c
# if no commands, just open a shell
if [[ $# -eq 0 ]]; then
/bin/bash -l
# if the first arg is a git- command, that means it is something like git-push, etc... so forward it
elif [[ $1 == git-* ]]; then
ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no git@localhost $*
@putermancer
putermancer / gist:908842
Created April 7, 2011 21:59
one-liner jscoverage command, excluding test scripts
for y in 1; do TMPVAR__=; for x in `find ${DIRNAME} -name "tests" -type d`; do TMPVAR__+="--no-instrument=`echo $x | awk -F${DIRNAME}/ '{print $2}'` "; done; jscoverage ${DIRNAME} ${DIRNAME}_coverage $TMPVAR__; TMPVAR__=; done;