Skip to content

Instantly share code, notes, and snippets.

Minh Nguyễn 1ec5

View GitHub Profile
View 9-legged-route.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@1ec5
1ec5 / acgov.sh
Created May 23, 2020
Update the Wikimedia Commons table of COVID-19 cases in Berkeley and Alameda County, California
View acgov.sh
#!/bin/bash
# Fetch the current table as JSON
curl 'https://commons.wikimedia.org/wiki/Data:COVID-19_cases_in_Alameda_County,_California.tab?action=raw' > commons.json
# Fetch cases and deaths by day from the API
curl 'https://services3.arcgis.com/1iDJcsklY3l3KIjE/arcgis/rest/services/AC_dates/FeatureServer/0/query?where=1%3D1&outFields=Date,BkLHJ_Cases,BkLHJ_CumulCases,BkLHJ_Deaths,BkLHJ_CumulDeaths,ACLHJ_Cases,ACLHJ_CumulCases,ACLHJ_Deaths,ACLHJ_CumulDeaths,AC_Cases,AC_CumulCases,AC_Deaths,AC_CumulDeaths&outSR=4326&f=json' > dates.json
# Fetch hospitalizations by day from the API
curl 'https://services3.arcgis.com/1iDJcsklY3l3KIjE/arcgis/rest/services/AC_hospitalized2/FeatureServer/0/query?where=1%3D1&outFields=Date,Hospitalized_COVID_19_Positive_&outSR=4326&f=json' > hosp.json
@1ec5
1ec5 / datasf_covid19.sh
Last active May 18, 2020
Update the Wikimedia Commons table of COVID-19 cases in the City and County of San Francisco
View datasf_covid19.sh
#!/bin/bash
# Fetch the current table as JSON
curl 'https://commons.wikimedia.org/wiki/Data:COVID-19_cases_in_San_Francisco.tab?action=raw' > commons.json
# Fetch the new cases and deaths by day from the API
curl https://data.sfgov.org/resource/tvq9-ec9w.json > tvq9-ec9w.json
# Convert date from full timestamp to YYYY-MM-DD
# Pivot on dates as rows and counts by case disposition as columns
@1ec5
1ec5 / sccphd_covid19.sh
Last active May 10, 2020
Update the Wikimedia Commons table of COVID-19 cases in Santa Clara County, California
View sccphd_covid19.sh
#!/bin/bash
# Fetch the current table as JSON
curl 'https://commons.wikimedia.org/wiki/Data:COVID-19_Cases_in_Santa_Clara_County,_California.tab?action=raw' > commons.json
# Fetch the new cases by day from the dashboard
# Convert date from number of milliseconds to YYYY-MM-DD
# Fill in counts repeated from previous days, which are indicated by C = null, R = 2
# Calculate a running total
curl 'https://wabi-us-gov-virginia-api.analysis.usgovcloudapi.net/public/reports/querydata' --compressed --data '{"version":"1.0.0","queries":[{"Query":{"Commands":[{"SemanticQueryDataShapeCommand":{"Query":{"Version":2,"From":[{"Name":"c","Entity":"cases_date"}],"Select":[{"Column":{"Expression":{"SourceRef":{"Source":"c"}},"Property":"Date"},"Name":"cases_date.Date"},{"Aggregation":{"Expression":{"Column":{"Expression":{"SourceRef":{"Source":"c"}},"Property":"New_cases"}},"Function":0},"Name":"Sum(cases_date.New_cases)"}]},"Binding":{"Primary":{"Groupings":[{"Projections":[0,1]}]},"DataReduction":{"DataVolume":4,"Primary":
@1ec5
1ec5 / Main.storyboard
Last active Oct 10, 2019
Draft attribution guidelines simulation
View Main.storyboard
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
View aer2x3dom.js
function anchorOnMouseOver(evt) {
var div = document.getElementsByClassName("x3dom-canvasdiv")[0];
div.style.cursor = "pointer";
alert("in");
}
function anchorOnMouseOut(evt) {
var div = document.getElementsByClassName("x3dom-canvasdiv")[0];
div.style.cursor = "move";
alert("out");
@1ec5
1ec5 / speed-limit-countries.geojson
Created Jul 16, 2019
Speed limit sign styles and units
View speed-limit-countries.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@1ec5
1ec5 / 2016.geojson
Created Jul 9, 2019
IndianaMap orthoimagery coverage area
View 2016.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@1ec5
1ec5 / AppDelegate.h
Last active May 13, 2019
SceneKit ❤️ Mapbox Maps SDK
View AppDelegate.h
@import Cocoa;
@interface AppDelegate : NSObject <NSApplicationDelegate>
@end
@1ec5
1ec5 / wikidata-brand.md
Last active Mar 21, 2019
Adding a Wikidata item for a retail chain
View wikidata-brand.md
  1. Go to Special:NewItem on Wikidata. Select the language in which the chain’s name is written, then enter the chain’s name and a short description in that language (if you speak it). For example, a description in English might be “American fast food chain”. Click Create.
  2. Under “Statements”, click “+ add statement”, then type “instance of” into the Property field.
  3. In the next field, enter one of the following values, then click Publish. If you know a more specific entity, you can use it instead.
OSM tag Value
amenity=bank Q22687
amenity=bicycle_rental Q1358919
amenity=bureau_de_change Q2002539
amenity=cafe ?
You can’t perform that action at this time.