Skip to content

Instantly share code, notes, and snippets.

View gka's full-sized avatar
🐢

Gregor Aisch gka

🐢
View GitHub Profile
@gka
gka / .block
Last active September 1, 2017 16:24
half circles for kevin
license: mit
define(function(require) {
var d3 = require('./d3v4+jetpack');
return function swoopy(svg, x0, y0, x1, y1, flipped, r) {
var dx = x1 - x0, dy = y1 - y0;
if (r === undefined) r = Math.sqrt(dx*dx + dy*dy) * 0.75;
var g_arr = svg.append('g.arrow');
var svg_root = d3.select(svg.node().ownerSVGElement || svg.node()),
@gka
gka / .block
Created June 21, 2017 12:33
poll jitter bar
license: mit
#!/bin/bash
cd $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
blue=$(tput setaf 4)
green=$(tput setaf 2)
normal=$(tput sgr0)
while ./update.sh
do
printf "\n${blue}>>> sleeping a little bit before running again... ${normal}\n"
@gka
gka / d3.forceExtent.js
Last active March 10, 2017 16:27
forces particles in a d3.forceSimulation into a [[x1, x2], [y1, y2]] extent
d3.forceExtent = function(extent) {
var nodes;
if (extent == null) extent=[[0,800], [0,500]];
function force() {
var i,
n = nodes.length,
node,
r = 0;
@gka
gka / colorizer.json
Last active April 8, 2022 09:44
us states
[{
"file": "results",
"data": {
"AL": {
"fill": "#cc3d3d",
"stroke": false
},
"AK": {
"fill": "#cc3d3d",
"stroke": false
@gka
gka / .block
Last active February 24, 2017 01:03
fresh block
license: mit
@gka
gka / .block
Last active February 9, 2017 21:59
morie-pentagon
license: mit
@gka
gka / d3.js
Last active January 4, 2017 20:08
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {})));
}(this, function (exports) { 'use strict';
function ascending(a, b) {
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
}
PROJCS["satellite",
GEOGCS["satellite"],
PROJECTION["satellite"],
EXTENSION["PROJ4","+proj=tpers +azi=19 +tilt=30 +lon_0=-109.5 +lat_0=23 +h=1274199.4 + ellps=WGS84 +datum=WGS84 +units=m"]]