Skip to content

Instantly share code, notes, and snippets.

View telic's full-sized avatar

Maxwell Terpstra telic

  • Victoria, BC, Canada
View GitHub Profile
h1, h2, h3, h4 { color: #3366ff; }
h2 { text-indent: .25em; }
h3 { text-indent: 1.5em; }
h2 small {
font-size: 75%;
font-weight: normal;
color: black;
display: inline;
margin-left: .5em;
}
@telic
telic / README.md
Last active July 16, 2023 19:57
Smoothed random number generator

Synopsis

An attempt at a "smoothed" random generator. Each consecutive generated number is constrained to be within an envelope near the previous number. The width of the envelope is controlled by the inverse of the smoothing factor; thus higher factors will produce output that varies less from number to number.

Usage

var r = SmoothRandom(2);
var d = [];
while (d.length < 100) {
@telic
telic / d3.js
Last active August 29, 2015 13:56
Use case for d3.svg.arc.negativeSweep()
!function() {
var d3 = {
version: "3.4.2"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};
@telic
telic / gist:9025836
Created February 15, 2014 22:09
Star Control 2 (Ur-Quan Masters) hyperspace starmap with constellations
[
{
"name":"Serpentis",
"stars":[
{ "xy":[4911, 180], "class":"giant", "color":"orange" },
{ "xy":[4861, 262], "class":"dwarf", "color":"white" },
{ "xy":[4923, 294], "class":"dwarf", "color":"yellow" },
{ "xy":[4747, 221], "class":"dwarf", "color":"orange" },
{ "xy":[4872, 408], "class":"dwarf", "color":"red" },
{ "xy":[5007, 35], "class":"dwarf", "color":"green" },
@telic
telic / dabblet.css
Created February 24, 2012 02:17
Lined Paper
/**
* Lined Paper
*/
html {
background-color:white;
padding:10px;
font-family:sans-serif; font-size:15px;
}
body {