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
<?php | |
// usage: | |
// http://.../gecko.pgp??q=bitcoin,ethereum,solana,polkadot | |
// or | |
// http://.../gecko.pgp??q=mycrypto.csv | |
// where mycrypto.csv contains the id of a coin on each line. | |
// Find the exact id of your coin in this list: | |
// https://api.coingecko.com/api/v3/coins/list | |
// See this doc for more info: |
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/python3 | |
# multicast netcat | |
# https://newtoypia.blogspot.com/2021/09/netcat.html | |
# 齊步走! 用 netcat 同步指揮教室裡的所有電腦 | |
import argparse, sys, re, readline | |
from warnings import warn | |
from subprocess import Popen, PIPE |
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/python3 | |
import argparse, os, re | |
from warnings import warn | |
import subprocess | |
parser = argparse.ArgumentParser( | |
description='invoke pocketsphinx and produce keystrokes', | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
parser.add_argument('-k', '--kwokfn', type=str, default='', |
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/python3 | |
# for f in *.xml ; do xq . $f > ${f/%xml/json} ; done | |
# python3 prj2html.py *.json > new.html | |
# 詳見 https://newtoypia.blogspot.com/2021/09/xml-js-jq-rss.html | |
import argparse, json, re | |
from warnings import warn |
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/python3 | |
# https://github.com/pyexcel/pyexcel-ods/issues/41 | |
# pyexcel-ods issue: use "<text:p>" instead of "<text:line-break/>" for newlines (line breaks) in cells | |
import argparse, re, sys, json | |
from pyexcel_ods3 import save_data | |
from warnings import warn | |
parser = argparse.ArgumentParser( | |
description='read many text files into two columns of an ods file, with filenames as the key column and contents as the value column', |
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/python3 | |
# https://newtoypia.blogspot.com/2021/05/android-app-size.html | |
# 揪出手機上的腫脹軟體: android app 佔用空間大小散點圖 | |
import argparse, fileinput, re, json | |
parser = argparse.ArgumentParser( | |
description='print android app size as .csv: adb shell dumpsys diskstats | aasize.py', | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
parser.add_argument('files', nargs='*', help='files') |
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/python3 | |
# https://stackoverflow.com/a/66546687 | |
# https://newtoypia.blogspot.com/2021/05/ffmpeg.html | |
# 一口氣串接爆多影片? ffmpeg 拯救可憐的手指 | |
import argparse, subprocess, re | |
def gen_filter(segments, effect='fade', duration=0.3): | |
video_fades = '' | |
# fail! audio_fades = '\\\n[0:a]aresample=async=1;' |
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/python3 | |
# convert the output (as json) of | |
# https://github.com/iamcal/SQLParser | |
# to the input of | |
# https://github.com/BurntSushi/erd | |
# or to the input of | |
# https://github.com/ehne/ERDot | |
# | |
# For example, suppose you have ~/sakila-schema.sql from https://downloads.mysql.com/docs/sakila-db.tar.gz |
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
#!/bin/sh | |
# a hackish script to convert this MS sql server script: | |
# https://www.dofactory.com/sql | |
# to a sqlite script | |
# | |
# usage: | |
# 1. ./ms2sqlite.sh sample-model.sql > model-sqlite.sql | |
# 2. edit model-sqlite.sql and manually: | |
# 2.1 remove all the "if exists ..." |