This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Reads AirTag data from the FindMy.app cache and converts it to a daily GPX file | |
| # | |
| # Rsyncs the data to a web accessible folder that can be displayed with e.g. | |
| # https://gist.github.com/henrik242/84ad80dd2170385fe819df1d40224cc4 | |
| # | |
| # This should typically be run as a cron job | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 西元紀年改民國, 格式為七碼數字,民國100年前添加'0'前綴 | |
| CREATE OR REPLACE FUNCTION pg_temp.AD_to_formatted_ROC(date) RETURNS TEXT AS | |
| $$ | |
| SELECT LPAD( | |
| REPLACE( | |
| REPLACE( | |
| $1::text, to_char($1, 'YYYY'), (to_char($1, 'YYYY')::integer-1911)::TEXT | |
| ), '-', '' | |
| ), 7, '0') | |
| ; |