Skip to content

Instantly share code, notes, and snippets.

View xu20160924's full-sized avatar
🎯
Focusing

xu20160924

🎯
Focusing
View GitHub Profile
@xu20160924
xu20160924 / who_is_my_mummy.sh
Created June 27, 2023 06:49 — forked from joechrysler/who_is_my_mummy.sh
Find the nearest parent branch of the current git branch
#!/usr/bin/env zsh
git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
# How it works:

C++ 5nth primer

线程

优先使用线程池

  • 线程池是线程的更高层的抽象
  • 更容易扩展

处理错误

  • C++编码规范不鼓励异常,除非已有项目/底层库使用了异常,这时候必须要catch所有异常
1. install iterm2
2. brew install lrzsz
3. donwload iterm2 files and mv to /usr/local/bin (these iterm2-* files doesn't work again, try this https://github.com/aikuyun/iterm2-zmodem)
4. config the triggers like below
Regular expression: rz waiting to receive.\*\*B0100
Action: Run Silent Coprocess
Parameters: /usr/local/bin/iterm2-send-zmodem.sh
Regular expression: \*\*B00000000000000
Action: Run Silent Coprocess