Skip to content

Instantly share code, notes, and snippets.

View miniharryc's full-sized avatar

Harold Combs miniharryc

View GitHub Profile
@miniharryc
miniharryc / quiz.c
Created December 18, 2014 14:55
Seth's Pop Quiz
#include <stdio.h>
int main (int argc, char** argv) {
int i = 5;
int j = 10;
while (--j) { printf("%d %d\n", i, j); } while (--i);
}
@miniharryc
miniharryc / keybase.md
Created September 27, 2014 03:13
keybase.md

Keybase proof

I hereby claim:

  • I am miniharryc on github.
  • I am harryc (https://keybase.io/harryc) on keybase.
  • I have a public key whose fingerprint is 6B71 37DA 9CA5 5FC0 72BF 6C10 52AC C3A1 7A0A B76B

To claim this, I am signing this object:

@miniharryc
miniharryc / gist:10489099
Created April 11, 2014 18:12
Show the math
require 'date'
birthdays_thus_far = 35
today = Date::today
birthday = Date.new(1978,11,9)
#to get 'unbirthdays', figure out total days then subtract all 'birthdays
# thus far
unbirthdays = (today - birthday - birthdays_thus_far).to_i
@miniharryc
miniharryc / gist:6143436
Created August 2, 2013 21:02
Go function for switching on which algorithm to use to compare equivalent hands
/**
* Rank equivalent hands based upon appropriate
* algorithms
*/
func rankEquivalentHands( h1, h2 *Hand ) *Hand {
switch h1.rank {
case STRAIGHT_FLUSH, STRAIGHT, HIGH_CARD, FLUSH: return rankHighCard(h1,h2)
case FOUR_OF_A_KIND: return rankFourOfAKind(h1,h2)
case FULL_HOUSE: return rankFullHouse(h1,h2)
case THREE_OF_A_KIND: return rankThreeOfAKind(h1,h2)
@miniharryc
miniharryc / gist:1481889
Created December 15, 2011 17:07
Yucky Java5 Syntax
Map<String,String> m = new HashMap<String,String>();