Skip to content

Instantly share code, notes, and snippets.

View andrewxhill's full-sized avatar

Andrew W. Hill andrewxhill

View GitHub Profile
/* Change the styles below in order to customize your template */
body{font-family: Helvetica, Arial; font-weight: regular; font-size: 15px; color: #CBCBCB; background-color: #333}
h1{font-weight: bold; font-size: 31px; letter-spacing: -1px; color: #FFF; line-height: 33px; *margin-top:20px;}
h3{font-weight: bold; font-size: 12px; color: #777; text-transform: uppercase; margin: 10px 0 0 0;}
p{margin: 8px 0 20px 0; line-height: 18px;}
a, a:visited{color: #72B6E5; text-decoration: none;}
a:hover{text-decoration: underline;}
.context{font-family: Helvetica, Arial; font-size: 13px; color: #999; padding: 10px 0 0 0;}
<!DOCTYPE html>
<html>
<head>
<title>Template tester</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, #container {
height: 100%;
@andrewxhill
andrewxhill / index.html
Last active August 29, 2015 14:01
small multiples using many maps
<!DOCTYPE html>
<html>
<head>
<title>Leaflet multilayer example | 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 {
height: 100%;
@andrewxhill
andrewxhill / cartocss.css
Created June 2, 2014 18:19
size by column sum
Map {
-torque-frame-count:128;
-torque-animation-duration:30;
-torque-time-attribute:"time_column";
-torque-aggregation-function:"sum(whatever_column)";
-torque-resolution:2;
-torque-data-aggregation:"cumulative";
}
#table_name {

Part 2

Gilt data

The data

This dataset contains a selection of Gilt transaction data

SELECT count(*) FROM gilt_purchase_data
```
-title: "Captain Cook"
-author: "@andrewxhill"
-vizjson: "http://andrew.cartodb.com/api/v2/viz/4ffc80c6-f005-11e3-a32e-0e73339ffa50/viz.json"
- steps: 256
-baseurl: "http://{s}.api.cartocdn.com/base-midnight/{z}/{x}/{y}.png"
```
# Captain Cook
```
<!doctype><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odyssey.js Scroll</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="http://cartodb.github.io/odyssey.js/editor/favicon.png">
<link rel="icon" type="image/png" href="http://cartodb.github.io/odyssey.js/editor/favicon.png">
@andrewxhill
andrewxhill / index.html
Last active August 29, 2015 14:02
Default map from tablename / username
<!DOCTYPE html>
<html>
<head>
<title>Easy example | 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 {
height: 100%;
@andrewxhill
andrewxhill / index.html
Last active August 29, 2015 14:02
County selector example
<!DOCTYPE html>
<html>
<head>
<title>County Selector</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 {
height: 100%;
@andrewxhill
andrewxhill / notes.md
Created June 23, 2014 19:16
Course notes
  • import file
  • explore table and map
  • Reclaim some space!
update nyct2010 set the_geom = ST_SimplifyPreserveTopology(the_geom, 0.0003)