Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew J. McCullough matthewmccullough

View GitHub Profile
@matthewmccullough
matthewmccullough / gist:988077
Created May 24, 2011
Visualize Git Orphans via gitk and log
View gist:988077
# 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`
View book-authoring-using-git-and-github.md
layout title description path
barewithrelated
Book Authoring Using GitHub and Git
Formats, tips and techniques for using GitHub and Git as the version control and collaborative platform for writing short and long form books.
usecases/_posts/2001-01-01-book-authoring-using-git-and-github.md

GitHub and Git are not just for writing programming code. They can also be an effective tool for writing articles and books. Matthew McCullough has written a quick guide to writing books in lightweight formats. This article will be folded into this Teaching repository over the coming months.

What is this?

View books.md
@matthewmccullough
matthewmccullough / game-theory-books.markdown
Created May 17, 2012
Game Theory Book list by Matthew McCullough
View game-theory-books.markdown

Economics & Software Development - Book List

The following books are ordered in descending order of Matthew's preference.

The Art of Strategy

by Avinash K. Dixit

Recommended by Ted Neward. A different perspective and writing style from the other volumes listed.

“I am hard pressed to think of another book that can match the combination of practical insights and reading enjoyment.”—Steven Levitt

@matthewmccullough
matthewmccullough / .zshrc
Created Jan 20, 2011
A configuration to maintain history across sessions and share it across terminals in ZShell
View .zshrc
##############################################################################
# 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 / git-compressing-and-deltas.md
Created May 14, 2012
Git, Compression, and Deltas - An explanation
View git-compressing-and-deltas.md

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

@matthewmccullough
matthewmccullough / git-deletealltags.bsh
Created Apr 1, 2011
Script to delete all tags both locally and remotely
View git-deletealltags.bsh
for t in `git tag`
do
git push origin :$t
git tag -d $t
done
@matthewmccullough
matthewmccullough / GitHub Free Class and Office Hours on 2014-01-17.md
Created Jan 20, 2014
GitHub Free Class and Office Hours on 2014-01-17
View GitHub Free Class and Office Hours on 2014-01-17.md
View git-and-github-anti-patterns.md

Git and GitHub Anti-Patterns

An idea prompted by Jeremy Deane via a Tweet

Committing

  • Lack of precision
  • No care about atomicity
  • Poor commit messages

History

@matthewmccullough
matthewmccullough / terminal.scpt
Created Jan 5, 2010
AppleScript to open a Terminal tab at the specified path
View terminal.scpt
-----------------------------------------------------------------------
-- A Script that opens a specified command line folder name in a new
-- terminal tab.
--
-- Composed by Matthew McCullough, 2010
-- MIT License. Share freely.
-----------------------------------------------------------------------
--Reference for tab opening
-- http://lambie.org/2007/11/03/tabs-in-terminal-using-applescript-on-leopard/
--Reference for other scripting approaches with Terminal