Skip to content

Instantly share code, notes, and snippets.

View thomersch's full-sized avatar

Thomas Skowron thomersch

View GitHub Profile

Keybase proof

I hereby claim:

  • I am thomersch on github.
  • I am thomersch (https://keybase.io/thomersch) on keybase.
  • I have a public key whose fingerprint is 2C22 42FC 8832 429E 943D 04D6 AD84 2DC5 035A 1DDC

To claim this, I am signing this object:

@thomersch
thomersch / ffmpeg.sh
Last active December 11, 2018 23:47
ffmpeg cheat sheet
# average bit rate encoding
ffmpeg -i $INPUT -c:v libx264 -b:v $BITRATE $OUTPUT.mp4
# mux
ffmpeg -i video.mov -i audio.flac -c:v copy -c:a aac muxed.mp4
ffmpeg -i video.mov -i audio.flac -c copy muxed.mkv # mkv takes any codec combination
# remux
@thomersch
thomersch / config
Created June 27, 2015 11:31
GitHub via IPv6 (~/.ssh/config)
Host github.com
HostName ikvjwd.com
@thomersch
thomersch / gist:7f82830e61f08e65eac5
Created June 26, 2015 20:39
Building imposm under FreeBSD
CGO_CFLAGS="-I/usr/local/include -ferror-limit=0" CGO_LDFLAGS="-L/usr/local/lib/" GOPATH=$GOPATH":"$PWD/Godeps/_workspace/ go build imposm3.go
@thomersch
thomersch / gist:d48de1a8be55a47ab2f9
Last active June 10, 2017 12:49
Go Test Coverage
go test -cover -covermode=count -coverprofile=cover.profile && go tool cover -html=cover.profile && rm cover.profile
@thomersch
thomersch / gist:43ccd01cad75c5e2d54b
Created July 9, 2014 16:40
Run script on file change
# Preparation
brew install fswatch
# watching
fswatch -o /coding/ts_website/pages/ | xargs -n1 /coding/ts_website/pagewerk.py
@thomersch
thomersch / .zshrc
Last active November 25, 2016 17:31
ZSH
export PS1="%F{red}%n%F{black}@%F{green}%m%F{black}:%~%E %f$ "
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export LS_OPTIONS='--human --color=always'
export EDITOR="vim"
autoload -U compinit && compinit
@thomersch
thomersch / latlontotile.py
Created February 12, 2014 19:25
Convert lat/lon to tile number
import math
def lat_lon_to_tile(lat_deg, lon_deg, zoom):
def sec(x):
return 1/math.cos(x)
lat_rad = math.radians(lat_deg)
n = 2**zoom
xtile = n * ((lon_deg + 180) / 360)
ytile = n * (1 - (math.log(math.tan(lat_rad) + sec(lat_rad)) / math.pi)) / 2
@thomersch
thomersch / geojsonsimplifier.py
Last active August 29, 2015 13:56
Vereinfachen von GeoJSON zu einem LineString in der richtigen Reihenfolge
import json
data = json.loads(geojson)
all_linestrings = []
new_linestring = []
inserted = 0
for elements in data["features"]:
if elements["geometry"]["type"] == "LineString":
ls = elements["geometry"]["coordinates"]
* Set time zone
dpkg-reconfigure tzdata