Skip to content

Instantly share code, notes, and snippets.

cnmzdk
delete
djx
ethan2000
ewuzxl
extrastu
fack
feiyu
feng
forfunfor
@alexkuang0
alexkuang0 / mweb-solarized-light-alexkuang0-mod.css
Last active January 13, 2021 08:01
MWeb Preview CSS mod for better PDF export and font size consistency.
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
@alexkuang0
alexkuang0 / use-alexs-lan-play-server.md
Last active January 13, 2021 07:59
(Deprecated) Use Alex's lan-play server on macOS

Install lan-play on macOS

You can either download compiled binary or compile it from source yourself.

Download compiled binary

Go to http://lan-play.com/download

The GitHub releases page currently doesn't provide compiled binary for macOS

@alexkuang0
alexkuang0 / Brewfile
Created January 13, 2021 07:57
My Homebrew dump file.
tap "beeftornado/rmtree"
tap "homebrew/bundle"
tap "homebrew/cask", "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git"
tap "homebrew/cask-drivers", "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git"
tap "homebrew/cask-fonts", "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git"
tap "homebrew/cask-versions", "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git"
tap "homebrew/core", "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
tap "homebrew/services"
brew "asciinema"
brew "bat"
@alexkuang0
alexkuang0 / calc_hexagram.py
Last active April 22, 2020 20:18
Calculate Hexagram for Ancient Chinese divination. (易经六十四卦)
from random import randint
results = []
for i in range(0,6):
sum = 0
for i in range(0,3):
sum += randint(2, 3)
results.append(sum)
for res in reversed(results):
@alexkuang0
alexkuang0 / thor-downloader.py
Last active April 3, 2020 08:57
thor-downloader
import requests
from bs4 import BeautifulSoup
main_url = "https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=3569"
main_page = BeautifulSoup(requests.get(main_url).text, 'html.parser')
products = main_page.find_all(class_="prodNumber")
prod_urls = []
for product in products:
prod_urls.append("https://www.thorlabs.com/" + product.contents[0].get('href'))
@alexkuang0
alexkuang0 / 青蛙兒歌.wy
Created December 27, 2019 16:10
挺無聊地試用一下文言 wenyan-lang
吾有一術。名之曰「青蛙兒歌」
欲行是術。必先得一物。曰「蛙數」。
乃行是術曰。
吾有一物。曰「蛙數」。名之曰「口」
乘「蛙數」以二。名之曰「目」。
乘「蛙數」以四。名之曰「足」。
批曰。字符串合併
加「蛙數」以「「隻青蛙」」。名之曰「言」。
加「言」以「口」。名之曰「言」。