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 July 22, 2024 13:32
Aofei Sheng flavored nvim/init.lua file.
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
@aofei
aofei / supervise.sh
Last active June 2, 2024 10:37
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 July 22, 2024 22:00
An incomplete China domain list.
This file has been truncated, but you can view the full file.
0-6.com
0.zone
00.net
000.link
0000g.com
00042.com
00058.com
0006266.com
000714.xyz
@aofei
aofei / china-ip-list
Last active July 22, 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 June 2, 2024 10:13
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