Skip to content
View canvas-skeleton.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>canvas</title>
<style>
canvas {
border: 1px solid black;
}
</style>
View Notable hypercard stacks
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)
View Gruntfile.js
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=[];
View rgbdiff.js
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);
View RLE.js
function RLEencode (array) {
var newArray=[];
var lastval=undefined;
var count=1;
var i;
for(i=0;i<=array.length;i++){
if(array[i]===lastval){
count++
} else {
if(i !== 0){
View wuline.js
// integer part of x
function ipart(x) {
return Math.floor(x);
}
function round(x) {
return Math.round(x);
}
// fractional part of x
View mustachec
#!/usr/bin/env php
<?php
// Command line utility to compile MUSTACHE to STDOUT
// I bastardised this based on lessc by:
// Leaf Corcoran <leafot@gmail.com>, 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)
View hairlip.js
// 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
View twixel.js
(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) {
View glob.js
//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',
Something went wrong with that request. Please try again.