Skip to content

Instantly share code, notes, and snippets.

View zthxxx's full-sized avatar
🐾
Nyaa~

zthxxx zthxxx

🐾
Nyaa~
View GitHub Profile
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active March 9, 2026 04:49
crack activate Office on mac with license file
@zthxxx
zthxxx / tmux.conf
Last active June 11, 2025 17:00
My tmux config, migrate from gnu screen config via ChatGPT
# ~/.config/tmux/tmux.conf
# https://quickref.me/tmux
# https://man7.org/linux/man-pages/man1/tmux.1.html
# Install
#
# ```bash
# mkdir -p ~/.config/tmux
# curl -L https://gist.github.com/zthxxx/bbbb37c100254d688236c21e8b977b85/raw/tmux.conf -o ~/.config/tmux/tmux.conf
# ```
@zthxxx
zthxxx / crack-with-navicat-keygen.sh
Last active November 17, 2024 14:52
crack navicat premuim 12.04 with navicat-keygen
# make sure exist a keychain identity preference named "crack-for-navicat"
# ref: https://github.com/DoubleLabyrinth/navicat-keygen/tree/mac
# to gen a identity,
# https://github.com/DoubleLabyrinth/navicat-keygen/issues/50#issuecomment-416824334
# set the Name: crack-for-navicat
# set the Certificates Type: Code Signing
# after created, you need always trust this identity,
# then you can use this commad under to check:
# security find-identity -vp codesigning
@zthxxx
zthxxx / .screenrc
Last active October 27, 2024 01:27
screen preference
# Install
# curl -sL https://gist.github.com/zthxxx/df7e121048b12c80f260285d88e1091f/raw/.screenrc -o ~/.screenrc
# curl -s https://gist.githubusercontent.com/zthxxx/df7e121048b12c80f260285d88e1091f/raw/.screenrc -o ~/.screenrc
# Shortcut Key binding
# https://www.gnu.org/software/screen/manual/screen.html#Bindkey
# remap prefix key `Ctrl-A` to `Ctrl-S`
# find merge-request which contains commit in GitLab
# https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28037
# https://stackoverflow.com/a/17819027/7277090
git config --add remote.origin.fetch '+refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*'
git fetch origin
git for-each-ref --contains <hash> | grep merge-requests | head -n 10
git log --name-status --diff-filter=D <file / dir>
git fetch --all
# 7 天内有多少 commit 改动了 package-lock
git log --format=format:'%h' --no-merges --since="7 days ago" --all -- package-lock.json | wc -l
# 7 天内所有 commit 共产生了多少完全无重复的 package-lock
git log --format=format:'%h' --no-merges --since="7 days ago" --all -- package-lock.json | \
xargs -I{} git ls-tree {} package-lock.json | \
sort | uniq | wc -l
# https://code.visualstudio.com/docs/editor/command-line#_working-with-extensions
# code --list-extensions
code --uninstall-extension cduruk.thrift
code --uninstall-extension byted-sec.bytesec-vscode
code --uninstall-extension byted-ide.ppe-debug
code --uninstall-extension byted-ide.ftt
code --uninstall-extension byted-ide.cloud-dev-task
code --uninstall-extension byted-ide.cloud-dev-debug
code --install-extension shalldie.background

Rewrite "import then re-export" to a direct "re-export" approach via ast-grep.

Rule file see in file-import-to-export.yml

Preview Effect

- import Form, {
+ export {
function gen_ssl_cert {
local prefix="${1}"
openssl genrsa -des3 -out "${prefix}.lock.key" 1024
openssl rsa -in "${prefix}.lock.key" -out "${prefix}.key"
rm "${prefix}.lock.key"
openssl req -new -key "${prefix}.key" -out "${prefix}.csr"
openssl x509 -req -days 3650 -in "${prefix}.csr" -signkey "${prefix}.key" -out "${prefix}.crt"
openssl pkcs12 -export -inkey "${prefix}.key" -in "${prefix}.crt" -out "${prefix}.pfx"