Skip to content

Instantly share code, notes, and snippets.

View funnyzak's full-sized avatar
🚀
Focusing

Leon funnyzak

🚀
Focusing
  • BeiJing
  • 00:31 (UTC +08:00)
View GitHub Profile
@lewangdev
lewangdev / install-docker-ce-aliyun-debian.md
Last active July 2, 2024 02:31
在阿里云中国大陆机房的Debian系统上安装Docker服务和拉取dockerhub镜像

安装 docker-ce

# https://developer.aliyun.com/article/110806
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
@funnyzak
funnyzak / objectDeepReplace.js
Created November 29, 2022 02:55
Replace all values of the string type of the object with the target value
objectDeepReplace = (obj, searchRegex, replaceValue) => {
for (const key in obj) {
if (typeof obj[key] === 'string') {
obj[key] = obj[key].replace(searchRegex, replaceValue);
} else if (typeof obj[key] === 'object') {
objectDeepReplace(obj[key], searchRegex, replaceValue);
}
}
return obj;
};
export PATH="/opt/homebrew/bin:$PATH" # Setup Homebrew
eval "$(starship init zsh)" # Setup starship
source $HOME/.config/dotflies/*.zsh # Setup custom dotfiles
# Download Znap, if it's not there yet.
[[ -f $HOME/.znap/zsh-snap/znap.zsh ]] ||
git clone --depth 1 -- \
https://github.com/marlonrichert/zsh-snap.git $HOME/.znap/zsh-snap
@funnyzak
funnyzak / convert_images_to_heic.sh
Last active April 12, 2022 05:23
Convert images to HEIC
# Iterate through the current folder and convert all JPG|JPEG|PNG|BMP format pictures to HEIC format, delete the original files after success
# 遍历当前文件夹,把所有JPG|JPEG|PNG|BMP格式图片转换为HEIC格式,成功后删除原文件
find -E . -iregex ".*\.(jpg|jpeg|png|bmp)" -print | xargs -n1 -I {} sh -c 'echo "Converting \"{}\" to HEIC." && ((magick mogrify -quiet -format HEIC {} && rm {} && echo "success and deleted {}.") || echo "fail.")'
@ricky9w
ricky9w / example-config.yaml
Created August 4, 2021 09:44
Clash config using proxy-providers and rule-providers
mixed-port: 7890
#---------------------------------------------------#
## 配置文件需要放置在 $HOME/.config/clash/*.yaml
allow-lan: false
mode: Rule
log-level: silent
external-controller: 127.0.0.1:60000
# 节点配置文件统一存放在 ./profiles/proxies/ 目录中
proxy-providers:
@Misaka-0x447f
Misaka-0x447f / quantumult.conf
Last active May 18, 2024 19:34
quantumult rules
[general]
server_check_url= http://google.com/generate_204
resource_parser_url= https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/resource-parser.js
;运行模式模块,running_mode_trigger 设置,即根据网络自动切换 分流/直连/全局代理 等模式。
;running-mode-trigger 模式下,跟手动切换直连/全局代理 等效,rewrite/task 模块始终会生效,比 ssid 策略组设置简单,比 ssid-suspend 更灵活。
;running_mode_trigger=filter, filter, asus-5g:all_direct, asus: all_proxy
; 上述写法,前两个 filter 表示 在 4G 网络跟一般 Wi-Fi 下,走 filter(分流)模式,asus-5g 则切换为全局直连,asus 切换为全局代理
; 如需使用,相应 SSID 换成你自己 Wi-Fi 名即可
@tobiaslins
tobiaslins / worker.js
Last active May 15, 2024 01:20
Notion Custom Domain using Cloudflare Workers + Splitbee Analytics
const MY_DOMAIN = "help.splitbee.io"
const START_PAGE = "https://www.notion.so/splitbee/Help-Center-bbf26e2b70574901b9c98e5d11e449de"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
@developit
developit / *constant-locals-loader.md
Last active February 4, 2022 17:15
Inline Webpack CSS Modules classNames, reducing bundle size. https://npm.im/constant-locals-loader

constant-locals-loader for Webpack

This loader optimizes the output of mini-css-extract-plugin and/or css-loader, entirely removing the potentially large CSS classname mappings normally inlined into your bundle when using CSS Modules.

Run npm install constant-locals-loader, then make these changes in your Webpack config:

module.exports = {
 module: {
@ThaddeusJiang
ThaddeusJiang / interview report template (tech)
Last active November 22, 2022 16:44
Interview report template (tech)
Total: 1~5
下面各项得分的平均分
Experience: 1~5
过往项目的客户群(ToB or ToC)、项目规模、项目中担当的角色、是否有突出贡献等等
Skill: 1~5
开发基础、设计能力、能否攻克中大型开发难题,能否担当 full stack 任务等等
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active July 23, 2024 15:49
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized