Laurence build a tiny project to show washing time remaining elapse in the terminal[^1], that idea is very fun. and I was very curious about all code behind of this
#! /bin/sh
set -e
according to file https://get.jetpack.io/devbox/
sudo rm /usr/local/bin/devbox
首先安装 qnap 的社区版本, 注意因为 QNAP 非 root 运行, 所以现在基本上没法设置 systemctl
和 ping_group_range
论坛: https://forum.qnap.com/viewtopic.php?f=320&t=160538
安装完成后就有了 CLI, 然后根据 https://developers.cloudflare.com/cloudflare-one/tutorials/share-new-site 设置
最后更改一下 cloudflared start stop 命令 sudo vim /opt/CloudFlared/CloudFlared.sh
换一下 start
stop
命令
ZigZag-Encoding | |
--------------- | |
Maps negative values to positive values while going back and | |
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
(i >> bitlength-1) ^ (i << 1) | |
with "i" being the number to be encoded, "^" being | |
XOR-operation and ">>" would be arithemtic shifting-operation |
create_draft_release: | |
name: Create Github draft release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Audit gh version | |
run: gh --version | |
- name: Check for existing release | |
id: check_release | |
run: | |
nix-*
.zshrc
rust
不过,过长的代码行难以阅读,所以最好拆开来写。通常来说,当使用 .method_name() 语法调用方法时引入换行符和空格将长的代码行拆开是明智的。现在来看看这行代码干了什么。[^1]