Skip to content

Instantly share code, notes, and snippets.

View djq's full-sized avatar

David Quinn djq

  • Google
  • Dublin
View GitHub Profile
# Docs
# https://rapidapi.com/skyscanner/api/skyscanner-flight-search?endpoint=5a9b572de4b06ec3937b1296
#
# Using the skyscanner API
# install unirest into virtual env "flight"
#
# activate virtualenv
#
@djq
djq / table_summary.R
Created August 2, 2017 17:50
Table summary
# https://stackoverflow.com/questions/23629592/how-can-i-select-the-top-2-values-in-a-column-per-column-and-report-this-with-bo
t <- structure(c(0.333333333333333, 0.333333333333333, 0.333333333333333,
0.333333333333333, 0.333333333333333, 0.333333333333333, 0.166666666666667,
0.166666666666667, 0.166666666666667, 0.166666666666667, 0.166666666666667,
0.166666666666667, 0.166666666666667, 0.166666666666667, 0.166666666666667,
0.166666666666667, 0.166666666666667, 0.166666666666667, 0.333333333333333,
0.333333333333333, 0.333333333333333, 0.333333333333333, 0.333333333333333,
0.333333333333333), .Dim = c(6L, 4L), .Dimnames = list(c("1",
"2", "3", "4", "5", "6"), c("123", "124", "125", "126")))
@djq
djq / network_visualization.R
Created May 7, 2017 20:08
R network visualizations
# examples from: http://kateto.net/network-visualization
library('igraph')
library('network')
library('sna')
library('ndtv')
library('visNetwork')
# load data
setwd('/Users/djq/Desktop/net-viz/data')
@djq
djq / sotm.md
Last active August 29, 2015 14:23
OpenStreetMap Conference - NYC June 2015
@djq
djq / gist:58558ac644a6c15f52ac
Last active November 2, 2015 16:06
Intro to spatial data using django
# ----
# Background
# ----
#
# Vectors:
# vectors consist of points, lines, polygons
# Within GeoDjango, data-types which are multipolygon and geometry also exist
#
# Projections:
# Projection systems facilitate translating data between a 3D and 2D space.
Verifying that +djq is my openname (Bitcoin username). https://onename.com/djq
@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]
@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 / 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 / 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 -->