Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Slattery slattery

View GitHub Profile
@slattery
slattery / honortreeData20201221.geojson
Last active Dec 22, 2020
Locations for Yale Employee Milestone Trees
View honortreeData20201221.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slattery
slattery / README.md
Last active Mar 12, 2020
world map svgs from natural earth
View README.md

Bash script to generate world map svgs, with a given grouping highlighted by color. Since this is for groupings and not detail, the script removes Antarctica, subs in French Guiana as a unit removed from France, and uses the map-units version of France.

We loop over uniques for properties: CONTINENT SUBREGION REGION_WB REGION_UN

GeoJSON sources via: natural-earth-vector

Clues and Facilities: Mike Bostock's command line cartography series. You'll need to install the nodejs packages including:

npm install -g d3-geo-projection
@slattery
slattery / README.md
Created Mar 6, 2020
topojson countries from 50m natural earth source
View README.md
@slattery
slattery / README.md
Last active Mar 6, 2020
topojson landmasses from 50m natural earth source
View README.md

Source: https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_countries.geojson Clues: https://medium.com/@mbostock/command-line-cartography-part-2-c3a82c5c0f3 Example:

  ndjson-split 'd.features'  < ne_50m_admin_0_countries.geojson  \
  | ndjson-filter 'd.properties.SUBREGION == "South-Eastern Asia" || d.properties.SUBREGION == "Southern Asia" || d.properties.SUBREGION == "Northern Africa" || d.properties.REGION_WB == "Sub-Saharan Africa" || d.properties.REGION_WB == "Oceania" || d.properties.REGION_WB == "Latin America & Caribbean"' \
  | ndjson-filter 'd.properties = {ISO_A3: d.properties.ISO_A3, ISO_N3: d.properties.ISO_N3, REGION_UN: d.properties.REGION_UN, SUBREGION: d.properties.SUBREGION, NAME: d.properties.GEOUNIT, REGION_WB: d.properties.REGION_WB, CONTINENT: d.properties.CONTINENT }' \
  > ne50_studyarea.ndjson
  
@slattery
slattery / README.md
Last active Mar 6, 2020
topojson with regions, subregions, and countries from 50m natural earth source
View README.md

Source: https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_0_countries.geojson Clues: https://medium.com/@mbostock/command-line-cartography-part-2-c3a82c5c0f3 Commands:

ndjson-split 'd.features' \
 < ne_50m_admin_0_countries.geojson \
 | ndjson-filter 'd.properties.ISO_A3 !== "ATA"' \
 | ndjson-filter 'd.properties = {ISO_A3: d.properties.ISO_A3, ISO_N3: d.properties.ISO_N3, REGION_UN: d.properties.REGION_UN, SUBREGION: d.properties.SUBREGION, NAME: d.properties.GEOUNIT, REGION_WB: d.properties.REGION_WB, CONTINENT: d.properties.CONTINENT }' \
 | geo2topo -n countries=- \
@slattery
slattery / embedded-file-viewer.md
Created Feb 7, 2020 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive
View embedded-file-viewer.md

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@slattery
slattery / README.md
Last active May 13, 2019
pantheon-drops8ex-noci.mk
View README.md
@slattery
slattery / .block
Last active Apr 16, 2019 — forked from HarryStevens/.block
World Tour
View .block
license: gpl-3.0
@slattery
slattery / .block
Created Apr 5, 2019 — forked from dianaow/.block
Vega-lite: Stacked bar chart of US Army Infantry Casualties of Vietnam War
View .block
license: mit
View miz_spokes_lc.json
{
"nodes": [
{"group": 0, "id": "Climate Change and Sustainability", "radius": 15},
{"group": 0, "id": "Conservation", "radius": 3},
{"group": 0, "id": "Environmental Communications", "radius": 6},
{"group": 0, "id": "Environmental Policy, Policy Analysis, and Economics"},
{"group": 0, "id": "Forest Ecology and Management", "radius": 10},
{"group": 0, "id": "Urban Science and Practice", "radius": 6},
{"group":1, "id":"Center for Business and the Environment at Yale"},
{"group":1, "id":"Global Institute of Sustainable Forestry"},