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 May 13, 2024 14:29
crack activate Office on mac with license file

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 {
@zthxxx
zthxxx / tmux.conf
Last active March 8, 2024 04:39
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 -sL https://gist.github.com/zthxxx/bbbb37c100254d688236c21e8b977b85/raw/tmux.conf -o ~/.config/tmux/tmux.conf
# ```
# 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
@zthxxx
zthxxx / win-kms.bat
Last active January 31, 2024 05:32
win-kms
:: active win10 VL
:: ensure you are run as Administrator
cmd /c "slmgr /skms kms.03k.org && slmgr /ato"
:: active office VL
:: in Microsoft Office installed folder
:: office2016 64bit default in C:\Program Files\Microsoft Office\Office16
cd "C:\Program Files\Microsoft Office\Office16"
cscript ospp.vbs /sethst:kms.03k.org && cscript ospp.vbs /act
/**
* Allows arbitrary level property access and callable,
* support mock with usage likes:
* ```
* faker = new FakeClass()
* faker.xxxx()
*
* faker()
*
@zthxxx
zthxxx / codeshift-duplicate-import.ts
Last active January 2, 2024 08:54
auto merge duplicate import, support distinguish between import and import type, but not support with namespace import or duplicate default import
import {
namedTypes as types,
} from 'ast-types'
import type {
Options as RecastOptions,
} from 'recast'
import type {
Transform,
FileInfo,
API,
@zthxxx
zthxxx / .lunar-vim-install.sh
Last active November 26, 2023 06:38
installation for LunarVim
# https://www.lunarvim.org/
# https://www.lunarvim.org/docs/installation
brew install neovim rust
brew install --cask homebrew/cask-fonts/font-hack-nerd-font
# on linux without homebrew, install with AppImage
# apt install -y libfuse2
curl -fsSL https://github.com/neovim/neovim/releases/download/stable/nvim.appimage -o /usr/local/bin/nvim
chmod +x /usr/local/bin/nvim
@zthxxx
zthxxx / .screenrc
Last active November 8, 2023 16:02
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`
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"