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
| .ONESHELL: | |
| REPO_DIR="${PWD}" | |
| define my_git_checkout | |
| (git checkout $(1) || git checkout --track origin/$(1)) && git pull | |
| endef | |
| define GVM_USE | |
| echo "=========================================================================================" |
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
| function init_rsync() { | |
| # --archive, -a archive mode is -rlptgoD (no -A,-X,-U,-N,-H) | |
| # --recursive, -r recurse into directories | |
| # --links, -l copy symlinks as symlinks | |
| # --perms, -p preserve permissions | |
| # --times, -t preserve modification times | |
| # --group, -g preserve group | |
| # --owner, -o preserve owner (super-user only) | |
| # -D same as --devices --specials | |
| # --devices preserve device files (super-user only) |
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
| function cliPrompt<T = string>(promptMsg: string): Promise<T> { | |
| return new Promise((resolve, reject) => { | |
| process.stdin.on("data", function(data: any) { | |
| resolve(data.toString()) | |
| process.stdin.end() | |
| }) | |
| process.stdout.write(promptMsg); | |
| }) | |
| } |
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
| // ==UserScript== | |
| // @name Mastodon Anti-zh_CN Filters Installer | |
| // @grant none | |
| // @version 1.2 | |
| // @match https://pawoo.net/filters | |
| // @match https://pawoo.net/filters/new | |
| // @run-at document-end | |
| // ==/UserScript== | |
| // [USAGE] | |
| // 1. Change "@match" to the filter page of the Mastodon instance you're using ("Perference -> Filters") |
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/env python3 | |
| import os | |
| import shutil | |
| import sys | |
| if len(sys.argv) == 1: | |
| print('[USAGE] Please provide directory in argv.') | |
| exit(1) | |
| directory = sys.argv[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
| .ONESHELL: # This ".ONESHELL" is important! | |
| define GVM_USE | |
| echo "=========================================================================================" | |
| echo "[INFO] Recommended Go Version: 1.9" | |
| source "${GVM_ROOT}/scripts/gvm" # Or source "${HOME}/.gvm/scripts/gvm" | |
| gvm use go1.9 | |
| echo "[INFO] Remember to git checkout in ~/.gvm/pkgsets/go1.9/global/src/github.com/........" | |
| echo "=========================================================================================" | |
| endef |
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
| .ONESHELL: | |
| .PHONY: clear build watch server | |
| default: watch | |
| GULP:="./node_modules/.bin/gulp" | |
| define NVM_USE | |
| source ~/.nvm/nvm.sh | |
| nvm use v14.20.0 | |
| endef |
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/bash | |
| # https://stackoverflow.com/questions/1570262/get-exit-code-of-a-background-process | |
| mscore > /dev/null 2>&1 & | |
| MS_PID=$! | |
| while true | |
| do | |
| # if string.length == 0 |
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
| ifneq (,$(findstring xterm,${TERM})) | |
| DARK_BLACK := $(shell tput setaf 0) | |
| DARK_RED := $(shell tput setaf 1) | |
| DARK_GREEN := $(shell tput setaf 2) | |
| DARK_YELLOW := $(shell tput setaf 3) | |
| DARK_BLUE := $(shell tput setaf 4) | |
| DARK_MAGENTA := $(shell tput setaf 5) | |
| DARK_CYAN := $(shell tput setaf 6) | |
| DARK_WHITE := $(shell tput setaf 7) | |
| BLACK := $(shell tput setaf 8) |
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
| SHELL=/bin/bash | |
| # to see all colors, run | |
| # bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done' | |
| # the first 15 entries are the 8-bit colors | |
| # define standard colors | |
| ifneq (,$(findstring xterm,${TERM})) | |
| BLACK := $(shell tput -Txterm setaf 0) | |
| RED := $(shell tput -Txterm setaf 1) |