Skip to content

Instantly share code, notes, and snippets.

View matthewmccullough's full-sized avatar

Matthew J. McCullough matthewmccullough

View GitHub Profile
@tlberglund
tlberglund / workshop-outline.md
Created September 22, 2012 20:43
NFJS Atlanta Git Workshop

NFJS Git Workshop

  • Create a repo
    • git config --global user.name "Tim Berglund"
    • git config --global user.email "tlberglund@github.com"
    • git config --global color.ui auto
    • git init atlanta
  • Add files
    • Create caesar.txt
    • git add caesar.txt
@virtualandy
virtualandy / gitingawayfromsvn.md
Created September 14, 2012 22:06
Git-ing away from SVN

Switching to GitHub

Many companies ask why they should switch to Git and GitHub. The answer primarily lies in doing less repetitive work, and making your source code control efforts disppear into the background instead of be in the forefront of your workflow. Your focus should be on your creative work and just incidentally have it versioned. As soon as your project is no longer a solo effort, you desire to have it support collaboration. In the space of version control, our users claim that no set of tools does that as well as Git and GitHub.

These goals are explained in a highly creative way by GitHub's CEO in The Git Parable.

Additionally, a growing constituency of open source is hosted at GitHub. In June of 2011, GitHub had [more commits than Sourceforge, Google Code, and CodePlex combined](http://www.readwriteweb.com/hack/2011/06/github-has-

@napcs
napcs / video.md
Created September 8, 2012 16:25
Video project

Intro to Programming video

I want to make a video to show my class of would-be IT people. If you write code, would you send me a video clip (webcam, less than 30s) with the following?

  • Introduce yourself (name, where you work)
  • Why you love what you do
  • Why you love open-source software (optional, but would be super helpful)

Email the clip (or a link I can download the clip) to bphogan at gmail and be sure to include your Twitter username so I can add that on your clip.

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@LordGaav
LordGaav / post-commit
Created June 19, 2012 11:59
Git hook that determines the author based on the email address in a SSH key. Doesn't work because Git doesn't check the config between pre-commit and commit.
#!/bin/sh
# Retrieve author information as Git sees it while commiting
AUTHORINFO=$(git var GIT_AUTHOR_IDENT) || exit 1
NAME=$(printf '%s\n' "${AUTHORINFO}" | sed -n 's/^\(.*\) <.*$/\1/p')
EMAIL=$(printf '%s\n' "${AUTHORINFO}" | sed -n 's/^.* <\(.*\)> .*$/\1/p')
printf "AUTHORINFO: %s\n" "${AUTHORINFO}"
printf "NAME: %s\n" "${NAME}"
printf "EMAIL: %s\n" "${EMAIL}"
@matthewmccullough
matthewmccullough / git-compressing-and-deltas.md
Created May 14, 2012 19:05
Git, Compression, and Deltas - An explanation

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:

@tkarpinski
tkarpinski / github_issues_to_csv.rb
Created April 12, 2012 18:09 — forked from henare/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="USER_NAME"
PASSWORD="SEKRIT"
# Project you want to export issues from
USER="REPO_OWNER"
PROJECT="REPO_NAME"
@schacon
schacon / get_token.sh
Created April 9, 2012 15:38
shell command to get a GitHub OAuth token
# sh get_token.sh user pass
curl -s -d '{"scopes":["repo"],"note":"admin script"}' -u "$1:$2" -XPOST https://api.github.com/authorizations | grep token
@mtnygard
mtnygard / gist:2254147
Created March 30, 2012 19:10
Books I recommended today
@Dierk
Dierk / pre-receive.groovy
Created February 9, 2012 23:50
a pre-receive hook to allow both: feature branches and agile CI
// a git pre-receive hook
// that automatically merges all pushes to feature branches
// into a dedicated continuous-integration (ci) branch.
// Since we cannot merge in a bare repo, we work on a temporary clone.
// Dierk Koenig
def ciBranch = 'master'
def mergeName = 'merge'
def hereDirPath = new File('.').canonicalPath