Skip to content

Instantly share code, notes, and snippets.

View YanhaoYang's full-sized avatar

Yanhao Yang YanhaoYang

  • Berlin, Germany
View GitHub Profile
@YanhaoYang
YanhaoYang / install-postgis.sh
Last active December 15, 2015 10:59
Commands for installing postgis copied from How to compile PostGIS 2.0.1 on Ubuntu Server 12.04 (http://blog.mackerron.com/2012/06/01/postgis-2-ubuntu-12-04/)
sudo /etc/init.d/postgresql stop
# PostGIS 1.5.2 and its dependencies were installed already, so I
# removed them
sudo aptitude remove postgis postgresql-9.1-postgis \
libgdal1-dev libgdal1-1.7.0 gdal-bin python-gdal \
libspatialite2 libspatialite3 libgeos-dev libgeos-c1
# install any missing prerequisites
sudo aptitude install build-essential checkinstall postgresql \
@YanhaoYang
YanhaoYang / .inputrc
Created January 15, 2013 14:13
Let ctrl+left to go back one word in iTerm2, and ctrl+right to go forward one word. See http://superuser.com/questions/357355/how-can-i-get-controlleft-arrow-to-go-back-one-word-in-iterm2
"\e[1;5D": backward-word
"\e[1;5C": forward-word
@YanhaoYang
YanhaoYang / sym_equal_definition
Created January 9, 2013 08:55
For Symbols, `==` is exactly same as `===`
// string.c in ruby-1.9.3-p125 src
7896 rb_define_method(rb_cSymbol, "==", sym_equal, 1);
7897 rb_define_method(rb_cSymbol, "===", sym_equal, 1);
7395 static VALUE
7396 sym_equal(VALUE sym1, VALUE sym2)
7397 {
7398 if (sym1 == sym2) return Qtrue;
7399 return Qfalse;
@YanhaoYang
YanhaoYang / .gitconfig-for-diffmerge
Last active October 29, 2020 05:18
Using DiffMerge as your Git visual merge and diff tool on Mac
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[merge]
tool = diffmerge
[mergetool "diffmerge"]
cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
trustExitCode = true
--colour
-I app