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
gka / db-setup.sql
Created Feb 13, 2013
load geoip database into mysql
View db-setup.sql
DROP TABLE IF EXISTS location;
CREATE TABLE IF NOT EXISTS `location` (
`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
gka / index.html
Last active Dec 10, 2019
Parliament seating diagrams
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
path { stroke: red; fill: none; stroke-width:2; opacity: 0.4}
</style>
</head>
@gka
gka / _readme.md
Created Jan 24, 2013
PHP Endpoint for Github Webhook URLs
View _readme.md

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 http://example.com/github.php
@gka
gka / make-animated-gifs-using-ffmpeg.md
Last active Nov 12, 2019
how to make a nice GIF from png frames
View make-animated-gifs-using-ffmpeg.md

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
gka / presenter.html
Created Dec 13, 2012
Simplified version of flickrperson app. See https://github.com/PyBossa/pybossa.js/issues/8 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>
<script>
@gka
gka / .block
Last active Sep 13, 2019
summer-heat
View .block
license: mit
@gka
gka / index.html
Last active Sep 11, 2019
simple tables in D3
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Simple tables in D3</title>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="https://rawgit.com/gka/d3-jetpack/master/d3-jetpack.js"></script>
<style type="text/css">
body { font-family: 'Helvetica Neue', Helvetica; font-weight: 300; padding: 20px;}
th { text-align: left; }
@gka
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
// script.name = 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
clipScan()
@gka
gka / import_eurostat_tsv.py
Created Apr 23, 2013
Importer for Eurostat TSV files
View import_eurostat_tsv.py
#!/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
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.