Skip to content

Instantly share code, notes, and snippets.

@robinhouston
robinhouston / index.html
Last active August 29, 2015 14:03
Test case for Safari fullscreen bug
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cut-down fullscreen bug test</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
body { margin: 0; font-family: sans-serif; }
#main { position: absolute; margin: 12px; width: 600px; }
#canvas { position: relative; top: 20px; width: 400px; height: 200px; margin: auto; border: 1px solid #666; }
#canvas #ball { position: absolute; left: 0; top: 90px; width: 20px; height: 20px; border-radius: 10px;
@robinhouston
robinhouston / superpermutation.txt
Created August 19, 2014 18:20
A superpermutation on six symbols of length 872
12345612345162345126345123645132645136245136425136452136451234651234156234152634152364152346152341652341256341253641253461253416253412653412356412354612354162354126354123654132654312645316243516243156243165243162543162453164253146253142653142563142536142531645231465231456231452631452361452316453216453126435126431526431256432156423154623154263154236154231654231564213564215362415362145362154362153462135462134562134652134625134621536421563421653421635421634521634251634215643251643256143256413256431265432165432615342613542613452613425613426513426153246513246531246351246315246312546321546325146325416325461325463124563214563241563245163245613245631246532146532416532461532641532614532615432651436251436521435621435261435216435214635214365124361524361254361245361243561243651423561423516423514623514263514236514326541362541365241356241352641352461352416352413654213654123
#!/usr/bin/python
# -*- encoding: utf-8 -*-
from __future__ import division
from math import ceil
def triangles(n):
radius = 2 ** int(ceil(n / 2))
skip = 1 + (n % 2)
counts = {}
@robinhouston
robinhouston / index.html
Created February 9, 2015 15:29
Constant flux
<!DOCTYPE html>
<meta charset="utf-8">
<title>Flux</title>
<script src="http://bl.ocks.org/robinhouston/raw/6096562/rAF.js" charset="utf-8"></script>
<script src="streamer.js" charset="utf-8"></script>
<style>
html, body { margin: 0; }
canvas { background-color: #4C4C4C; margin: 8px; }
</style>
@robinhouston
robinhouston / 39dollars75.txt
Created April 27, 2015 11:21
All the ways to make $39.75 from coins of denominations 1¢, 5¢, 10¢, 25¢, and $1
((10, 1), (53, 5), (37, 100))
((5, 5), (74, 25), (21, 100))
((17, 5), (49, 10), (34, 100))
((20, 5), (55, 25), (25, 100))
((35, 5), (30, 10), (35, 100))
((35, 5), (36, 25), (29, 100))
((50, 5), (17, 25), (33, 100))
((53, 5), (11, 10), (36, 100))
((5, 1), (8, 5), (53, 10), (34, 100))
((5, 1), (14, 5), (56, 25), (25, 100))
@robinhouston
robinhouston / index.html
Last active December 28, 2015 23:18
Moiré patterns
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Moiré patterns</title>
<style>
html { overflow: hidden; }
html, body, canvas { height: 100%; margin: 0; }
</style>
@robinhouston
robinhouston / index.html
Created December 29, 2015 00:09
More Moiré
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Moiré patterns</title>
<style>
html { overflow: hidden; }
html, body, canvas { height: 100%; margin: 0; }
</style>
@robinhouston
robinhouston / index.html
Last active January 7, 2016 00:18
Cubes!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cubes!</title>
<style>
html { overflow: hidden; }
html, body, canvas { height: 100%; margin: 0; }
</style>
@robinhouston
robinhouston / index.html
Created January 7, 2016 14:56
Testing Safari’s strange treatment of declared global variables
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Test declared variable behaviour</title>
</head>
<body>
<div id="foo"></div>
<script>
var foo; // Declaring the variable should override the default assignment of the div to it?