Skip to content

Instantly share code, notes, and snippets.

View thanhleviet's full-sized avatar
🤗
Focusing

Thanh Lee thanhleviet

🤗
Focusing
View GitHub Profile
@thanhleviet
thanhleviet / install-mapnik2.md
Created January 14, 2012 05:13 — forked from cspanring/install-mapnik2.md
Mapnik2 on Ubuntu 10.04 installation

Mapnik2 on Ubuntu 10.04 installation

http://trac.mapnik.org/wiki/UbuntuInstallation

sudo apt-get install -y g++ cpp \
python-dev libxml2 libxml2-dev \
libfreetype6 libfreetype6-dev \
libjpeg62 libjpeg62-dev \
libltdl7 libltdl-dev \
libpng12-0 libpng12-dev \
@thanhleviet
thanhleviet / render.sh
Created February 20, 2012 15:24 — forked from onyxfish/render.sh
How to generate tiles from TileMill config (ie. bypass mbtiles)
/TileMill/bin/carto map.mml > map.xml
python render_tiles.py map.xml .tiles/ 42.05 -88 41.6 -87.5 11 16 2
@thanhleviet
thanhleviet / __geo_interface__.rst
Created March 28, 2012 07:08 — forked from sgillies/geo_interface.rst
A Python Protocol for Geospatial Data

Author: Sean Gillies

Abstract

This document describes a GeoJSON-like protocol for geospatial vector data.

Introduction

@thanhleviet
thanhleviet / nginx play
Created April 25, 2012 03:40 — forked from sim51/nginx play
My nginx configuration for opendata-map.org
server {
listen 80;
server_name www.opendata-map.org;
root /var/www/opendata-map.org;
access_log /var/log/nginx/opendata-map.access.log;
error_log /var/log/nginx/opendata-map.error.log debug;
# GEOSERVER PROXY & CACHE
location /geoserver {
proxy_pass http://127.0.0.1:8080/geoserver;
@thanhleviet
thanhleviet / nginx play
Created July 3, 2012 08:57 — forked from sim51/nginx play
My nginx configuration for opendata-map.org
server {
listen 80;
server_name www.opendata-map.org;
root /var/www/opendata-map.org;
access_log /var/log/nginx/opendata-map.access.log;
error_log /var/log/nginx/opendata-map.error.log debug;
# GEOSERVER PROXY & CACHE
location /geoserver {
proxy_pass http://127.0.0.1:8080/geoserver;
@thanhleviet
thanhleviet / views.py
Created July 4, 2012 07:25 — forked from albertsun/views.py
geojson tiles views.py
from redistricting.apps.features.models import CensusBlock, CensusTract, CensusCounty, DataBlock
from redistricting.utils import gmerc
from django.http import HttpResponse, Http404, HttpResponseForbidden
from django.contrib.gis.geos import GEOSGeometry
from django.shortcuts import render_to_response
from django.template.loader import render_to_string
from django.template import RequestContext
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({
options: {
debug: false
},
tileSize: 256,
initialize: function (options) {
L.Util.setOptions(this, options);
@thanhleviet
thanhleviet / PostGIS201.sh
Created July 11, 2012 04:53 — forked from Tab3r/PostGIS201.sh
PostGIS 2.0.1 in Ubuntu 12.04
sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev proj libjson0-dev xsltproc docbook-xsl docbook-mathml gettext postgresql-contrib-9.1 pgadmin3
sudo apt-add-repository ppa:olivier-berten/geo
sudo apt-get update
sudo apt-get install libgdal-dev
# Its looks like:
# $ gdal-config --version
# 1.9.0
# $ geos-config --version
@thanhleviet
thanhleviet / supervisord.sh
Created October 30, 2012 01:44 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@thanhleviet
thanhleviet / gist:4142680
Created November 25, 2012 06:52
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after