Skip to content

Instantly share code, notes, and snippets.

View stefanbirkner's full-sized avatar

Stefan Birkner stefanbirkner

View GitHub Profile
stefanbirkner /
Created January 31, 2014 16:50
Migrate Apache Commons Lang from 2.x to 3.x
fgrep -Rl "commons.lang." . | xargs sed -i 's/apache\.commons\.lang\./apache.commons.lang3./g' $1
stefanbirkner /
Created October 2, 2014 06:07
Create API documentation with Sphinx
sudo apt-get install python-sphinx
sphinx-apidoc -o dist <module>
sphinx-build -b html source build
stefanbirkner /
Last active August 29, 2015 14:08
goto talk

#Rule and Runners




  • Code Duplication
  • Before/After
stefanbirkner /
Created January 8, 2015 07:30
My cURL Cheat Sheet.

Show timing information

curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total}

View connectedhboxes.elm
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Mouse
import Window
type alias Box = (Int,Int)
type alias Editor = { boxes: List Box }
main : Signal Element
stefanbirkner / to_visit.geojson
Last active August 29, 2015 14:25
Locations to visit
View to_visit.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
stefanbirkner /
Created June 1, 2011 19:12
Replace blocks in files, which are identified by a start and an end token.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
public class ReplaceBlocks {
View gist:1012725
cat sb | xargs sed -i 's/0, 1, 3, 2/0, 1, 3/g'
cat sb | xargs sed -i 's/0, 1, 2/0, 1, 3/g'
stefanbirkner /
Created June 22, 2011 14:41
Add a new line at the beginning of a text file
#adds the line 'the new first line' at the beginning of file 'filename'
sed -i '1 i\the new first line' filename