Skip to content

Instantly share code, notes, and snippets.

@qzchenwl
qzchenwl / Pragmatic Hexagonal Java.md
Last active December 21, 2025 01:02
Pragmatic Hexagonal Java: Clean Code, Testability, Fail Fast

Principles

We optimize for three goals:

  1. Clean Code
  2. Testability
  3. Fail Fast

We use a pragmatic, adapted form of hexagonal architecture: take the strengths (clear seams for change and testing) and avoid dogma (no needless layers, no over-abstraction).

@qzchenwl
qzchenwl / .gitconfig
Last active December 16, 2025 12:44
zshrc
[alias]
# status
s = status -sb
st = status
# branch / checkout
br = branch
co = checkout
sw = switch
@qzchenwl
qzchenwl / markdown.css
Created February 7, 2025 08:18
markdown.css
@import url(http://fonts.googleapis.com/css?family=Merriweather:300italic,300);
body {
font-family: 'Merriweather', Georgia, serif;
line-height: 1.6;
color: #333;
max-width: 860px;
margin: 0 auto;
padding: 2rem;
background-color: #f9f9f9;
@qzchenwl
qzchenwl / elasticsearch-docker-compose.yml
Created April 27, 2024 07:04
elasticsearch docker compose
services:
setup:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.0
user: "0"
command: >
bash -c '
if [ x${ELASTIC_PASSWORD} == x ]; then
echo "Set the ELASTIC_PASSWORD environment variable in the .env file";
exit 1;
elif [ x${KIBANA_PASSWORD} == x ]; then
@qzchenwl
qzchenwl / config.yaml
Last active October 10, 2025 02:58
合并多份clash订阅到一份中,支持复用规则、自定义规则。
# 基础订阅
subscribers:
nzl: &nzl !include https://path/to/your/subscription.yaml
mewu: &mewu !include https://path/to/your/another/subscription.yaml
proxies: &proxies !flatten
- !jq { object: *nzl, filter: '[.proxies[] | (.name += "-nzl")]' }
- !jq { object: *mewu, filter: '[.proxies[] | (.name += "-mewu")]' }
proxy-names: &all !jq { object: *proxies, filter: '[.[].name]' }
hk-proxy-names: &hk !jq { object: *all, filter: '[.[] | select(contains("香港"))]' }
tw-proxy-names: &tw !jq { object: *all, filter: '[.[] | select(contains("台湾"))]' }
@qzchenwl
qzchenwl / homebrew-gnubin.md
Created November 3, 2023 06:05 — forked from skyzyx/homebrew-gnubin.md
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@qzchenwl
qzchenwl / setup.sh
Last active March 29, 2021 06:42
k8s-master on centos7
# 0. SYSTEM INFO & CLUSTER ARCH
# CentOS 7
#
# +------------+ +-----------+
# | k8s-master |>192.168.99.20 -- 192.168.99.21<| k8s-node1 |
# +------------+ +-----------+
# v v
# internet internet
#
# /etc/hosts
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@qzchenwl
qzchenwl / packages.txt
Last active January 21, 2018 16:02
$ gcloud auth application-default login && cat ~/.config/gcloud/application_default_credentials.json
asn1crypto==0.23.0
bleach==1.5.0
cachetools==2.0.1
certifi==2017.11.5
cffi==1.11.2
chardet==3.0.4
click==6.7
conda==4.3.31
cryptography==2.1.4
decorator==4.2.1
@qzchenwl
qzchenwl / README.md
Created July 8, 2017 01:30
替换 Homebrew 源

替换 brew.git:

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

替换 homebrew-core.git:

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git