Skip to content

Instantly share code, notes, and snippets.

View jbspeakr's full-sized avatar

Jan Brennenstuhl jbspeakr

View GitHub Profile
@jbspeakr
jbspeakr / German-Zip-Codes.csv
Created January 18, 2013 16:46
list of German zip codes (Postleitzahl), including dialing code, name of the city and federal state.
We can't make this file beautiful and searchable because it's too large.
Ort;Zusatz;Plz;Vorwahl;Bundesland
Aach;b Trier;54298;0651;Rheinland-Pfalz
Aach;, Hegau;78267;07774;Baden-Württemberg
Aachen;;52062;0241;Nordrhein-Westfalen
Aachen;;52064;0241;Nordrhein-Westfalen
Aachen;;52066;0241;Nordrhein-Westfalen
Aachen;;52068;0241;Nordrhein-Westfalen
Aachen;;52070;0241;Nordrhein-Westfalen
Aachen;;52072;0241;Nordrhein-Westfalen
Aachen;;52074;0241;Nordrhein-Westfalen
@jbspeakr
jbspeakr / top-level-domains.json
Created January 6, 2013 10:05
all Top-Level-Domains (TLD) and their corresponding countries/ generics in JSON
[
{
"model": "dmakr.domain",
"pk": 1,
"fields": {
"tld": "aero",
"country": "Air transport"
}
},{
"model": "dmakr.domain",
@jbspeakr
jbspeakr / gource.txt
Created January 24, 2019 09:28
Gource
gource -1920x1080 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset slow -crf 1 -threads 0 -bf 0 gource.mp4
@jbspeakr
jbspeakr / edges.py
Last active April 10, 2018 10:49
ArangoDB: Transform GTFS to Vertices and Edges for ArangoDB Importer
import csv
collectionName = 'vertices'
gtfsStopTimes = 'gtfs/stop_times.txt'
edgesFile = 'graph/edges.json'
def readAsJson(filePath):
i = open(filePath, 'r')
@jbspeakr
jbspeakr / arangodb-setup.sh
Created July 22, 2013 18:15
Setup ArangoDB on Uberspace
# Log in and execute
wget -O - https://www.arangodb.org/repositories/1.3.2/Uberspace/uberspace-arangodb.sh | sh
# Copy sh-Scripts to ~/bin
cp arangod.sh ~/bin
cp arangosh.sh ~/bin
# Setup daemontools
test -d ~/service || uberspace-setup-svscan
@jbspeakr
jbspeakr / css3-selectors.js
Created September 20, 2013 07:18
a collection of selected CSS3 selector strings.
var selectedCheckboxes = 'input[type=checkbox]:checked';
@jbspeakr
jbspeakr / yui-iframe.js
Created September 4, 2013 12:10
YUI Howto: Work with iFrames.
YUI().use("node", function (Y) {
'use strict';
var iframeId = "#masterDataFrame";
var frame = Y.one(iframeId);
var win = Y.Node.getDOMNode(frame.get('contentWindow'));
var doc = win.document;
YUI({ win: win, doc: doc }).use('node', function (innerY) {
// Do it...
@jbspeakr
jbspeakr / toCsv.js
Created August 28, 2013 08:04
JS Howto: Transform list into CSV.
var toCsv = function(list){
var emptyString = '';
return list + emptyString;
};
@jbspeakr
jbspeakr / yui-namespaces.js
Last active December 21, 2015 17:09
YUI Howto: Use make internal functions available out of a modules scope.
YUI.add('module-name', function (Y) {
'use strict';
var init = function(){
// Do Something...
};
Y.ModuleName = {
init: init
};
@jbspeakr
jbspeakr / csv2yaml.py
Created June 25, 2013 14:45
Check http://www.datahack.it for further conversion snippets!
import csv
import yaml
i = open('input.csv', 'r')
reader = csv.DictReader(i)
data = yaml.safe_dump([row for row in reader], canonical=False,
encoding='utf-8', allow_unicode=True,
default_flow_style=False)