Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Henrick clhenrick

View GitHub Profile
View 421a_exempt_stabilzed.sql
select sum(pluto_apts) apts_421a_in_pluto,
sum (registered_stabilized_apts) apts_421a_registered_stabilized
from exempt_stabilized;
apts_421a_in_pluto | apts_421a_registered_stabilized
--------------------+---------------------------------
79018 | 51312
/* find all properties with 421a or rent stabilization */
SELECT *
@clhenrick
clhenrick / index.html
Last active Aug 29, 2015
Triggering openPopup() with an AnimatedMarker in Leaflet
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://rawgithub.com/openplans/Leaflet.AnimatedMarker/master/src/AnimatedMarker.js"></script>
<script src="http://rawgithub.com/makinacorpus/Leaflet.GeometryUtil/master/dist/leaflet.geometryutil.js"></script>
View Git Flow.md

Git Flow

I keep meeting people who struggle to wrap their heads around the proper way to use Git + Github. This snippet is designed to explain Vincent Driessen's git branching model, at least as well as I understand it. Speacial thanks to Stephen Koch for being the true master here.

This tutorial is for Linux or OSX. Feel free to use Cygwin or write a fork for windows.

A way to think about Git and Github.

View Sublime Text 2 HTML5 Boilerplate Snippet
<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 Aug 29, 2015
Example showing how to load layers in Cartodb and turn them on / off.
View index.html
<!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 Jun 12, 2014
An Odyssey JS scroll example
View odyssey-scroll-example
```
-title: "The voyage of the Beagle"
-author: "@clhenrick"
```
#The Voyage of the HMS Beagle
```
- center: [50.343, -4.143]
- zoom: 2
```
View earthquakes.json
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 Aug 29, 2015
template markdown table
View cbd_data-table_tracker
##### CartoDB Table Name
| Coverage | Geometry Type | Source | Original Source URL | Date Created | Date Modified | Modified By | Meta Data Wiki |
|--------------------|---------------|--------|---------------------|--------------|---------------|-------------|----------------|
| | | | | | | | |
| | | | | | | | |
View global_province_synonym_queries
-- 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 / index.html
Last active Aug 29, 2015
mfa bootcamp day 2 demo code
View index.html
<!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">
You can’t perform that action at this time.