Skip to content

Instantly share code, notes, and snippets.

View matthewmccullough's full-sized avatar

Matthew J. McCullough matthewmccullough

View GitHub Profile
@matthewmccullough
matthewmccullough / countcontribs.bsh
Created May 27, 2011 18:15
Find unique contributors to a Git repo
#!/bin/bash
#Ensure we have the quantity specified on the CLI
if [ -z "$1" ]; then ARG_ERR=ERR; fi
if [ -n "$ARG_ERR" ];
then
echo "Usage: <portionofcommiter>"
exit
fi
@matthewmccullough
matthewmccullough / init.el
Created June 20, 2011 01:17
Wiring Groovy emacs mode to Gradle files
;; Get the Groovy support for Emacs from http://svn.codehaus.org/groovy/trunk/groovy/ide/emacs
;; Symlink the downloaded Groovy support into your .emacs.d folder as "groovy"
;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start
(add-to-list 'load-path "~/.emacs.d/groovy")
(autoload 'groovy-mode "groovy-mode" "Major mode for editing Groovy code." t)
;; For some reason, these recommendations don't seem to work with Aquamacs
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode))
(add-to-list 'auto-mode-alist '("\.gradle$" . groovy-mode))
@matthewmccullough
matthewmccullough / Copywithoutnewline.sh
Created June 29, 2011 01:33
Copy to the Mac clipboard without a new line
alias pbcopynn='tr -d "\n" | pbcopy'
@matthewmccullough
matthewmccullough / isappinstalled
Created June 29, 2011 16:55
Tests if an app is installed. Response code could be checked by an if-test
#!/bin/bash
#Ensure we have one argument specified on the CLI
if [ -z "$1" ]; then ARG_ERR=ERR; fi
if [ -n "$ARG_ERR" ];
then
echo "Checks if an app (passed as a parameter) is installed/reachable"
echo " on this machine by using the 'hash' command."
echo "Usage: isappinstalled <appname>"
echo "Returns: 0 if is installed, 1 if not installed."
@matthewmccullough
matthewmccullough / September-28-2011-GitHub-Office-Hours-Transcript.txt
Created September 29, 2011 03:45
September 28, 201 - GitHub Office Hours Transcript
MatthewMcC And hello everyone! Welcome to the first of many future GitHub office hours. For those of you new to Campfire, it is best if you @matthewmcc if you want to catch my attention directly. We're open to any and all questions on Git and GitHub during the hour and will try to spread the attention to everyone participating and answer as many questions as possible.
I'm Matthew McCullough, GitHub's trainer for all things Git. (http://github.com/training/online)
Mike What is the main use for submodules?
MatthewMcC @Mike Great first question. It is a multipart answer.
3:05 PM
MatthewMcC @Mike First, submodules are best for organizing an "uber app" that is composed of subcomponents. For example, some big site that has a chat module, a shopping cart, some resources, and some APIs.
@Mike Lets say that this is big enough that there are multiple teams, and each team is assigned one of those components.
@Mike The teams are likely innovating like crazy, but we can't just take their code at any time -- we need it to
function matrix1() {
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|gawk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
}
function matrix2() {
echo -e "\e[1;40m" ; clear ; characters=$( jot -c 94 33 | tr -d '\n' ) ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) $characters ;sleep 0.05; done|gawk '{ letters=$5; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
}
function matrix3() {
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $( printf "\U$(( $RANDOM % 500 ))"
@matthewmccullough
matthewmccullough / .gitconfig.ini
Created December 31, 2011 18:16
Alternate URLs (insteadOfs) for GitHub Git repos
[url "git://github.com/"]
insteadOf = "ghg://"
pushInsteadOf = "ghg://"
# Example: git clone ghg://ntschutta/emacs
[url "git://github.com/matthewmccullough/"]
insteadOf = "ghgm://"
pushInsteadOf = "ghgm://"
# Example: git clone ghgm://hellogitworld
[url "git@github.com:"]
insteadOf = "ghs://"
@matthewmccullough
matthewmccullough / notes.markdown
Created January 10, 2012 15:11
January GitHub Git Foundations Class Notes

January GitHub Git Foundations Class Notes

How did you do that init again?

git init project2
cd project2
git status
mate index.html
git status
@matthewmccullough
matthewmccullough / orgtomarkdown.sh
Created January 11, 2012 04:43
OrgMode to Markdown Converter
#!/bin/sh
# Convert OrgMode to Markdown
export MARKDOWNNAME="`echo "$1" | sed s/orgmode/markdown/`"
export HTMLNAME="`echo "$1" | sed s/orgmode/html/`"
cat "$1" | sed "s/^\*\* / \* /" \
| sed "s/^\*\*\* / \* /" \
| sed "s/^\*\*\*\* / \* /" > "$MARKDOWNNAME"
cat "$MARKDOWNNAME" | markdown > "$HTMLNAME"
@matthewmccullough
matthewmccullough / Writing Tools Writeup.md
Created January 13, 2012 23:07
How To Write A Technical Book (One Man's Modest Suggestions)