Skip to content

Instantly share code, notes, and snippets.

View typebrook's full-sized avatar
💭
Adapting new job

Hsieh Chin Fan typebrook

💭
Adapting new job
View GitHub Profile
@typebrook
typebrook / Makefile
Last active May 21, 2025 08:51
get dataset from MoEnv
.ONESHELL:
# dataset from moenv: https://data.gov.tw/dataset/8817
pollution.csv:
curl -o $@ 'https://data.moenv.gov.tw/api/v2/gisepa_p_24?api_key=9e565f9a-84dd-4e79-9097-d403cae1ea75&limit=1000&sort=ImportDate%20desc&format=CSV'
# 神祕的來源: https://newcdx.moenv.gov.tw/api/files/WR_P_244/41679057-4366-4493-9c39-32f89c8281af
disposal.tmp.zip:
curl -o $@ https://newcdx.moenv.gov.tw/api/files/WR_P_244/41679057-4366-4493-9c39-32f89c8281af
@typebrook
typebrook / Makefile
Created April 10, 2025 08:09
get data from mine.geologycloud.tw
.ONESHELL:
MineArea.geojson:
curl 'https://mine.geologycloud.tw/data/get_minedetail' \
-X POST \
--data-raw 'layerClass=system_public&layerKey=MineArea' | \
jq . >MineUseArea.geojson
MineUseArea.geojson:
curl 'https://mine.geologycloud.tw/data/get_minedetail' \
@typebrook
typebrook / .gitignore
Last active May 2, 2025 02:00
Nomalized dataset of Taiwan Address for Great-Recall
dataset/*
!dataset/*md5
address/
*.pmtiles
*.mbtiles
*.json
*.zip
*.shp
*.shx
*.cpg
*.dbf
*.prj
tmp.*
tiles.list
@typebrook
typebrook / .gitignore
Last active March 13, 2025 09:59
nchdb.boch.gov.tw
!example*
@typebrook
typebrook / Makefile
Created February 14, 2025 09:51
Private power plant in Taiwan
.ONESHELL:
ZIP=power.private.zip
REMOTE=vps:/srv/riverbien/2025-02-14_民營電廠/
osm.list: bound.osm.geojson
jq -r '.features[]|.properties|select(.["@id"]|test("relation.*"))|.name' $< | sort -u >$@
gov.list: plant.solar.sort.csv
@typebrook
typebrook / list
Last active January 19, 2025 13:11
Get user location of Maplibre Voting members
adrian-cojocaru
acalcutt
alanchenboy
alexcristici
ambientlight
alasram
archdoog
atierian
bchapuis
bdon
@typebrook
typebrook / .gitignore
Last active February 10, 2025 09:01
extract power facilities in Taiwan from OSM
*.pbf
*.osm
*.pmtiles
*.shp/**
*.bak
@typebrook
typebrook / hyphenate.sh
Last active January 16, 2025 09:44
hyphenate name of taiwan town
#! /bin/bash
shopt -s nocasematch
declare -a syllables
sed 1d 鄉鎮市區.csv | \
while IFS=, read county district place symbol; do
read name suffix <<<"${place}"
name=${name^^}
@typebrook
typebrook / Makefile
Created February 20, 2023 04:29
Print ics parts of Taiwan holidays from open data #gov #ics #icalendar
.ONESHELL:
# https://data.gov.tw/dataset/14718
data.csv:
curl -L 'https://www.dgpa.gov.tw/FileConversion?filename=dgpa/files/202206/d52179b9-5e82-489b-86fd-716e959bfa5c.csv&nfix=&name=112%e5%b9%b4%e4%b8%ad%e8%8f%af%e6%b0%91%e5%9c%8b%e6%94%bf%e5%ba%9c%e8%a1%8c%e6%94%bf%e6%a9%9f%e9%97%9c%e8%be%a6%e5%85%ac%e6%97%a5%e6%9b%86%e8%a1%a8.csv' | \
iconv -f BIG-5 -t UTF-8 | \
dos2unix >$@
clean: data.csv
sed -i '1d; /,$$/d' $^