Skip to content

Instantly share code, notes, and snippets.

@glw
glw / postgres-postgis-cheat-sheet.md
Last active February 20, 2019 22:36
postgis cheat sheet
@glw
glw / gist:f5d7096c30184163a425b1cb0015f6fe
Created June 2, 2017 21:19
use jupyter notebook in any virtualenv
workon web-app
pip install ipykernel
python -m ipykernel install --user --name web-app --display-name "Webapp"
#then start jupyter, and you should see "Webapp" in the drop down for kernels
@glw
glw / tmux-cheatsheet.markdown
Last active March 29, 2018 21:57 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@glw
glw / search.sh
Created October 24, 2017 16:04
Search for each TIF and return wether it is valid or not
echo "file, output" > output.csv;
TIFS=$(find . -name '*.TIF');
for f in $TIFS; do
output=$(tiffinfo.exe $f 2>&1 | grep 'Cannot read TIFF header');
echo "$f, $output" >> output.csv;
done
@glw
glw / tar.md
Last active April 1, 2019 19:55
tar/untar a directory (becuase i always forget how)

tar/compress

tar -zcvf archive.tar.gz directory/

untar/decompress

tar -xvzf archive.tar.gz directory/
@glw
glw / todoList.js
Last active November 13, 2017 05:14
todoList
var todoList = {
todos: [],
addTodo: function(todoText) {
this.todos.push({
todoText: todoText,
completed: false
});
},
changeTodo: function(position, todoText) {
this.todos[position].todoText = todoText;
@glw
glw / advanced_rasterio_features.ipynb
Created December 17, 2017 00:21 — forked from sgillies/advanced_rasterio_features.ipynb
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@glw
glw / pyexiv2_install.md
Last active March 15, 2018 18:52
install pyexiv2 in python virtualenv

Installing pyexiv2 into a virtualenv

exiv2 is already installed via apt-get

download deb package

sudo aptitude download python-pyexiv2 #has libboost-python1.58.0 dependency

my best guess is that this has to be installed on the OS

@glw
glw / search_for_altitude.sh
Created April 13, 2018 16:40
search for altitude in image exif tags output to csv
echo "name, altitude" > output.csv
for tif in ./path/to/images/0003/*.TIF; do
name=$(exiftool $tif | grep 'Original Raw File Name')
alt=$(exiftool $tif | grep 'GPS Altitude :')
echo "$name, $alt" >> output.csv
done