Skip to content

Instantly share code, notes, and snippets.

View ddnn55's full-sized avatar

David Stolarsky ddnn55

View GitHub Profile
@ddnn55
ddnn55 / gist:2222963
Created March 28, 2012 02:23
Example generated C++
// example generated C++
class GraphicsApp
{
int bufferID;
void init()
{
float buffer[] = {1., 2., 3., 4.};
// example generated JavaScript
var buffer;
function init(gl)
{
var myData = new DavidsFloatData([1., 2., 3., 4.]);
buffer = gl.createBuffer(); // corresponding C function is glGenBuffers(GLsizei n, GLuint *buffers)
gl.bindBuffer(GL_ARRAY_BUFFER, buffer);
@ddnn55
ddnn55 / README.md
Created December 3, 2012 18:55 — forked from mbostock/.block
state flags
@ddnn55
ddnn55 / index.html
Created December 5, 2012 21:14
geo, anchored, collision layout
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="http://d3js.org/d3.v2.min.js"></script>
<link type="text/css" rel="stylesheet" href="style.css"/>
<style type="text/css">
circle {
stroke: #000;
@ddnn55
ddnn55 / index.html
Created December 7, 2012 19:23 — forked from jlong/uri.js
gist/bl.ocks Toggle Bookmarklet
<html>
<body>
<h1><a href="javascript:window.location=(window.location.hostname.indexOf('gist')>-1?'http://bl.ocks.org':'http://gist.github.com')+window.location.pathname;">gist/bl.ocks Toggle Bookmarklet</a></h1>
</body>
</html>

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

@ddnn55
ddnn55 / README.md
Last active December 18, 2015 01:58 — forked from mbostock/.block

2012 Mango Movement by Origin

(defn debounce [func wait immediate]
(let [timeout (atom nil)]
(fn []
(this-as this
(let [context this
args js/arguments
later (fn []
(reset! timeout nil)
(when-not immediate
(.apply func context args)))]
@ddnn55
ddnn55 / gist:9925775
Last active August 29, 2015 13:57 — forked from idan/gist:3135754

[+d3](javascript:(function()%7Bfunction callback()%7Bfunction noop() %7B%7D%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"http%3A%2F%2Fd3js.org%2Fd3.v3.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)())

IMG_0874

Fun with vector maps

Quick TopoJSON vector tile demo map, derived from an earlier GeoJSON demo. Original README follows.

A goofy slippy map of various vector tile data sources. With some fun colours, greetz to Aaron and Mike and Mike and the whole Prettymaps crew.

Sacramento, CA