Skip to content

Instantly share code, notes, and snippets.

Gordon Diggs gdiggs

Block or report user

Report or block gdiggs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Contacts Gem AOL Fix
# lines 11-14 of aol.rb from contacts gem
AOL_NUM = "32319-211" # this seems to change each time they change the protocol
CONTACT_LIST_URL = "{AOL_NUM}/aol-6/en-us/Lite/ContactList.aspx?folder=Inbox&showUserFolders=False"
CONTACT_LIST_CSV_URL = "{AOL_NUM}/aol-6/en-us/Lite/ABExport.aspx?command=all"
View Assassins
# Assassin - Random and fair pairing for a game of assassin of any size (defaults to 10)
# Takes number of players from args
num_players = ARGV[0].to_i == 0 ? 10 : ARGV[0].to_i
killers = (0..num_players-1).to_a
targets = killers.shuffle
puts "killers: #{killers.inspect}"
View gist:703920
PGError: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. : SELECT id FROM address_books LIMIT 1
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract_adapter.rb:221:in `log'
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.8/lib/active_record/connection_adapters/postgresql_adapter.rb:520:in `execute'
/home/gordon/paperless/paperlesspost/paperless-post/app/jobs/address_book_importer.rb:8:in `perform'
/home/gordon/.rvm/gems/ruby-1.8.7-p302/bundler/gems/resque-status-0ad44dfe6987/lib/resque/job_with_status.rb:110:in `safe_perform!'
/home/gordon/.rvm/gems/ruby-1.8.7-p302/bundler/gems/resque-status-0ad44dfe6987/lib/resque/job_with_status.rb:87:in `perform'
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/resque-1.10.0/lib/resque/job.rb:133:in `perform'
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/resque-1.10.0/lib/resque/worker.rb:157:in `perform'
gdiggs /
Last active Sep 24, 2015
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.


  • 0.75 pounds Crystal 90L malt
  • 0.5 pounds Roasted barley
gdiggs / top10.c
Created Mar 19, 2011
Find top 10 numbers in an array
View top10.c
#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])

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 / gist:1010604
Created Jun 6, 2011
homebrew install
View gist:1010604
ruby -e "$(curl -fsSL"
gdiggs / comments.haml
Created Jun 10, 2011
multi-line haml comments
View comments.haml
-# This comment can be
split up in multiple lines just
by indentation!
View gist:1028275
$('form').live('submit', submitForm(e, $(this)) );
var submitForm = function(e, $form) {
// make sure we want to do shit
// stuff we do after doing shit
gdiggs /
Created Jul 13, 2011
Update current git branch with root
# 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 /'; }
git remote update root
git rebase root/$branch
You can’t perform that action at this time.