Skip to content

Instantly share code, notes, and snippets.

View jsanz's full-sized avatar
🗺️
Mapping

Jorge Sanz jsanz

🗺️
Mapping
View GitHub Profile
@andy-esch
andy-esch / index.html
Last active August 29, 2015 14:19
custom hoverwindows using callback objects
<!DOCTYPE html>
<html>
<head>
<title>
customhoverwindows | CartoDB
</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
@chriswhong
chriswhong / getCurrentView.js
Last active August 29, 2015 14:21
Leaflet initial view helper
//Logs current map center and zoom level for use in map init options
//Use it to find that perfect intial view without having to use trial and error
map.on('dragend',getInit).on('zoomend',getInit);
function getInit() {
var c = map.getCenter();
console.log('center: [' + c.lat + ',' + c.lng + '],\nzoom: ' + map.getZoom());
}
@chriswhong
chriswhong / cartocssmaker.js
Created May 27, 2015 15:26
Torque CartoCSS Maker
//node script for generating complex cartoCSS for torque
//as value increases, duration of marker gets longer,
//radius gets larger, and color moves up the ramp.
var breaks = [0,10,50,100]
var colors = ['#eff3ff','#bdd7e7','#6baed6','#2171b5'];
var data = {
"tableName":"#nepaltrends",
"valueCondition":0,
@andrewxhill
andrewxhill / change_log.sql
Last active August 29, 2015 14:23
Create a table to store changes from any of your tables in a log table.
--
-- Create a table in your CartoDB editor called 'version_control'
-- Run the following SQL in your editor to create the needed columns
--
ALTER TABLE version_control ADD COLUMN data json;
ALTER TABLE version_control ADD COLUMN source_id integer;
ALTER TABLE version_control ADD COLUMN table_name text;
ALTER TABLE version_control ADD COLUMN tg_op text;
@auremoser
auremoser / hasadna.md
Last active August 29, 2015 14:24
Hasadna Workshop

Hasadna: Pollution Mapping + CartoDB

Aurelia Moser, CartoDB Workshop - Hasadna, IL

July 6, 2015

Find this document here:

  • Stackedit:
@javisantana
javisantana / speed.sql
Created August 12, 2015 11:05
speed from a track table
WITH deltas as (
SELECT
st_distance(the_geom::geography, lag(the_geom::geography, 1) over(order by timestamp)) as ddist,
timestamp - lag(timestamp, 1) over(order by timestamp) as dt
from out_2 offset 1000
)
select avg(ddist/dt) as speed from deltas
@andrewxhill
andrewxhill / harvest_a_game.ipynb
Last active September 1, 2015 12:38
Use Goldberry to harvest a single basketball game and push it to CartoDB. WARNING This will pull ~2-3,000,000 points, so probably not for your typical free CartoDB account :)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Introduction to the CartoDB interface

This page can always be found at: http://bit.ly/cdb-harvard

  • Tour of dashboard
  • Common data
  • Uploading data
  • Tour of table and map view
  • Publishing maps
  • Public profile
@oscarfonts
oscarfonts / review.sh
Created June 3, 2012 18:43
Script per automatitzar la revisió de traduccions d'OSGeo-Live
###########################################################################
# Script per automatitzar la revisió de traduccions d'OSGeo-Live
###########################################################################
#
# Converteix a UTF8, treu el BOM, converteix CRLF a UNIX, copia els nous
# continguts al checkout local del repo, compila els html i els obre en FF.
#
# Llavors cal: revisar l'aspecte visual de cada document, corregir-lo si
# convé, i fer 'svn commit'.
#
@acanimal
acanimal / gist:4183609
Created December 1, 2012 17:59
SublimeText2 current user preferences
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_size": 10,
"highlight_line": true,
"rulers": [80,120],
"draw_minimap_border": true
}