Skip to content

Instantly share code, notes, and snippets.

View clhenrick's full-sized avatar

Chris Henrick clhenrick

View GitHub Profile
@jsanz
jsanz / README.md
Last active February 10, 2017 22:02
SQL: Postgis workshop

Postgis queries workshop

With this viewer you will have a sandbox space to try different PostGIS capabilities using several datasets. Change the SQL and press Control+S or Command+S and check the results on the map on the right.

You can also play with the styles on the CartoCSS pane.

Contents

Editing OSM Boundaries

##Task:

@almccon
almccon / README.md
Last active June 15, 2016 20:15 — forked from rochoa/README.md
turbo-cartocss examples

Color ramps: *-fill

Basic usage

marker-fill: ramp([column_name], colorbrewer(Greens));
                  |                    |
                  v                    |
      column to calculate ramp         |
                                       v
@andrewxhill
andrewxhill / batchAPI.py
Last active May 16, 2018 16:01
quick example of using the batch api over python
import sys
import urllib
import urllib2
import json
import requests
# Start a new batch SQL task
def cartoBatchQuery(username, api_key, sql):
r = requests.post('http://%s.cartodb.com/api/v2/sql/job?api_key=%s' %(username,api_key),
headers={'content-type':'application/json'},
@ebrelsford
ebrelsford / index.html
Created April 27, 2016 14:55
Blur a Leaflet map with html2canvas and StackBlur
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.0-alpha2/html2canvas.min.js"></script>
<script src="https://cdn.rawgit.com/flozz/StackBlur/master/dist/stackblur.min.js"></script>
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<style>
html, body {
margin:0;
@olih
olih / jq-cheetsheet.md
Last active April 22, 2025 04:14
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@biovisualize
biovisualize / README.md
Last active September 20, 2024 08:13
d3.selection.appendHTML and appendSVG

Parse and append an HTML or SVG string. I use it a lot for appending a template, instead of generating it with d3.

d3.select('.container').appendHTML('<div><svg><g><rect width="50" height="50" /></g></svg></div>');

Unlike using .html, .appendHTML can append multiple elements

d3.select('.container').html('<span id="a"></span>');
d3.select('.container').html('<span id="b"></span>'); // will replace content
d3.select('.container').appendHTML('<span id="c"></span>'); // will append content
@rochoa
rochoa / README.md
Last active August 4, 2017 04:59
[CARTO] turbo-cartocss examples

Color ramps: *-fill

Basic usage

marker-fill: ramp([column_name], colorbrewer(Greens));
                  |                    |
                  v                    |
      column to calculate ramp         |
                                       v
@danswick
danswick / index.html
Last active April 15, 2019 02:56
3rd party raster tiles in Mapbox GL JS
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.4/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.4/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@rgdonohue
rgdonohue / README.md
Last active January 11, 2023 21:43
Batch Geocoding Script with GeoPy