Skip to content

Instantly share code, notes, and snippets.

View danicarrion's full-sized avatar

Dani Carrión danicarrion

  • Valladolid, Spain
View GitHub Profile
@danicarrion
danicarrion / index.html
Last active August 29, 2015 14:23
Map with image overlay (GMaps)
<!DOCTYPE html>
<html>
<head>
<!-- See Javier Arce's original for Leaflet: http://bl.ocks.org/javierarce/e7ec4b39013aa03ebd5e -->
<title>Map with image overlay | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
@danicarrion
danicarrion / startpy
Created June 11, 2015 10:35
Starts/stops a python script, storing its PID in /var/run, so that it can be run from monit
#!/bin/bash
#
# startpy: starts/stops a python script, storing its PID in /var/run,
# so that it can be run from monit
#
# Scripts must be placed in a folder under /home/sm/scripts. Startpy
# will look in that folder for a script named after the folder (plus
# .py extension).
#
# (In the following example we'll assume a script test.py exists in
@danicarrion
danicarrion / README.md
Last active August 29, 2015 14:21
Reverse geocoding after adding a point to a table on CartoDB

Requirements

  • A table on PostgreSQL/PostGIS (tested with CartoDB) with the following text fields: address, city, country, zipcode.
  • Python functions are enabled.
  • pygeocoder is available to the python function

Usage

Once the function has been created, the trigger must be created like this (assuming the geometry column is called the_geom: