Skip to content

Instantly share code, notes, and snippets.


Gregor Aisch gka

Block or report user

Report or block gka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gka / db-setup.sql
Created Feb 13, 2013
load geoip database into mysql
View db-setup.sql
`locId` int(11) unsigned NOT NULL AUTO_INCREMENT,
`country` varchar(2) DEFAULT NULL,
`region` varchar(2) DEFAULT NULL,
`city` varchar(1000) DEFAULT NULL,
`postalCode` varchar(10) DEFAULT NULL,
`latitude` float DEFAULT NULL,
`longitude` float DEFAULT NULL,
gka / index.html
Last active Dec 10, 2019
Parliament seating diagrams
View index.html
<!DOCTYPE html>
<script src=""></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
path { stroke: red; fill: none; stroke-width:2; opacity: 0.4}
gka /
Created Jan 24, 2013
PHP Endpoint for Github Webhook URLs

PHP Endpoint for Github Webhook URLs

If you love deploying websites using Github, but for some reason want to use your own server, this script might be exactly what you need.

  1. Put github.php somewhere on your PHP-enabled web server, and make it accessible for the outside world. Let's say for now the script lives on
gka /
Last active Nov 12, 2019
how to make a nice GIF from png frames

Make sure ffmpeg is up-to-date:

brew update
brew upgrade ffmpeg

Convert a MOV into frames. Tweak the 2/1 if you want more or fewer frames.

gka / presenter.html
Created Dec 13, 2012
Simplified version of flickrperson app. See for more information.
View presenter.html
<h2>Do you see a human in this photo?</h2>
<div class="img-container"></div>
<button class="btn btn-large btn-success">Yes</button>
<button class="btn btn-large btn-danger">No</button>
<button class="btn btn-large btn-maybe">I don't know</button>
gka / .block
Last active Sep 13, 2019
View .block
license: mit
gka / index.html
Last active Sep 11, 2019
simple tables in D3
View index.html
<!DOCTYPE html>
<title>Simple tables in D3</title>
<meta charset="utf-8">
<script src=""></script>
<script src=""></script>
<style type="text/css">
body { font-family: 'Helvetica Neue', Helvetica; font-weight: 300; padding: 20px;}
th { text-align: left; }
gka / clean_pdf_import.jsx
Last active Sep 3, 2019
Clean PDF import. Removes all clipping masks and ungroups everything..
View clean_pdf_import.jsx
#target Illustrator
// = RemoveClippingMasks.jsx
// script.description = deletes all PageItems being used as clipping masks.
// script.parent = Kenneth Webb // 01/07/2013
// script.elegant = true?
var docRef = app.activeDocument;
var clippingCount = 0
gka /
Created Apr 23, 2013
Importer for Eurostat TSV files
#!/usr/bin/env python
import sys
from os.path import basename, splitext, dirname
from os import rename
from glob import glob
import csv
import dataset
def get_float(s):
gka / textWidth.js
Created Nov 14, 2013
Approximate text width based on estimated character widths...
View textWidth.js
var textWidth = (function() {
function charW(w, c) {
if (c == 'W' || c == 'M') w += 15;
else if (c == 'w' || c == 'm') w += 12;
else if (c == 'I' || c == 'i' || c == 'l' || c == 't' || c == 'f') w += 4;
else if (c == 'r') w += 8;
else if (c == c.toUpperCase()) w += 12;
else w += 10;
return w;
You can’t perform that action at this time.