Skip to content

Instantly share code, notes, and snippets.

View 1ec5's full-sized avatar
🙈
Not actively reading bugmail

Minh Nguyễn 1ec5

🙈
Not actively reading bugmail
View GitHub Profile
#!/usr/bin/env bash
wget https://geonames.usgs.gov/docs/stategaz/AllStates.zip
unzip AllStates.zip
wget https://geonames.usgs.gov/docs/stategaz/AllNames.zip
unzip AllNames.zip
sed $'1s/\xef\xbb\xbf//' AllNames_20210825.txt | csvformat -d '|' > allnames.csv
csvgrep -c FEATURE_NAME_OFFICIAL -m Y -i allnames.csv | csvcut -c 'FEATURE_ID,FEATURE_NAME,CITATION' | sed '1s/FEATURE_NAME/FEATURE_NAME_UNOFFICIAL/' > allnames_unofficial.csv
@1ec5
1ec5 / college_corner.svg
Last active March 28, 2022 09:25
Ohio boundary edge cases
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@1ec5
1ec5 / naics2012.tsv
Last active February 4, 2022 03:03
NAICS to OSM
Seq. No. 2012 NAICS US Code 2012 NAICS US Title OSM tags
1 11 Agriculture, Forestry, Fishing and Hunting
2 111 Crop Production landuse=farm OR landuse=farmland
3 1111 Oilseed and Grain Farming
4 11111 Soybean Farming crop=soy
5 111110 Soybean Farming
6 11112 Oilseed (except Soybean) Farming
7 111120 Oilseed (except Soybean) Farming
8 11113 Dry Pea and Bean Farming
9 111130 Dry Pea and Bean Farming
@1ec5
1ec5 / cincinnati.geojson
Last active January 21, 2022 08:14
Cincinnati metropolitan area
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@1ec5
1ec5 / coord_order.md
Last active November 10, 2021 22:24
Order in the coord

Coordinate order in various Mapbox libraries

Legend:

  • ✅ Behaves correctly at runtime
  • ❌ Compile-time or runtime error or otherwise impossible to write
  • 🙀 Behaves incorrectly at runtime
Mapbox-related library Latitude, longitude Longitude, latitude Order-independent
@1ec5
1ec5 / lanes.py
Last active September 16, 2021 17:58
Draw lane icon based on inputs
#!/usr/bin/env python
primaryColor = 0
secondaryColor = 0
availableLaneNames = [
"lane opposite slight turn or slight turn using slight turn",
"lane opposite slight turn or slight turn",
"lane opposite slight turn or straight or slight turn using slight turn",
"lane opposite slight turn or straight or slight turn using straight",
"lane opposite slight turn or straight or slight turn",
@1ec5
1ec5 / Locales.swift
Created September 15, 2021 23:43
Available locales on iOS 14.4
import Foundation
print(Locale.availableIdentifiers
.map { Locale.init(identifier: $0.replacingOccurrences(of: "_", with: "-")) }
.map { "\($0.identifier)\t\(Locale(identifier: "en-US").localizedString(forIdentifier: $0.identifier) ?? "")" }
.sorted()
.joined(separator: "\n"))
@1ec5
1ec5 / extract.sh
Created May 25, 2021 05:02
SDP PDFs by category
#!/bin/bash
ls -1 pdfs_by_category | sed 's/^\(.*\)\.txt/mkdir -p "extracts\/\1"/' | bash
function download_category {
cd "extracts/$1"
cat "../../pdfs_by_category/$1.txt" | xargs -L 1 wget
cd -
}
Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "MapboxCoreNavigation"
s.version = '2.0.0-alpha.3.1'
s.summary = "Core components for turn-by-turn navigation on iOS."
s.description = <<-DESC
Mapbox Core Navigation provides the core spatial and timing logic for turn-by-turn navigation along a route. For a complete turn-by-turn navigation interface, use the Mapbox Navigation SDK for iOS (MapboxNavigation).
@1ec5
1ec5 / othertypes.tsv
Last active November 18, 2020 11:08
Business type descriptions for other businesses in Santa Clara County Social Distancing Protocol database
url typeofbusinessother
https://saesdp.sccgov.org/sdpdocs/3174340-SocialDistancingProtocolForm.pdf Streaming and outdoor production services
https://saesdp.sccgov.org/sdpdocs/3175907-SocialDistancingProtocolForm.pdf Farmer Market Vendor
https://saesdp.sccgov.org/sdpdocs/3172996-SocialDistancingProtocolForm.pdf Plumbing Company
https://saesdp.sccgov.org/sdpdocs/3174872-SocialDistancingProtocolForm.pdf Bakery
https://saesdp.sccgov.org/sdpdocs/3165898-SocialDistancingProtocolForm.pdf Quarry
https://saesdp.sccgov.org/sdpdocs/3174815-SocialDistancingProtocolForm.pdf ancillary hospital care
https://saesdp.sccgov.org/sdpdocs/3175499-SocialDistancingProtocolForm.pdf architecture
https://saesdp.sccgov.org/sdpdocs/3175068-SocialDistancingProtocolForm.pdf office
https://saesdp.sccgov.org/sdpdocs/3175860-SocialDistancingProtocolForm.pdf Home Bakery