Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Henrick clhenrick

View GitHub Profile
@clhenrick
clhenrick / script.js
Last active Oct 23, 2020
Persisting the removal of annoying stuff from web pages
View script.js
// In Chrome devtools, create live expressions for each of these code blocks
// https://developers.google.com/web/tools/chrome-devtools/console/live-expressions
// Now when you visit a page, no more annoying thing that will bother you!
// The annoying thing contains this text
const textToSearchFor = "foo"
// Filtering by searching for the above text here but you could filter other ways too
function filterFn(node) {
return node.textContent.includes(textToSearchFor);
@clhenrick
clhenrick / nyc_421a.sql
Last active Dec 26, 2019
Create table statement for NYC properties with 421a tax exemption status, using data from https://github.com/toolness/nyc-421a-xls
View nyc_421a.sql
DROP TABLE IF EXISTS nyc_421a;
CREATE TABLE nyc_421a (
years numeric,
borough_name varchar,
borough numeric,
neighborhood varchar,
building_class_category varchar,
tax_class_at_present varchar,
block numeric,
@clhenrick
clhenrick / get_assembly_districts.sh
Created Dec 3, 2019
California Assembly Districts GeoJSON using ogr2ogr
View get_assembly_districts.sh
#!/usr/bin/env bash
URI="https://services1.arcgis.com/sTaVXkn06Nqew9yU/ArcGIS/rest/services/Political_Boundaries_Feb2016/FeatureServer/1/query?&outfields=*&f=geojson&where=objectid%20is%20not%20null"
ogr2ogr -f GeoJSON ca_assembly_districts.json $URI OGRGeoJSON
@clhenrick
clhenrick / .block
Created May 8, 2019
D3 Scatterplot without data join
View .block
license: mit
@clhenrick
clhenrick / .block
Created May 7, 2019
Simple Scatterplot with d3@5
View .block
license: mit
View flowers.csv
sepal_length sepal_width petal_length petal_width species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
4.6 3.4 1.4 0.3 setosa
5.0 3.4 1.5 0.2 setosa
4.4 2.9 1.4 0.2 setosa
@clhenrick
clhenrick / README.md
Last active Jul 29, 2020
Aligning GeoJSON data with us-atlas TopoJSON
View README.md

This is a demonstartion of how to align arbitrary GeoJSON data to the us-atlas topojson data.

It's important to note that the TopoJSON from us-atlas has it's map projection, (d3.geoAlbersUsa), built into it. In other words, it is considered "projected" geographic data.

This is an important distinction from GeoJSON data which is most typically stored in the unprojected Coordinate Reference System WGS84, also commonly referred to as "lat, lon" (though coordinates are most often stored in the order longitude, latitude).

View prcl_shape_sample_4326.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@clhenrick
clhenrick / .block
Last active Dec 14, 2018
scale sqrt vs scale linear
View .block
license: mit
@clhenrick
clhenrick / .block
Last active Oct 16, 2018
Not So Simple graph with grid lines in v4...
View .block
license: mit
You can’t perform that action at this time.