Skip to content

Instantly share code, notes, and snippets.

@mgiraldo
mgiraldo / postgis-cluster-lat-lon-with-filters.sql
Last active August 29, 2015 14:01
given a PostGIS table `lname` with `lat` and `lon` columns and primay key `gid`, make a cluster filtering by `filtercol` column with `filterval` value and excluding `excludecol` column with `excludeval` value
CREATE OR REPLACE FUNCTION get_domains_n(lname varchar, lat varchar, lon varchar, gid varchar, radius numeric, filtercol varchar, filterval varchar, excludecol varchar, excludeval varchar)
RETURNS SETOF record AS
$$
DECLARE
lid_new integer;
dmn_number integer := 1;
outr record;
innr record;
r record;
BEGIN
@mgiraldo
mgiraldo / polygonfix writeup.ipynb
Last active August 29, 2015 14:04
Finding shape consensus among multiple geo polygons. See: http://nbviewer.ipython.org/gist/mgiraldo/a68b53175ce5892531bc
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am mgiraldo on github.
  • I am mgiraldo (https://keybase.io/mgiraldo) on keybase.
  • I have a public key whose fingerprint is 28DB EC43 3E95 F205 173B 633B ED50 1218 0315 0A3D

To claim this, I am signing this object:

@mgiraldo
mgiraldo / single label classifier.ipynb
Last active August 29, 2015 14:07
single label book classifier
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 9 columns, instead of 7. in line 5.
Name,Photo,Address,Term,Office,Page,Directory Occupation,Latitude,Longitude
Salvador Camacho Roldán ,http://upload.wikimedia.org/wikipedia/commons/c/cd/SalvadorCamacho.jpg,"361, Calle 10. — 178, Calle 12.",1868-1869 / 1871,President,59,comerciante,4.598056,-74.075833
Miguel Antonio Caro Tobar,http://upload.wikimedia.org/wikipedia/commons/5/5c/Miguel_Antonio_Caro_2.jpg,"127, Carrera 11.",1892-1898,Vicepresident,64,literato,4.598056,-74.075833
Antonio Basilio Cuervo,http://upload.wikimedia.org/wikipedia/commons/b/b3/Antonio_Basilio_Cuervo.jpg,"256, Calle 12. — 201, Carrera 3.",1893,Minister,86,talabartero,4.598056,-74.075833
Carlos Holguín Mallarino,https://upload.wikimedia.org/wikipedia/commons/7/77/Carlos_Holgu%C3%ADn_Mallarino.jpg,"208, Carrera 8.",1888-1892,Acting President,154,Ministro de Estado,4.598056,-74.075833
Rafael Núñez Moledo,https://upload.wikimedia.org/wikipedia/commons/0/09/Rafael_Nunez_cph.3a03388.jpg,"157, A, Carrera 7.",1880-1882 / 1884-1886 / 1887 -1888 / 1892-1894,President,222,Presidente
@mgiraldo
mgiraldo / directorio bogotá 1888.geojson
Last active August 29, 2015 14:12
Prominent politicians living in Bogotá in 1888 (GeoJSON). As seen in http://www.bibliotecanacional.gov.co/recursos_user/bookreader/1889_sala3a_12756/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mgiraldo
mgiraldo / hack4fi.ipynb
Created February 8, 2015 11:02
Made for #hack4fi 2015. See also https://github.com/mgiraldo/infinipic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mgiraldo
mgiraldo / 960grid.css.scss
Created May 15, 2012 17:27
SCSS implementation of the 960.gs grid based on the SASS version found in https://github.com/nextmat/compass-960-plugin
$ninesixty-gutter-width: 20px !default;
$ninesixty-grid-width: 960px !default;
$ninesixty-columns: 12 !default;
$ninesixty-class-separator: "_" !default;
@mixin grid-container {
margin-left: auto;
@mgiraldo
mgiraldo / nyc-community-districts.geojson
Created December 22, 2015 16:46
Community Districts (Clipped to Shoreline) converted to GeoJSON from the official NYC shapefile downloaded 22/12/2015 from http://www.nyc.gov/html/dcp/html/bytes/districts_download_metadata.shtml
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mgiraldo
mgiraldo / doggetts_1848.csv
Last active February 2, 2016 19:12
Some prominent New Yorkers in 1848 (from Doggett's New York City Directory https://archive.org/details/doggettsnewyorkc1848dogg)
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 10 columns, instead of 6. in line 3.
Name,Address,Page and column,Occupation,Directory link,Wikipedia link,NYPL link,Photo,Latitude,Longitude
John Jacob Astor jr.,"87 Prince, h. 37 Lafayette pl",page 31 left top,"(occasional poet, sickly and mentally unstable, never married or had children)",https://archive.org/stream/doggettsnewyorkc1848dogg#page/n37/mode/2up,https://en.wikipedia.org/wiki/Astor_family,http://archives.nypl.org/mss/141,,40.713,-74.006
William B. Astor,"87 Prince, h. 37 Lafayette pl",page 31 left top,"(property tycoon, became the richest man in the US)",https://archive.org/stream/doggettsnewyorkc1848dogg#page/n37/mode/2up,"https://en.wikipedia.org/wiki/William_Backhouse_Astor,_Sr.",http://archives.nypl.org/mss/141,https://upload.wikimedia.org/wikipedia/commons/8/8f/William_Backhouse_Astor_Sr.jpg,40.713,-74.006
Thomas Addis Emmet,"45 William, h. Av. 7 c. W. 13th",page 141 left middle,lawyer (New York State Attorney General),https://archive.org/stream/doggettsnewyorkc1848dogg#page/n151/mode/2up,https://en.wikipedia.org/wiki/Thomas_A