Skip to content

Instantly share code, notes, and snippets.

View hollasch's full-sized avatar

Steve Hollasch hollasch

View GitHub Profile
@hollasch
hollasch / .block
Last active August 6, 2017 22:49
Smooth Hull 2
height: 960
@hollasch
hollasch / stochastic-urn.html
Last active April 3, 2017 05:56
The Stochastic Urn, due to Eggenberger and Polya, 1923
<!DOCTYPE html>
<title>The Stochastic Urn</title>
<style>
body { margin: 5% 8% 0 8%; }
p { max-width: 32em; }
table#output {
border: solid 2px black;
@hollasch
hollasch / .block
Last active September 5, 2023 16:03
Smooth Polygon Convex Hull
height: 960
@hollasch
hollasch / .block
Last active April 19, 2017 08:19
Rounded Enclosing Hull
height: 960
@hollasch
hollasch / README.md
Last active August 12, 2016 23:59 — forked from patricksurry/README.md
World Map with Zoom and Continuous Horizontal Pan

This gist illustrates a world map with zoom and continuous (infinite) horizontal panning. Dragging left/right rotates the projection cylinder, and dragging up/down translates the projection accordingly (clamped by latitude bounds).

The viewbox is the full width of the page.

This example still has an annoying issue with zooms. In my ideal world, the map should zoom centered on the cursor location. Unfortunately, the map just changes scale centered on the equator and the longitude at the center of the viewport. I haven't yet been able to find a way to make this work

@hollasch
hollasch / index.html
Last active August 29, 2015 14:10
DOM Pick Handling
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Mouse Clicks Handling Example</title>
<style type="text/css">
body {
margin: 1em 0 0 10%;
@hollasch
hollasch / index.html
Last active August 29, 2015 14:10
Right-Click Event Handling in HTML
<!DOCTYPE html> <html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Context Menu Handling Example</title>
<style type="text/css">
p { font-family: sans-serif; }
div.text {
margin: 1em auto;
max-width: 40em;
@hollasch
hollasch / DuffsDevice.c
Created April 1, 2014 23:35
Runnable form of Duff's Device, written for clarity.
#include <stdio.h>
void send (int count)
{
int n = (count+7) / 8;
switch (count % 8) {
do {
case 0: printf("%d.8\n", n);
case 7: printf("%d.7\n", n);