Skip to content

Instantly share code, notes, and snippets.

View bmoregeo's full-sized avatar

Christopher Fricke bmoregeo

View GitHub Profile
@bmoregeo
bmoregeo / ConfigObjDemo1
Last active August 29, 2015 14:01
Python Config Files with ConfigObj
# Set values using the '='.
# Text will default to strings url = http://testing/arcgis/rest/awesometest/MapServer
# Unless it looks like an integer threads = 1
# or a floating point value = 510.128
# If you put brackets around something, that makes it
# a section. The text inside the bracket is the section header [data]
# To create a sub-section, just add another bracket.
# I like to tab these suckers out to make it legible.
name = "example"
@bmoregeo
bmoregeo / gist:8927619
Last active August 29, 2015 13:56
Install CartoDB on Ubuntu 11.10. Use https://github.com/lordlinus/cartodb as a template
# Install PostGIS
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list'
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install Postgresql-9.3-postgis postgresql-contrib
sudo -u postgres psql
# > CREATE EXTENSION adminpack;
# > \q
@bmoregeo
bmoregeo / php_mysql_extent
Created September 3, 2013 23:29
Query MYSQL based on extent
//Get Coordinates From Javascript Call
$latMin = $_GET["c1"];
$lonMin = $_GET["c2"];
$latMax = $_GET["c3"];
$lonMax = $_GET["c4"];
//Gather Coordinates Into a MySQL Polygon Geometry Type
$bounds = "GeomFromText('POLYGON((".$lonMin." ".$latMin.",".$lonMin."," .$latMax.",".$lonMax." ".$latMax.",".$lonMax." ".$latMin.",".$lonMin." ".$latMin."))')";
//Database Fields