This file contains 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
define("trigrams", ["underscore"], function(U) { | |
var trigramIndex = {}; | |
var ngramcount = { | |
sort () { | |
var keys = U.keys(this.table), | |
g = this.table, | |
sorted; | |
keys = U.filter(keys, function (o) { | |
return typeof g[o] !== 'string'; | |
}); |
This file contains 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
//based on fnmatch.py | |
String.prototype.escape = function () { | |
"use strict"; | |
var escapable = /[.\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, | |
meta = { // table of character substitutions | |
'\b': '\\b', | |
'\t': '\\t', | |
'\n': '\\n', |
This file contains 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 () { | |
var base64URLAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; | |
var baseRevMap = {}; | |
var IDCounter = 0; | |
var pixelratio=1; //let's deal with the retina display bugs. | |
function ID (){ | |
return IDCounter++; | |
} | |
base64URLAlphabet.split("").forEach(function (o, i) { |
This file contains 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
// Hairlip is | |
// a very tiny version of mustache that only does variable replacement | |
// and nothing else. | |
String.prototype.hairlip = function (o) { | |
"use strict"; | |
return this.replace(/\{\{([a-zA-Z0-9_\-]*)\}\}/g, function (a, b) { | |
/*jslint unparam:true*/ | |
return { | |
string: true, | |
number: true |
This file contains 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 php | |
<?php | |
// Command line utility to compile MUSTACHE to STDOUT | |
// I bastardised this based on lessc by: | |
// Leaf Corcoran <[email protected]>, 2012 | |
// which is licensed by MIT/GPL according to his website. | |
// Additionally, this requires mustache.php to be in the same directory | |
// Mustache.php can be "compiled" to be in a single file | |
// following these instructions https://twitter.com/bobthecow/status/319159329578180609 | |
// (quoted below) |
This file contains 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
// integer part of x | |
function ipart(x) { | |
return Math.floor(x); | |
} | |
function round(x) { | |
return Math.round(x); | |
} | |
// fractional part of x |
This file contains 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 RLEencode(array) { | |
// output an array of values | |
// consisting of alternating "rips" and "runs" | |
// a rip begins with a negative count followed by a | |
// cooresponding number of non-repeating values | |
// | |
// a run begins with a positive count, followed by | |
// the value to be repeated by the count. | |
var newArray=[]; |
This file contains 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
define("rgbdiff", [], function () { | |
function rgbdiff(a, b) { | |
// Convert RGB to XYZ | |
function rgbToXyz(tuple) { | |
var _r = (tuple[0] / 255); | |
var _g = (tuple[1] / 255); | |
var _b = (tuple[2] / 255); | |
if (_r > 0.04045) { | |
_r = Math.pow(((_r + 0.055) / 1.055), 2.4); |
This file contains 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
module.exports = function (grunt) { | |
function to_entries (object,prefix){ | |
// convert object to array of key/value objects, emulating jq. | |
// for working around mustache limitation | |
// for heirarchical objects, flatten | |
// into key.subkey/value form, until a string, number or boolean is encountered | |
// this is super convenient for rendering json to shtml variables | |
var a=[]; |
This file contains 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
hypercard stacks | |
electronic whole earth catalog | |
manhole | |
Time Table of History | |
myst | |
Cosmic Osmo and the Worlds Beyond the Mackerel | |
Spelunx | |
The Computer Lab's Beyond Cyberpunk (http://www.streettech.com/bcp/BCPgraf/4zones.html) | |
OlderNewer