Skip to content

Instantly share code, notes, and snippets.

@staeff
staeff / README.md
Created April 25, 2015 15:43
Unofficial packages for Intel Edison (Install pip)
@staeff
staeff / baseball-marker.png
Last active February 6, 2017 21:48
leaflet examples
baseball-marker.png
@staeff
staeff / README.md
Last active August 29, 2015 14:17
Data munging for Hackathon project "party haus"

Interesting data sets:

Einwohnerinnen und Einwohner in Berlin in LOR-Planungsräumen nach Wohndauer am 31.12.2014

  • How long are people living in an area? The data set provides the percentages of people living less the 5 years, between 5 years and 10 years, more then 10 years in an area. We expect areas with a higher percentage of people living there for a shorter time is more suited for parties!
  • also included in this data set: people younger than 5 or 10 years. So we have an indicator if there are a lot of children
  • the location is encoded in a number, which is resolved in this document: http://www.stadtentwicklung.berlin.de/planen/basisdaten_stadtentwicklung/lor/download/LOR-Schluesselsystematik.xls
  • After resolving the location key, we have a string saying, where it is. That still needs to be resolved to a map. Or we take info from the api as key.

data: https://www.statistik-berlin-brandenburg.de/opendata/Beschreibung_Wohndauer_Lage_Datenpool.pdf

@staeff
staeff / ocr-tesseract.sh
Created March 18, 2015 20:07
OCR with tesseract on the command line
#!/bin/sh
STARTPAGE=1 # set to pagenumber of the first page of PDF you wish to convert
ENDPAGE=86 # set to pagenumber of the last page of PDF you wish to convert
SOURCE=book.pdf # set to the file name of the PDF
OUTPUT=book.txt # set to the final output file
RESOLUTION=600 # set to the resolution the scanner used (the higher, the better)
touch $OUTPUT
for i in `seq $STARTPAGE $ENDPAGE`; do
convert -monochrome -density $RESOLUTION $SOURCE\[$(($i - 1 ))\] page.tif
@staeff
staeff / .aliases
Last active September 26, 2019 05:45
Snippets related to codio.com
# cd
alias ..='cd ..'
alias ...='cd ../..'
alias cd..='cd ..'
alias cdv='cdvirtualenv'
alias vhost='cd /etc/apache2/vhosts.d/'
function cdl { cd $1; ls;} # Change and list directory
function cdls { cd $1; clear; ls;} # Change and list directory on clear screen
alias nocomment='sed -i.bak "/^\#/d;/^ *$/d"'
@staeff
staeff / README.md
Last active August 29, 2015 14:14
Learn alias commands with a little quiz

Learn aliases with this little quiz app

This little word quiz lets you learn alias commands for your shell. Right now it only contains the alias defined by the "git" - plugin of oh-my-zsh.

@staeff
staeff / sierpinski.py
Last active August 29, 2015 14:14
Draw sierpinski triangle with pythons turtle module
import turtle
def drawTriangle(points,color,myTurtle):
myTurtle.fillcolor(color)
myTurtle.up()
myTurtle.goto(points[0][0],points[0][1])
myTurtle.down()
myTurtle.begin_fill()
myTurtle.goto(points[1][0],points[1][1])
myTurtle.goto(points[2][0],points[2][1])
@staeff
staeff / snowflake.py
Last active July 30, 2020 23:14
Draw snowflakes with python turtle.
import turtle
import random
# setup the window with a background colour
wn = turtle.Screen()
wn.bgcolor("#EFECCA")
wn.setup(width=250, height=250)
# assign a name to your turtle
turtle = turtle.Turtle()