Skip to content

Instantly share code, notes, and snippets.

View hrwgc's full-sized avatar

Chris Herwig hrwgc

  • Google
  • San Francisco
View GitHub Profile
@lucasallan
lucasallan / install_postgis_osx.sh
Created September 6, 2011 21:03 — forked from klebervirgilio/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@btoone
btoone / curl.md
Last active December 8, 2024 05:16
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@springmeyer
springmeyer / perf-guide.md
Last active October 6, 2015 05:38
Basics of performance profiling for users that want fast programs
@tmcw
tmcw / README.md
Last active October 13, 2015 22:59
Bulk-Add Markers to MapBox

This script allows you to add markers to the MapBox markers interface, in bulk, from a GeoJSON file that contains Point geometries only.

Since it only accepts GeoJSON, you can use OGR, togeojson, or csv2geojson to get usable input data.

This requires you to use the Javascript console of your browser and know elementary Javascript. For instance, a process might look like:

@hrwgc
hrwgc / mapbox_learn.md
Last active September 5, 2016 15:24
Resources for those just starting with Mapbox, TileMill, and Quantum GIS
@oeon
oeon / gdal_src_mrsid.md
Last active November 8, 2018 20:29
build GDAL from source with MrSID support

get source code http://trac.osgeo.org/gdal/wiki/DownloadSource let's use GDAL 1.10.1 for this example.

here's the page on BuildingOnUnix http://trac.osgeo.org/gdal/wiki/BuildingOnUnix

here's the page for MrSID / GDAL http://trac.osgeo.org/gdal/wiki/MrSID

get the DSDK from LizardTech https://www.lizardtech.com/developer/ - version I used was MrSID_DSDK-8.5.0.3422-linux.x86-64.gcc44 I made a folder /home/oeon/local/src and put it there. I also extracted my GDAL src code there.

i made a folder /home/oeon/local/gdal1101

@hrwgc
hrwgc / aws-cli-s3cmd-du.sh
Last active June 19, 2023 15:32
aws-cli get total size of all objects within s3 prefix. (mimic behavior of `s3cmd du` with aws-cli)
#!/bin/bash
function s3du(){
bucket=`cut -d/ -f3 <<< $1`
prefix=`awk -F/ '{for (i=4; i<NF; i++) printf $i"/"; print $NF}' <<< $1`
aws s3api list-objects --bucket $bucket --prefix=$prefix --output json --query '[sum(Contents[].Size), length(Contents[])]' | jq '. |{ size:.[0],num_objects: .[1]}'
}
s3du $1;
@hrwgc
hrwgc / mercantile-tiles-from-geojson.sh
Last active August 29, 2015 14:11
mercantile find web mercator tiles for a given zoom level based on geojson feature collection
#!/bin/bash
function to_tiles(){
geojson=$1;
zoom=$2;
jq -c .features[] < "$geojson" | mercantile tiles $zoom | sort | uniq
}