Skip to content

Instantly share code, notes, and snippets.

View clhenrick's full-sized avatar

Chris Henrick clhenrick

View GitHub Profile
@clhenrick
clhenrick / index.html
Last active August 19, 2018 09:19
D3JS GeoJSON Scale and Translate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 NYC Geo Test</title>
</head>
<style type="text/css">
body {
margin: 0;
padding: 0;
<snippet>
<content><![CDATA[<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>${1:Project Name}</title>
@clhenrick
clhenrick / index.html
Last active August 29, 2015 14:02
Example showing how to load layers in Cartodb and turn them on / off.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>CartoDB.JS Demo</title>
<meta name="description" content="">
@clhenrick
clhenrick / odyssey-scroll-example
Created June 12, 2014 00:32
An Odyssey JS scroll example
```
-title: "The voyage of the Beagle"
-author: "@clhenrick"
```
#The Voyage of the HMS Beagle
```
- center: [50.343, -4.143]
- zoom: 2
```
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@clhenrick
clhenrick / cbd_data-table_tracker
Last active August 29, 2015 14:03
template markdown table
##### CartoDB Table Name
| Coverage | Geometry Type | Source | Original Source URL | Date Created | Date Modified | Modified By | Meta Data Wiki |
|--------------------|---------------|--------|---------------------|--------------|---------------|-------------|----------------|
| | | | | | | | |
| | | | | | | | |
@clhenrick
clhenrick / global_province_synonym_queries
Last active August 29, 2015 14:04
split column into rows
-- split the name_alt column into new rows using `|` as a delimiter and insert into global_province_synonyms table as new rows
-- to do: do a `IS NOT null` check?
-- note: you have to escape the | character as it is reserved in Postgres
INSERT INTO global_province_synonyms (name, rank, woe_id, country_iso3)
SELECT
regexp_split_to_table(global_province_polygons.name_alt, E'\\|' ) AS name,
1, woe_id, iso3
FROM
global_province_polygons
@clhenrick
clhenrick / cafe-18.svg
Last active May 1, 2018 08:31
Load an SVG from an external page
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@clhenrick
clhenrick / index.html
Last active August 29, 2015 14:04
mfa bootcamp day 2 demo code
<!DOCTYPE html>
<!-- the root tag, everything must go in here -->
<html>
<!-- meta information about our page as well as external links and styles -->
<head>
<!-- specify the character encoding of our page -->
<meta charset="utf-8">
@clhenrick
clhenrick / index.html
Last active August 29, 2015 14:04
mfa bootcamp day 3 demo code
<!doctype HTML>
<html>
<head>
<meta charset="utf-8">
<title>Day 02: CSS</title>
<link rel="stylesheet" type="text/css" href="./styles.css"> <!-- I modified the path here so the css file will show up on the live code -->
</head>
<body>
<a href="http://cartodb.com/">CartoDB</a> is Awesome!