Skip to content

Instantly share code, notes, and snippets.

@mpmckenna8
mpmckenna8 / index.html
Created May 17, 2017 18:56
hacky solution for friends' problem
<!DOCTYPE html >
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
.node circle {
fill: #999;
}
.node text {
@mpmckenna8
mpmckenna8 / index.html
Last active April 20, 2023 06:14
Poisson disc distribution image sample of a tacocat
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.js"></script>
</head>
<body>
<div id="heap">
</div>
<script src="main.js"></script>
@mpmckenna8
mpmckenna8 / .block
Created April 25, 2017 03:26 — forked from mbostock/.block
General Update Pattern, I
license: gpl-3.0
// This will make a heap node by node in a nice animation type thing.
var arr = [ 1, 4, 6, 12, 23, 29, 89, 21, 30, 21, 40, 292]
var duration = 1000
var margin = {top: 20, right: 90, bottom: 30, left: 90},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
@mpmckenna8
mpmckenna8 / heaper.js
Last active April 11, 2017 19:56
animation of balancing a heap into a max-heap
var numbs = [ 1, 4, 7, 8, 2, 3, 1, 23, 21, 11, 67, 92, 29, 232, 9, 23, 87, 29, 8, 8, 6, 200]
var swapDelay = 1500;
var textTransDuration = 1500;
var margin = {top: 20, right: 90, bottom: 30, left: 90},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
@mpmckenna8
mpmckenna8 / heaper.js
Created April 4, 2017 23:37
Vertical Tree diagram with v4 and collapsing and expanding
var numbs = [ 4, 7, 8, 2, 3, 1, 23 ]
var margin = {top: 20, right: 90, bottom: 30, left: 90},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var i = 0,
duration = 750,
root;
@mpmckenna8
mpmckenna8 / index.html
Created April 1, 2017 23:00
Topojson on a leaflet map
<html>
<head>
<link rel="stylesheet" href="./style.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script src="https://d3js.org/d3.v4.js"></script>
<script src="https://unpkg.com/topojson-client@3"></script>
</head>
<body>
@mpmckenna8
mpmckenna8 / .block
Created March 31, 2017 06:44 — forked from mbostock/.block
Three-Axis Rotation
license: gpl-3.0
@mpmckenna8
mpmckenna8 / .block
Created March 31, 2017 06:44 — forked from mbostock/.block
Three-Axis Rotation
license: gpl-3.0
@mpmckenna8
mpmckenna8 / batteryfake.scad
Last active March 25, 2017 21:06
Battery hack
// Thing to go into the battery part of a camera
railbuffer = 5;
wi = 34.8;
he = 40.56;
th = 5.7;
diam = 1.7;
spacing = 3;