This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function argList(args) { | |
return Array.prototype.slice.call(args); | |
} | |
function reduce0(fn, l, init) { | |
for(var i = 0; i < l.length; i++) { | |
init = fn(init, l[i]); | |
} | |
return init; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.segfaultax; | |
public interface Function<Param, Result> { | |
public Result apply(Param in); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright (c) 2014 Michael-Keith Bernard | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is furnished to do so, | |
# subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var H_PADDING = 10; | |
var V_PADDING = 10; | |
var ROWS = 20, COLUMNS = 20; | |
function app(processing) { | |
var midX, midY, colWidth, rowHeight; | |
var colors = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function empty() { | |
return function() { | |
return false; | |
}; | |
} | |
function singleton(e0) { | |
return function(e) { | |
return e0 === e; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var H_PADDING = 10; | |
var V_PADDING = 10; | |
var ROWS = 20, | |
COLUMNS = 20; | |
var KEYCODES = { | |
37: "left", | |
38: "up", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.COMETBackend.prototype.stopLookingForCommonLikes = function(){}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import yaml | |
import json | |
def convert(data): | |
y = yaml.load(data) | |
return json.dumps(y, | |
indent=4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
from pprint import pprint | |
def is_dict(d): | |
return isinstance(d, dict) | |
def get(c, k, default=None): | |
try: | |
return c[k] | |
except (IndexError, KeyError, TypeError): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decimal import Decimal | |
def _wrap_converter(fn): | |
def _wrapper(elem): | |
try: | |
return fn(elem) | |
except Exception as e: | |
msg = "Failed to convert value {0}: {1}".format( | |
elem, e) | |
raise ValueError(msg) |