Skip to content

Instantly share code, notes, and snippets.

View philippgeisler's full-sized avatar

Philipp Geisler philippgeisler

View GitHub Profile
@philippgeisler
philippgeisler / sum.awk
Created August 13, 2014 13:59
Simple Awk-script to calculate sums of values (here in $2) grouped by some field (here $1)
#! /usr/bin/awk -f
# equivalent oneliner for aliases: awk -F "|" '{group[$1] += $2} END{for (g in group) print group[g], "\t", g;}'
BEGIN {
FS="|"
}
{
group[$1] += $2
}
END {
for (g in group)
@philippgeisler
philippgeisler / bboxes.sh
Created July 11, 2014 13:48
Shell script grabbing bounding box coordinates for an array of cities
#!/usr/bin/zsh
url='http://open.mapquestapi.com/nominatim/v1/search.php'
# url='http://nominatim.openstreetmap.org/search'
if [ -e locations ]
then
rm locations
fi
for c in Berlin Dortmund Frankfurt Hamburg München