Skip to content

Instantly share code, notes, and snippets.

View matthewmccullough's full-sized avatar

Matthew J. McCullough matthewmccullough

View GitHub Profile
@matthewmccullough
matthewmccullough / gist:302357
Created February 12, 2010 06:18 — forked from mkristian/gist:299995
Using the Shitty Maven plugin
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>shitty</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
@matthewmccullough
matthewmccullough / markdownhere.sh
Created November 27, 2010 16:27
Convert a markdown file to an HTML file and give the same name but with HTML as the file extension.
#!/bin/bash
#Uses the brew or macports binaries of 'markdown'. Needs the 'markdown' executable on the $PATH.
INPUTFILE="$1"
OUTPUTFILE=`echo "$INPUTFILE" | sed "s/\.md/\.html/"`
echo Writing markdown file to \"$OUTPUTFILE\"
markdown.pl "$INPUTFILE" > "$OUTPUTFILE"
@matthewmccullough
matthewmccullough / .zshrc
Created January 20, 2011 00:00
A configuration to maintain history across sessions and share it across terminals in ZShell
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
@matthewmccullough
matthewmccullough / gitignorechanges.sh
Created January 24, 2011 04:08
This script sets up aliases for ignoring changes to a version controlled file
# Using Git? Want to ignore changes to a noisy (e.g. tool-updated file), yet have to have it exist to satisfy said tool?
# Check it in once to source code control, then ignore all future changes. This option only applies to your local clone.
# Use this by typing 'git ignorechanges MYFILE'
git config --global alias.ignorechanges = update-index --assume-unchanged
# Use this by typing 'git noticechanges MYFILE'
git config --global alias.noticechanges = update-index --no-assume-unchanged
@matthewmccullough
matthewmccullough / ignorerecursive.sh
Created January 24, 2011 16:06
Recursively ignore a target directory in Git
git init testrecursiveignore
cd testrecursiveignore
mkdir target
echo buildjunk > target/build1.log
mkdir -p subproject/target
echo buildjunk > subproject/target/build2.log
echo //HelloWorld >> code/mycode.java
@matthewmccullough
matthewmccullough / Rakefile
Created February 1, 2011 19:11
Rake build file that should create an output directory
require 'rake'
HOME = "#{File.dirname(__FILE__)}"
DEST = "#{HOME}/output"
task :default => [:genoutputfolders]
task :genoutputfolders do
directory "output"
directory "#{DEST}"
@matthewmccullough
matthewmccullough / git-tracking-info.bash
Created March 9, 2011 05:07
Examples of three branch tracking info techniques in Git
% git status --branch
# On branch master
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
#
nothing to commit (working directory clean)
% git branch -v
* master a60b37e [behind 1] First checkin
mynewfeature 7a910dc Checking in everything
@matthewmccullough
matthewmccullough / git-deletealltags.bsh
Created April 1, 2011 20:29
Script to delete all tags both locally and remotely
for t in `git tag`
do
git push origin :$t
git tag -d $t
done
@matthewmccullough
matthewmccullough / O'Reilly-Fringes-Of-Git-Webinar.markdown
Created April 13, 2011 23:24
Matthew McCullough & Tim Berglund's O'Reilly "Fringes Of Git" Webinar Source

O'Reilly Git Webinar

The Fringes of Git

Overview

Matthew McCullough and Tim Berglund, authors of the O'Reilly Git Master Class videos will introduce you to the very edges of Git's capabilities. There are plenty of "Getting Started with Git" sessions on the web, but we'd like to take 40 minutes of your time in an entirely different direction. These 40 minutes will primarily be live coding with a few diagrams for reference. We'll show you how Git reaches farther than any other version control system to provide capabilities for both the novice and the master craftsperson.

Webinar Outline

Rebasing

@matthewmccullough
matthewmccullough / gist:988077
Created May 24, 2011 03:02
Visualize Git Orphans via gitk and log
# Put this in your .gitconfig file under the alias section
orphank = !gitk --all `git reflog | cut -c1-7`&
# Then run it by typing 'git orphank' on the command line.
# A text version of the same is
orphanl = !git --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -c1-7`