Skip to content

Instantly share code, notes, and snippets.

View gka's full-sized avatar
🐢

Gregor Aisch gka

🐢
View GitHub Profile
@gka
gka / kartograph.txt
Created October 18, 2012 09:01
Kartograph installation guide Linux
# prereqs
sudo apt-get install python-setuptools build-essential libxml2-dev libxslt1-dev python-dev libyaml-dev libgeos-dev
sudo easy_install pip virtualenv virtualenvwrapper
mkdir ~/src
# setup virtualenvwrapper
echo "\nsource /usr/local/bin/virtualenvwrapper_lazy.sh" >>~/.bashrc
source /usr/local/bin/virtualenvwrapper_lazy.sh
# install gdal
@gka
gka / braun2.html
Created October 31, 2012 10:13
zon workshop map
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="js/jquery.min.js"></script>
<script src="js/raphael.min.js"></script>
<script src="js/kartograph.min.js"></script>
<script src="js/jquery.qtip.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.qtip.css">
<script type="text/javascript">
graph
[
Creator Gephi
directed 0
node
[
id 23131
label "Michael"
sex "male"
agerank "221"
{
"proj": {
"id": "robinson"
},
"layers": {
"countries": {
"src": "ne_10m_admin_0_countries.shp"
},
"graticule": {
"special": "graticule",
@gka
gka / make_tissot.py
Created November 13, 2012 19:34
script to create tissot indicator circles
#!/usr/bin/env python
# Tissot Circles
# Represent perfect circles of equal area on a globe
# but will appear distorted in ANY 2d projection.
# Used to show the size, shape and directional distortion
# by Matthew T. Perry
# 12/10/2005
import ogr
import os
@gka
gka / gist:4114480
Created November 19, 2012 22:28
tar gzipping stuff to another computer
tar czf - stuff/ | ssh user@somemachine 'cat - > stuff.tar.gz'
@gka
gka / presenter.html
Created December 13, 2012 22:36
Simplified version of flickrperson app. See https://github.com/PyBossa/pybossa.js/issues/8 for more information.
<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>
from PIL import Image, ImageDraw
import sqlite3
from grapefruit import Color
c1 = Color.NewFromHtml('#ffffff')
c2 = Color.NewFromHtml('#660000')
conn = sqlite3.connect('zon-tags-2.db')
im = Image.new('RGBA', (20 * 52 + 60, (2012 - 1946) * 20 + 40))
@gka
gka / lab-colors.R
Created January 24, 2013 13:11
Playing around with CIE Lab colors in R
#
# Playing around with CIE Lab colors in R
#
# load library that provides colorRampPalette
library(grDevices)
# define function for plotting colors
plotColors = function(palette, n=10) {
colors = palette(n)
@gka
gka / _readme.md
Created January 24, 2013 20:43
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 http://example.com/github.php