Skip to content

Instantly share code, notes, and snippets.

View jbspeakr's full-sized avatar

Jan Brennenstuhl jbspeakr

View GitHub Profile
@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 / tuple-list-to-dict.py
Created April 28, 2015 13:05
Convert Tuple List to Dictionary
"""
usage:
mytool [options]
options:
--foo-bar=PARAM1,PARAM2,... params to do stuff with
[default: key1.value1,key1.value2,key2.value2]
"""
from docopt import docopt
@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 / 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 / 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 / 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 / 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)
@jbspeakr
jbspeakr / gemeindeverzeichnis.json
Created March 23, 2013 23:16
Alle politisch selbständigen Gemeinden mit ausgewählten Merkmalen am 31.12.2012 (4. Quartal) Auf Basis des destatis Gemeindeverzeichnisses: https://www.destatis.de/DE/ZahlenFakten/LaenderRegionen/Regionales/Gemeindeverzeichnis/Administrativ/Archiv/GVAuszugQ/AuszugGV4QAktuell.html
[
{
"name": "Flensburg, Stadt",
"area": "56.74",
"inhabitants": {
"male": "44028",
"number": "89357",
"female": "45329",
"density": "1575"
},