Skip to content

Instantly share code, notes, and snippets.

View aofei's full-sized avatar
🛠️
Refactoring...

Aofei Sheng aofei

🛠️
Refactoring...
View GitHub Profile
@aofei
aofei / init.lua
Last active April 3, 2024 02:07
Aofei Sheng flavored nvim/init.lua file.
--
-- PLUGINS
--
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
@aofei
aofei / supervise.sh
Last active November 29, 2023 03:39
A shell script for supervising and keeping processes alive.
#!/bin/sh
set -e
if [[ $# -lt 2 || ! -x $2 ]]; then
echo "Usage: supervise log_tag program [program-argument...]" >&2
exit 2
fi
LOG_TAG=$1
@aofei
aofei / country-list.json
Created April 2, 2022 17:38
A JSON-encoded country list.
[
{
"code": "AD",
"name": "Andorra",
"continent_code": "EU",
"continent_name": "Europe"
},
{
"code": "AE",
"name": "United Arab Emirates",
@aofei
aofei / china-domain-list
Last active May 1, 2024 19:00
An incomplete China domain list.
0-6.com
0.zone
00.net
000.link
00042.com
00058.com
0006266.com
000714.xyz
000dn.com
000e.com
@aofei
aofei / china-ip-list
Last active May 3, 2024 04:00
An incomplete China IP list.
1.0.1.0/24
1.0.2.0/23
1.0.8.0/21
1.0.32.0/19
1.1.0.0/24
1.1.2.0/23
1.1.4.0/22
1.1.8.0/21
1.1.16.0/20
1.1.32.0/19
@aofei
aofei / switchgo.sh
Last active November 29, 2023 03:36
A shell script for switching Go versions.
#!/bin/sh
set -e
if [[ $# -ne 1 ]]; then
echo "Usage: switchgo version" >&2
exit 2
fi
if [[ -z "$GOBIN" ]]; then
echo "\$GOBIN is not set" >&2