Skip to content

Instantly share code, notes, and snippets.

View stefanbirkner's full-sized avatar

Stefan Birkner stefanbirkner

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

#Rule and Runners

idealo

@StefanBirkner

##Rule

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

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
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
stefanbirkner / ReplaceBlocks.java
Created June 1, 2011 19:12
Replace blocks in files, which are identified by a start and an end token.
View ReplaceBlocks.java
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
public class ReplaceBlocks {
View gist:1012725
#delete
cat sb | xargs sed -i 's/0, 1, 3, 2/0, 1, 3/g'
#replace
cat sb | xargs sed -i 's/0, 1, 2/0, 1, 3/g'
@stefanbirkner
stefanbirkner / addNewLine.sh
Created June 22, 2011 14:41
Add a new line at the beginning of a text file
View addNewLine.sh
#!/bin/sh
#adds the line 'the new first line' at the beginning of file 'filename'
sed -i '1 i\the new first line' filename