All your notes, scripts, config files and snippets deserve version control and tagging!
gist
is a simple bash script for gist management.
It is lightweight(~700LOC) and dependency-free! Helps you to boost coding workflow.
This file contains 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
data class DownloadItem( | |
val bytesDownloadedSoFar: Long = -1, | |
val totalSizeBytes: Long = -1, | |
val status: Int, | |
val uri: String | |
) | |
class DownloadProgressLiveData(private val activity: Activity) : | |
LiveData<List<DownloadItem>>(), | |
CoroutineScope { |
This file contains 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
package com.example.sample.offline | |
import android.util.Log | |
import java.io.BufferedReader | |
import java.io.ByteArrayOutputStream | |
import java.io.FileNotFoundException | |
import java.io.PrintStream | |
import java.net.ServerSocket | |
import java.net.Socket | |
import kotlin.math.pow |
This file contains 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
GITEA_DATA_DIR=/tmp/gitea |
用來產生Tile Number,格式可自己調整
https://chart.apis.google.com/chart?chst=d_text_outline&chs=256x256&chf=bg,s,00000044&chld=FFFFFF|32|h|000000|b|||x={x}|y={y}|z={z}||||______________
不過Mapzen已死,有事燒紙...
https://tile.mapzen.com/mapzen/vector/v1/{all/building/earth,landuse}/{z}/{x}/{y}.{mvt/topojson/json/vtm}?api_key=mapzen-Ka4PVaQ
This file contains 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
input/ | |
output/ | |
upload/ | |
**/.git |
This file contains 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
*.insp | |
*.jpg |
This file contains 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
.ONESHELL: | |
test: xmap.pgm ymap.pgm | |
ffmpeg -y -i test.jpg -i xmap.pgm -i ymap.pgm -filter_complex remap out.jpg | |
exiftool -UsePanoramaViewer=TRUE -ProjectionType="equirectangular" out.jpg | |
which SimplePanoramaViewer 2>/dev/null && SimplePanoramaViewer out.jpg | |
pgm: dualfisheye2equirectangular | |
cd $< | |
gcc -o projection projection.c -lm |
Upload OsmChange file with script
# By default, changeset would be uploaded to test server:
# https://master.apis.dev.openstreetmap.org
./osm.api.changeset.commit <OSC FILE>
# Use --serious to upload changeset to normal OSM server
./osm.api.changeset.commit --serious <OSC FILE>
This file contains 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
.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' $^ |
NewerOlder