Skip to content

Instantly share code, notes, and snippets.

@petehamilton
petehamilton / digest_template.yaml
Created November 17, 2012 16:49
Imperial College Computing Digest Template
# Example of rendered digest: http://docsoc.s3.amazonaws.com/sample/sample_digest_email.html
# Github Repo for digest email generator: https://github.com/PeterHamilton/digest-email
# Instructions:
# 1. Download this file
# 2. Fill it in (minus image URL, unless you have one)
# 3. Send a 150px wide image + the file to me
- list_title: This text will go in the top list of posts
image: https://s3-eu-west-1.amazonaws.com/docsoc/sample/suitcase.jpg
@petehamilton
petehamilton / sample_digest_email.yml
Created November 17, 2012 02:46
Sample email config for Digest Email gem
# sample_digest_email.yml
# Parses with the digest_email (http://peterhamilton.github.com/digest_email) gem
# See the result of running this file through the gem here: http://docsoc.s3.amazonaws.com/sample/sample_digest_email.html
header:
title: "Weekly Digest"
subtitle: November 12th 2012
subsubtitle:
items:
- list_title: New, Easy Email Digests
@petehamilton
petehamilton / uta-helper.rb
Created October 19, 2012 12:55
Imperial College Computing UTA Helper Script
#! /usr/bin/ruby
# Recommend saving (or symlinking) as /usr/bin/uta-helper
################################################################################
#
# Simple ruby script to pull down student code for excercises from labranch
#
# Example: $ uta-helper pull -e html
# Will clone all the repos into a 'respositories' directory by default.
@petehamilton
petehamilton / gist:1341831
Created November 5, 2011 18:07
Nice way of viewing git branch in terminal
#Handy Git stuff
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
function git-track {
CURRENT_BRANCH=$(parse_git_branch)
git-config branch.$CURRENT_BRANCH.remote $1
git-config branch.$CURRENT_BRANCH.merge refs/heads/$CURRENT_BRANCH
}