Skip to content

Instantly share code, notes, and snippets.

View MatrixFrog's full-sized avatar

Tyler Breisacher MatrixFrog

View GitHub Profile
@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();
import time
import sys
arg = sys.argv[1];
def testFun():
pass
if arg == 'class':
@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
@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 / Words.hs
Created October 20, 2011 15:39
Solution to Programming Praxis "Word Breaks" problem
{- http://programmingpraxis.com/2011/08/12/word-breaks/
Given an input string and a dictionary of words,
segment the input string into a space-separated
sequence of dictionary words if possible. For
example, if the input string is "applepie" and
dictionary contains a standard set of English words,
then we would return the string "apple pie" as output.
-}
@MatrixFrog
MatrixFrog / gist:1712265
Created January 31, 2012 19:11
JavaScript error counts
chrome/browser/printing/cloud_print/resources/cloud_print_setup_done.js 1
chrome/browser/printing/cloud_print/resources/cloud_print_setup_flow.js 2
chrome/browser/printing/cloud_print/resources/cloud_print_setup_login.js 2
chrome/browser/resources/about_conflicts.js 3
chrome/browser/resources/about_credits.js 8
chrome/browser/resources/about_flash.js 3
chrome/browser/resources/about_memory.js 3
chrome/browser/resources/about_page/about_page.js 4
chrome/browser/resources/about_stats.js 27
chrome/browser/resources/about_version.js 1
@MatrixFrog
MatrixFrog / DOMBuilder.htm
Created February 18, 2012 07:01
DOM Builder
<script src="DOMBuilder.js"></script>
<script>
domBuilder(
[/HTML/],
[/HEAD/],
[/TITLE/],
"Wouldn't this be cool?",
[],
[],
@MatrixFrog
MatrixFrog / select.htm
Created March 11, 2012 09:39
select event behavior
<select id="s">
<option value="a">a</option>
<option value="b">b</option>
</select>
<script>
var s = document.getElementById('s');
s.onclick = function() {
console.log('click');
}
@MatrixFrog
MatrixFrog / this.js
Created May 7, 2012 18:08
Weirdness with @this
/**
* @constructor
*/
function SomeConstructor() {
}
SomeConstructor.prototype = {
/**
* This one triggers the error.
~/.wine/drive_c/Program Files (x86)/Steam/steamapps/common/Adventures Of Shuggy$ ./Shuggy.exe
fixme:advapi:EventRegister {47a9201e-73b0-42ce-9821-7e134361bc6f}, 0x3f005160, 0x3f036b20, 0x3f036b18
fixme:advapi:EventRegister {58a9201e-73b0-42ce-9821-7e134361bc70}, 0x3f005160, 0x3f036b58, 0x3f036b50
fixme:advapi:EventRegister {3fa9201e-73b0-43fe-9821-7e145359bc6f}, 0x3f005160, 0x3f036ae8, 0x3f036ae0
fixme:advapi:EventRegister {1432afee-73b0-42ce-9821-7e134361b433}, 0x3f005160, 0x3f036b90, 0x3f036b88
fixme:advapi:EventRegister {4372afee-73b0-42ce-9821-7e134361b519}, 0x3f005160, 0x3f036bc8, 0x3f036bc0
p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory
Setting breakpad minidump AppID = 211440
Steam_SetMinidumpSteamID: Caching Steam ID: 76561198018465831 [API loaded no]