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
#!/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 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 | |
# coding=utf-8 | |
# -*- coding: utf-8 -*- | |
# example output at umap: https://umap.openstreetmap.fr/zh-tw/map/python3-gj-voronoipy-tkecgeojson_774525 | |
import argparse, scipy, warnings, json, scipy.spatial, math | |
import numpy as np | |
def voronoi(data): | |
if type(data) is dict: |
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
body { color: #000; background: #ffd; } | |
.center { text-indent: 0; text-align: center; } | |
.right { text-indent: 0; text-align: right; } | |
/* https://www.geeksforgeeks.org/how-to-create-an-html-checkbox-with-a-clickable-label/ */ | |
input[type=checkbox] { display: none } | |
.for-checkbox { | |
background-color: #eec; |
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
<?php | |
# 範例參數: | |
# bus-pos.php?line=Taichung/151 | |
# 其他城市名稱請見 | |
$QS = array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER["QUERY_STRING"] : ''; | |
parse_str($QS, $Q); | |
# $Q = array( | |
# 'line' => 'Taichung/151' | |
# ); |
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
#!/usr/bin/perl -w | |
# plurk mail summary | |
# plurk-sent mail | |
# => *.mbox (by gmail) | |
# => *.html (by hypermail) | |
# => *.txt (by lynx -dump) | |
# => plk-ms.perl | |
# e.g. | |
# hypermail -m plurk.mbox -d plurk | |
# for f in plurk/????.html ; do lynx -dump $f | perl plk-ms.perl ; done | sort > ~/plurk-summary.txt |
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
# Enter a python3 interpreter. Then do this: | |
# exec(open('linespector.py').read()) | |
# And try, line by line, the commented out code at the end. | |
# Wonderful reference: | |
# https://cosmocode.io/how-to-connect-selenium-to-an-existing-browser-that-was-opened-manually/ | |
# ( found from here: https://stackoverflow.com/a/70088095 ) | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options |
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
# This is an experimental piece of code for reading messages | |
# from the "line" messaging app as an extension of chrome. | |
# https://chrome.google.com/webstore/detail/line/ophjlpahpchlmihnnnihgmmeilfjmjjc?hl=zh-TW | |
# My linux is LMDE 5 (elsie), and my chromium is 113.0.5672.63, | |
# directly installed with apt install. | |
# I have also done: | |
# pip3 install selenium webdriver-manager beautifulsoup4 | |
# To use this program: | |
# 0. Create a line account if you don't have one. | |
# Note: Line is control-hungry. |
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
iso3 | m49 | owid_name | other_name | reg1 | reg2 | continent | region_type | is_historical | defined_by | |
---|---|---|---|---|---|---|---|---|---|---|
ABW | 533 | Aruba | Aruba | Caribbean | Latin America and the Caribbean | North America | country | False | owid | |
AFG | 4 | Afghanistan | Afghanistan | Southern Asia | Asia | country | False | owid | ||
AGO | 24 | Angola | Angola | Middle Africa | Sub-Saharan Africa | Africa | country | False | owid | |
AIA | 660 | Anguilla | Anguilla | Caribbean | Latin America and the Caribbean | North America | country | False | owid | |
ALA | 248 | Åland Islands | Aland Islands | Northern Europe | Europe | country | False | owid | ||
ALB | 8 | Albania | Albania | Southern Europe | Europe | country | False | owid | ||
AND | 20 | Andorra | Andorra | Southern Europe | Europe | country | False | owid | ||
ANT | Netherlands Antilles | country | True | owid | ||||||
ARE | 784 | United Arab Emirates | United Arab Emirates | Western Asia | Asia | country | False | owid |
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
#!/usr/bin/python3 | |
import argparse, sys, os, atexit | |
from ansi import cursor | |
from ansi.color import fg, bg, fx | |
from time import sleep | |
# manual fix for ansi.cursor.erase | |
from ansi.sequence import sequence | |
cursor.erase = sequence('2J') |
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
#!/usr/bin/python3 | |
import argparse, sys | |
from time import sleep | |
from ansi.color import fg, bg, fx | |
import ansi.cursor as cr | |
# from playsound import playsound | |
def show_msg(msg): | |
seq = ( |
NewerOlder