Skip to content

Instantly share code, notes, and snippets.

View andrewfhart's full-sized avatar

Andrew Hart andrewfhart

View GitHub Profile

Keybase proof

I hereby claim:

  • I am andrewfhart on github.
  • I am andrewfhart (https://keybase.io/andrewfhart) on keybase.
  • I have a public key ASAtWf8MfyTHeOSd2tzCpSh5r9XRCeHQc4tureaUk-EY0Qo

To claim this, I am signing this object:

@andrewfhart
andrewfhart / async-server.py
Created September 15, 2016 23:42
Simple tornado server demonstrating async request
import tornado.ioloop
import tornado.web
import tornado.httpclient
from tornado import gen
'''
Simple tornado server that requests events from https://api.seatgeek.com/events
All requests are asynchronous
@andrewfhart
andrewfhart / gist:72f0e0ce0c54b76d0bf4
Created February 12, 2016 18:59
Basic Balance application installation with Profile module
# The following instructions outline the process for getting
# Apache OODT Balance up and running on a new machine,
# including installing the "profile" module.
#
# Full docs / source @ https://github.com/apache/oodt/tree/master/balance/etc/skel
#
#
# Get required PEAR classes installed on your system
(sudo) pear channel-discover pear.apache.org/oodt
(sudo) pear remote-list -c oodt
@andrewfhart
andrewfhart / ttt_8.cpp
Created November 26, 2015 02:55
Tic-tac-toe Tutorial (Step 8)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/**
* Enumerate the possible players in the game. Each is given
* a unique prime integer so that the math involved with determining
* available winning moves on the board is made easier.
*
@andrewfhart
andrewfhart / ttt_7.cpp
Created November 16, 2015 17:41
Tic-tac-toe Tutorial (Step 7)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/**
* Enumerate possible states the game can be in. The game is either
* 0 IN_PROGRESS - neither player has won, and there are still valid moves
* 1 USER_WON - user won by matching three in a row
* 2 COMPUTER_WON - computer won by matching three in a row
@andrewfhart
andrewfhart / ttt_6.cpp
Created November 16, 2015 06:46
Tic-tac-toe Tutorial (Step 6)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/**
* Draw a 3x3 tic-tac-toe board with row and column labels
* The cell data in board will be interpreted as follows:
* 1 = owned by 'x'
* 2 = owned by 'o'
@andrewfhart
andrewfhart / ttt_5.cpp
Created November 16, 2015 06:10
Tic-tac-toe Tutorial (Step 5)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/**
* Draw a 3x3 tic-tac-toe board with row and column labels
* The cell data in board will be interpreted as follows:
* 1 = owned by 'x'
* 2 = owned by 'o'
@andrewfhart
andrewfhart / ttt_4.cpp
Created November 16, 2015 05:55
Tic-tac-toe Tutorial (Step 4)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/**
* Draw a 3x3 tic-tac-toe board with row and column labels
* The cell data in board will be interpreted as follows:
* 1 = owned by 'x'
* 2 = owned by 'o'
@andrewfhart
andrewfhart / ttt_3.cpp
Created November 16, 2015 05:10
Tic-tac-toe Tutorial (Step 3)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/**
* Draw a 3x3 tic-tac-toe board with row and column labels
* The cell data in board will be interpreted as follows:
* 1 = owned by 'x'
* 2 = owned by 'o'
@andrewfhart
andrewfhart / ttt_2.cpp
Last active November 16, 2015 05:09
Tic-tac-toe Tutorial (Step 2)
#include <iostream>
using namespace std;
/**
* Draw a 3x3 tic-tac-toe board with row and column labels
* The cell data in board will be interpreted as follows:
* 1 = owned by 'x'
* 2 = owned by 'o'
* all other values = empty
*