Skip to content

Instantly share code, notes, and snippets.

@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');
@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

@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>
@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.
@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
@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'
@arjendk
arjendk / cartodb-install-ubuntu-1204.md
Last active May 20, 2021 13:33
Installing CartoDB on Ubuntu Server 12.04
@natelandau
natelandau / .bash_profile
Last active March 1, 2025 11:46
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@pospi
pospi / leaflet-multi-geojson-layers.js
Last active September 23, 2016 16:13
Handle multiple geoJSON layers in a Leaflet.js angular directive
/**
* Service to manage geoJSON layering with Leaflet.js' angular directive, which only allows 1 set of geoJSON data.
*
* Assuming you have a leaflet directive with its 'geojson' attribute set to `geojson`, usage is as follows:
* var layers = new GeoJSONLayers();
*
* layers.addLayer('myLayer', geoJSON, function(feature) { return { fillColor: '#00F' }; });
* $scope.geojson = layers.get();
*
* layers.removeLayer('myLayer');
@sebsto
sebsto / gist:19b99f1fa1f32cae5d00
Created August 8, 2014 15:53
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version