Skip to content

Instantly share code, notes, and snippets.

View djq's full-sized avatar

David Quinn djq

  • Google
  • Dublin
View GitHub Profile
@djq
djq / gist:2846196
Last active September 27, 2022 04:12 — forked from rolo/gist:1481128
Install Postgres 9.1, PostGIS 2.0.2 and PG Routing on Ubuntu 12.04 (Precise Pangolin)
#!/bin/bash
#
# Install Postgres 9.1, PostGIS 2.0 and pgRouting on a clean Ubuntu 12.04 install (64 bit)
# updated to PostGIS 2.0.1
# basics
apt-get install python-software-properties
apt-add-repository ppa:sharpie/for-science # To get GEOS 3.3.3
# install the following pacakages
Stop number Name without locality Locality Locality number Code Name NaPTAN stop class NaPTANId Easting Northing
1 Pearse Street (Pearse Avenue) Sallynoggin E0825024 ->NE2 Stop No. 3234 BCT 8250DB003234 724091 726427
1 Pearse Street (Pearse Avenue) Sallynoggin E0825024 ->SW1 Stop No. 3210 BCT 8250DB003210 724087 726412
2 Lr. Drumcondra Road Drumcondra (Dublin) E0822021 1 Drumcondra Road Lower BCT 825000101 715947 736197
2 Lr. Drumcondra Road Drumcondra (Dublin) E0822021 2 Drumcondra Road Lower BCT 8250B1001201 715929 736199
3 Clontarf Road Junction Strandville Avenu Clontarf E0822038 1 Stop No. 1741 BCT 8220DB001741 718428 736222
4 College Green Dublin City South E0822091 1 Taxi Rank TXR 8220TR000078 715797 734107
4 College Green Dublin City South E0822091 2 Stop No. 1359 BCT 8220DB001359 715770 734095
4 College Green Dublin City South E0822091 3 College Green BCT 825000157 715769 734095
4 College Green Dublin City South E0822091 4 Stop No. 4522 BCT 8220DB004522 715821 734081
@djq
djq / voronoi.sql
Last active October 11, 2021 22:23
Updated SQL function to create Voronoi diagrams to work with PostGIS 2.0. Original code here: http://punkish.org/Voronoi-Diagrams-In-PostGIS
/*
Feb 5, 2013
Original source from here: http://punkish.org/Voronoi-Diagrams-In-PostGIS
Updated old PostGIS function names to work with PostGIS2.0 (buffer, intersect, intersection and srid)
-djq
This function uses the deldir library in R to generate voronoi polygons for
an input set of points in a PostGIS table.
Original function by Mike Leahy mgleahy at alumni.uwaterloo.ca
@djq
djq / django_talk_bos.md
Last active December 19, 2015 02:39
django meetup boston
@djq
djq / tree.sh
Created July 10, 2013 19:34
Tree command for OSX
#!/bin/sh
#######################################################
# UNIX TREE #
# Version: 2.3 #
# File: ~/apps/tree/tree.sh #
# #
# Displays Structure of Directory Hierarchy #
# ------------------------------------------------- #
# This tiny script uses "ls", "grep", and "sed" #
# in a single command to show the nesting of #
@djq
djq / index.html
Created October 11, 2013 15:11 — forked from Guerino1/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.4.5"></script>
<!-- Source for example located at: http://bl.ocks.org/1203641 -->
@djq
djq / djangoeb.js
Created January 27, 2014 22:51 — forked from masayang/djangoeb.js
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Template: This template installs a single-instance with dev environment for elastic beanstalk as well as Jenkins server. This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"EC2Tag" : {
"Description" : "EC2 tag name",
"Type" : "String"
},
@djq
djq / Short.Films
Created May 9, 2014 19:24
short films I like
Elephant Seals:
https://vimeo.com/93175979
Love Is Making Its Way Back Home (Josh Ritter):
https://www.youtube.com/watch?v=dzMN0TTpblg
@djq
djq / unions
Created November 22, 2014 21:23
How to union a list of geometries in GeoDjango
from django.contrib.gis.geos import GEOSGeometry
# sample data
geom_1 = GEOSGeometry('POLYGON((-71.8 42.1,-70.6 42.1,-70.5 41.2,-71.8 41.2,-71.8 42.1))')
geom_2 = GEOSGeometry('POLYGON((-71.12 42.23,-71.48 42.34,-71.52 42.55,-71.12 42.23))')
geom_3 = GEOSGeometry('POLYGON((-73.12 42.23,-71.48 42.34,-71.52 42.55,-73.12 42.23))')
polygons = [geom_1, geom_2, geom_3]
# get first polygon
polygon_union = polygons[0]
Verifying that +djq is my openname (Bitcoin username). https://onename.com/djq