This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Installing software | |
* Set up ports collection | |
portsnap fetch && portsnap extract | |
* Updating ports collection | |
portsnap fetch && portsnap update | |
* Remove port | |
pkg_delete {} | |
* Upgrading with portupgrade | |
# set up | |
cd /usr/ports/ports-mgmt/portupgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Set time zone | |
dpkg-reconfigure tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Preparation | |
brew install fswatch | |
# watching | |
fswatch -o /coding/ts_website/pages/ | xargs -n1 /coding/ts_website/pagewerk.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go test -cover -covermode=count -coverprofile=cover.profile && go tool cover -html=cover.profile && rm cover.profile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGO_CFLAGS="-I/usr/local/include -ferror-limit=0" CGO_LDFLAGS="-L/usr/local/lib/" GOPATH=$GOPATH":"$PWD/Godeps/_workspace/ go build imposm3.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host github.com | |
HostName ikvjwd.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
OlderNewer