Skip to content

Instantly share code, notes, and snippets.

@kjordahl
kjordahl / citibike.py
Created July 9, 2013 14:00
Get number of available bikes in Manhattan and Brooklyn with GeoPandas
from urllib2 import urlopen
from cStringIO import StringIO
import json
from pyproj import Proj
from shapely.geometry import Point
from geopandas import GeoSeries, GeoDataFrame
# http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip
boros = GeoDataFrame.from_file('/nybb_13a/nybb.shp', vfs='zip://nybb_13a.zip')
url = 'http://citibikenyc.com/stations/json'
@ericmagnuson
ericmagnuson / cartodb20_build.sh
Last active April 13, 2017 22:53
How to build CartoDB 2.0 on Ubuntu 12.04
###################################
## CartoDB 2.0 Install [Working] ##
## Tested on Ubuntu 12.04 ##
###################################
# Change password
passwd
adduser [username]
adduser [username] sudo
@sholloway
sholloway / PostGIS install
Created January 13, 2013 23:23
Set up a spatial database with PostGIS on EC2 using an EBS.
Steps:
Set up EBS
21Created 1 TB EBS
Created 64 Bit Amazon Linux AMI 2012.09 M1 Medium 3.7 gb ram, 2 ECUs
Connect to ec2 instance via ssh
chmod 400 IFS-KeyPair.pem
ssh -v -i IFS-KeyPair.pem [email protected]
Note: Do not replace ec2-user with your user id. This is a AWS Amazon AMI requirement.
@dwelch2344
dwelch2344 / 1_pom.xml
Created August 9, 2012 19:13
Spring RestTemplate w/ Basic Auth
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Http Client -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
@dlo
dlo / README.md
Last active September 30, 2015 20:57
Ubuntu 11.10 & OS X PostGIS Setup Script

Installing PostGIS

Ubuntu 11.10

sudo apt-get install postgresql-9.3-postgis-2.1
sudo su postgres
bash <(curl -s https://gist.githubusercontent.com/dlo/1860599/raw/514276029c43e6e68a2e2164f2a77fd53354b8e9/create_template.sh)

OS X

@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');