Skip to content

Instantly share code, notes, and snippets.

View MatrixFrog's full-sized avatar

Tyler Breisacher MatrixFrog

View GitHub Profile
@MatrixFrog
MatrixFrog / countdown.js
Created September 18, 2011 19:37
Countdown clock for psychogate.com
$(function() {
function getCurrentTime() {
var now = new Date();
var nowInUTC = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
var nowInPacific = new Date(nowInUTC - 7*60*60*1000);
return nowInPacific;
}
function getNextStartTimeAfter(time) {
var startTimes = [
@MatrixFrog
MatrixFrog / BotTrust.hs
Created May 12, 2011 08:49
Haskell solution to Google Code Jam problem BotTrust
-- Haskell solution to Google Code Jam 2011 problem, Bot Trust
-- http://code.google.com/codejam/contest/dashboard?c=975485#s=p0
import Data.List (find)
import Data.Maybe (fromMaybe)
import System.Environment (getArgs)
data Robot = Blue | Orange
deriving Eq
import time
import sys
arg = sys.argv[1];
def testFun():
pass
if arg == 'class':
@MatrixFrog
MatrixFrog / quickToast.java
Created July 3, 2010 05:00
Eclipse template for showing a Toast
Eclipse template for showing a Toast. To use it, type ctrl+space, then "toast", then enter.
Or, select a String or string ID, type ctrl+space, then end, then enter.
Window > Preferences > Java > Editor > Templates
Name: Toast
Context: Java Statements
Description: Create and show a Toast (Android)
Pattern: Toast.makeText(this, ${word_selection}${}, Toast.LENGTH_SHORT).show();