Skip to content

Instantly share code, notes, and snippets.

View telic's full-sized avatar

Maxwell Terpstra telic

  • Victoria, BC, Canada
View GitHub Profile
@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 {
@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 / 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 / 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) {
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;
}
@charset "utf-8";
hgroup {
background: linear-gradient(to bottom, black, black 24pt, rgba(0,0,0,.5));
color: white;
font-variant: small-caps;
font-weight: bold;
border-radius: 0 6px;
overflow: hidden;
padding: 0 10px;
@telic
telic / lab.css
Last active August 29, 2015 14:07
COMP 152 - Lab 6 CSS
/* basic structure */
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 / example.css
Created October 3, 2014 19:34
example CSS file for COMP 152 Lab 6
html {
background-color: #ddd;
padding: 0;
margin: 0;
}
body {
margin: 50px 200px;
padding: 0 3em 3em;
background-color: white;
border: 1px solid black;
@telic
telic / example.html
Last active August 29, 2015 14:14
Example HTML for COMP152 lab 5
<!DOCTYPE html>
<html>
<head>
<title>Lab 4</title>
</head>
<body>
<header>
<h1>Lab 4: HTML</h1>
David Bell-Brown<br/>Lab section: thebest
<nav>
@telic
telic / GameOfLife.js
Last active August 29, 2015 14:17
lab8
/* d3 (d3js.org) */
!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}f