Skip to content

Instantly share code, notes, and snippets.

View gdiggs's full-sized avatar

Gordon Diggs gdiggs

View GitHub Profile
@gdiggs
gdiggs / chocolate_chili_stout.md
Last active September 24, 2015 23:48
Chocolate Chili Stout

Shot in the Dark - Chocolate Chili Stout

By Gordon Diggs

Adapted from a recipe by Mark Sullivan, Chesapeake Real Ale Brewers (CRAB) from "More Homebrew Favorites", by Lutzen & Stevens.

Ingredients

  • 0.75 pounds Crystal 90L malt
  • 0.5 pounds Roasted barley
@gdiggs
gdiggs / top10.c
Created March 19, 2011 20:50
Find top 10 numbers in an array
#include <stdio.h>
#define TOP_NUM 10
// return whether or not an item is in an array
int inArray(int num, int nums[], int nums_size){
int i;
for(i=0; i<nums_size; i++)
if(num == nums[i])
@gdiggs
gdiggs / goruco_2011_notes.md
Created June 5, 2011 13:43
GoRuCo2011 Notes

GoRuCo 2011 | Gordon Diggs

Ryan Smith (@ryandotsmith)

  • Gene Amdahl's Law
  • How to improve concurrency
    • Removing FIFO
      • FIFO isn't really needed a lot of the time in a queue of jobs
        • can ditch FIFO if order of jobs doesn't matter
        • if order matters, have a job fire things that depend on it at completion
  • fuzzy-FIFO
@gdiggs
gdiggs / gist:1010604
Created June 6, 2011 16:39
homebrew install
ruby -e "$(curl -fsSL https://raw.github.com/gist/323731/39fc1416e34b9f6db201b4a026181f4ceb7cfa74)"
@gdiggs
gdiggs / gist:1028275
Created June 15, 2011 22:17
top down shit
$('form').live('submit', submitForm(e, $(this)) );
var submitForm = function(e, $form) {
e.preventDefault();
// make sure we want to do shit
doShit();
// stuff we do after doing shit
@gdiggs
gdiggs / update_branch_with_root.sh
Created July 13, 2011 14:45
Update current git branch with root
#!/bin/bash
# Update your tracked branch with the remote copy without adding a merge commit.
parse_git_branch(){ git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /'; }
branch=`parse_git_branch`
git remote update root
git rebase root/$branch
@gdiggs
gdiggs / current_track.scpt
Created July 28, 2011 20:16
Get current track and link in Spotify
tell application "Spotify"
set track_name to name of current track
set track_artist to artist of current track
set track_album to album of current track
set track_id to id of current track
end tell
set AppleScript's text item delimiters to ":"
set track_id to third text item of track_id
set AppleScript's text item delimiters to {""}
@gdiggs
gdiggs / ecco.sh
Created July 30, 2011 04:26
Ecco the dolphin!
#!/bin/bash
if [ -z "$1" ]
then
message="eeee eeee!"
else
message="$1"
fi
@gdiggs
gdiggs / gist:1243043
Created September 26, 2011 18:57
sick playlist
Name Artist Album Track Number
Downstairs Religious Knives The Door 1
Basement Watch Religious Knives The Door 2
On a Drive Religious Knives The Door 3
The Storm Religious Knives The Door 4
Major Score Religious Knives The Door 5
Decisions Are Made Religious Knives The Door 6
Cirrus Minor Pink Floyd More 1
The Nile Song Pink Floyd More 2
Crying Song Pink Floyd More 3
@gdiggs
gdiggs / array_move.rb
Created January 6, 2012 19:46
Adding/moving item to the front of an array
x = 1
a = [2, 1, 4, 3]
[x] + (a - [x]) #=> [1, 2, 4, 3]