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) |
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
[ 0.000000] microcode: microcode updated early to revision 0xea, date = 2021-01-05 | |
[ 0.000000] Linux version 5.15.11-arch2-1-surface (linux-surface@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Sat, 25 Dec 2021 15:09:08 +0000 | |
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-linux-surface root=UUID=30e1781a-10a9-499f-8a48-1c259aadd349 rw apparmor=1 security=apparmor udev.log_priority=3 | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers' | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR' | |
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 | |
[ 0.000000] x86/fpu: xstate_offset[3]: 832, xstate_sizes[3]: 64 |
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
SRC:=tar | |
DIST:=dist | |
PROC_NUM:=8 | |
# find tar -type f -regextype posix-extended -regex 'tar/(ja|en)/.*' | xargs -I '{}' echo tar -xvf '{}' | |
mkdir: | |
mkdir -p $(DIST) | |
clear: | |
rm -rf $(DIST)/* |