Skip to content

Instantly share code, notes, and snippets.

View slattery's full-sized avatar

Mike Slattery slattery

View GitHub Profile
@slattery
slattery / query-aws-logs-insights.bash
Created February 6, 2022 18:12 — forked from dsmrt/query-aws-logs-insights.bash
Using AWS CLI to query CloudWatch Logs with Insights. Looking -30 mins to now.
aws logs start-query \
--profile clientProfile \
--log-group-name MY-LOG_GROUP \
--start-time `date -v-30M "+%s"` \
--end-time `date "+%s"` \
--query-string 'fields @message | filter @message like /my query/'
@slattery
slattery / index.html
Created December 13, 2021 22:32
wee images
<html>
<table>
<tbody>
<tr>
<td><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjuHDx2X8ACIMDh8l8Vc8AAAAASUVORK5CYII=" width="33" height="33"></td>
<td>6</td><td>#d0d1e6</td></tr>
<tr>
<td>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjWLb39n8AB4kDPi2Q/CYAAAAASUVORK5CYII=" width="33" height="33"></td>
<td>5</td><td>#a6bddb</td></tr>
@slattery
slattery / honortreeData20201221.geojson
Last active December 22, 2020 03:55
Locations for Yale Employee Milestone Trees
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 March 12, 2020 13:59
world map svgs from natural earth

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 March 6, 2020 17:44
topojson countries from 50m natural earth source
@slattery
slattery / README.md
Last active March 6, 2020 19:15
topojson landmasses from 50m natural earth source

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 March 6, 2020 17:30
topojson with regions, subregions, and countries from 50m natural earth source

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 February 7, 2020 14:37 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

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 20:36
pantheon-drops8ex-noci.mk
@slattery
slattery / .block
Last active April 16, 2019 13:32 — forked from HarryStevens/.block
World Tour
license: gpl-3.0