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 / Dockerfile
Created November 17, 2020 08:55
Ejemplo python-mapnik
FROM ubuntu:20.04
RUN apt-get update -y && apt-get install -y apt-utils
RUN apt-get install -y python3-mapnik
WORKDIR /app
COPY . .
@danicarrion
danicarrion / explain.md
Last active February 11, 2020 17:14
Taller para el Open Space de WeCodeFest 2020
@danicarrion
danicarrion / proxy.py
Created February 2, 2018 13:42
Basic proxy that adds your CARTO API key to any requests and forwards them to CARTO
import requests
from flask import Flask, request
BASE_URL = "https://my_account.carto.com" # Or CDN, or on-prem
API_KEY = "my_api_key"
VERIFY_SSL_CERT = True # Set to False if you don't want the proxy to verify CARTO's cert
app = Flask(__name__)
@danicarrion
danicarrion / index.html
Created November 21, 2016 07:57
Forward-all proxy for CARTO's password/token-protected named maps
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" />
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"></script>
<title>Password-protected named map example</title>
</head>
<body>
<div id="map" style="height: 500px"></div>
@danicarrion
danicarrion / index.html
Last active October 17, 2016 15:46
CARTO + Openlayers + MVT example
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>CARTO + Openlayers + MVT example</title>
<link rel="stylesheet" href="https://openlayers.org/en/v3.18.2/css/ol.css" type="text/css" />
<script src="https://openlayers.org/en/v3.18.2/build/ol.js"></script>
@danicarrion
danicarrion / index.html
Created August 18, 2016 16:18
CARTO + Tangram + GeoJSON example
<!doctype html>
<!--
Tangram: real-time WebGL rendering for OpenStreetMap
http://github.com/tangrams/tangram
http://mapzen.com
-->
<html lang="en-us">
<head>
<meta charset="utf-8">
@danicarrion
danicarrion / index.html
Last active September 6, 2016 15:14
CARTO + Tangram + MVT example
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>CARTO + Tangram + MVT example</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.3/leaflet.css" />
<style>
@danicarrion
danicarrion / export.conf.example
Created September 2, 2015 11:01
Export tables from CartoDB as CSV, the_geom being converted to latitude/longitude
[cartodb]
account_name=
api_key=
table_name=
columns=
[file]
name=
@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