Compare commits
313 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c808475d59 | ||
|
|
63725cf4ab | ||
|
|
fad6a20b13 | ||
|
|
1c5850b8e9 | ||
|
|
a64e21d466 | ||
|
|
fcda71cfd3 | ||
|
|
450d3d8f0e | ||
|
|
f24b08489d | ||
|
|
443f2ba7b0 | ||
|
|
da0c16aab7 | ||
|
|
35e2e58205 | ||
|
|
b9e327cfb7 | ||
|
|
01c8c04b30 | ||
|
|
1b1ad3453c | ||
|
|
70e94f5cc9 | ||
|
|
d70b190edc | ||
|
|
1df034e846 | ||
|
|
88d6e50319 | ||
|
|
265bffe9c1 | ||
|
|
ffa69578a6 | ||
|
|
73106942ca | ||
|
|
9446bc0ab9 | ||
|
|
4c86b97c40 | ||
|
|
6f16c43dc5 | ||
|
|
7c005d8e8a | ||
|
|
1a829ec469 | ||
|
|
4d638b26c5 | ||
|
|
22ecbc56a6 | ||
|
|
3d2c2d4d25 | ||
|
|
6f0ec249f6 | ||
|
|
654dc15eb6 | ||
|
|
c71ea7d356 | ||
|
|
f6a29c9e9e | ||
|
|
bec51fa09f | ||
|
|
aaf6d1669b | ||
|
|
0c4c020aaf | ||
|
|
5456dbfa24 | ||
|
|
3ceb796324 | ||
|
|
87554d1616 | ||
|
|
69d5fe0b2a | ||
|
|
404f5f1070 | ||
|
|
c0b8eb4da7 | ||
|
|
7fa1528be5 | ||
|
|
564ef54c1b | ||
|
|
dd0d19cf1c | ||
|
|
5c34078de5 | ||
|
|
4e21fd05d1 | ||
|
|
d1fb7ad8cb | ||
|
|
43397a9cf7 | ||
|
|
166cbbd02f | ||
|
|
d52c7c2abc | ||
|
|
21ddcb51cb | ||
|
|
ac70a8d913 | ||
|
|
b28c141fdf | ||
|
|
a9552508a0 | ||
|
|
2c61572a99 | ||
|
|
d3ece9328d | ||
|
|
d3e778ee35 | ||
|
|
187fe9e8c0 | ||
|
|
fe5d52682e | ||
|
|
642aa08cd6 | ||
|
|
8c80f47c99 | ||
|
|
e8e1a83240 | ||
|
|
c0ebe199d1 | ||
|
|
ebcae6d5cd | ||
|
|
a39f00461b | ||
|
|
73099249f4 | ||
|
|
4db4c7a750 | ||
|
|
9db13825c5 | ||
|
|
444f2c8c91 | ||
|
|
e8af72372c | ||
|
|
d8e1bdf6ca | ||
|
|
55587bd145 | ||
|
|
9684f7c9e4 | ||
|
|
51336f8b86 | ||
|
|
f682690b9f | ||
|
|
6e46907d5c | ||
|
|
b0df70a952 | ||
|
|
55be092001 | ||
|
|
7cf8fae835 | ||
|
|
8b3784038d | ||
|
|
f000ab5d67 | ||
|
|
599e776b1a | ||
|
|
959afe6bf7 | ||
|
|
be81f1bfcb | ||
|
|
3cee78a29e | ||
|
|
742c4b0018 | ||
|
|
e1d523036e | ||
|
|
38bbf5d6d3 | ||
|
|
0bced7ac0f | ||
|
|
104f34dff9 | ||
|
|
c3197fe24b | ||
|
|
d5e6cb3b62 | ||
|
|
99e41b2798 | ||
|
|
93d760298e | ||
|
|
62777d1690 | ||
|
|
881033ca36 | ||
|
|
00cc7f7330 | ||
|
|
8c7cecb128 | ||
|
|
d4000a3c02 | ||
|
|
7bb91f3f60 | ||
|
|
1b9437656d | ||
|
|
2b6b58d7fb | ||
|
|
8dca5a8765 | ||
|
|
ce4e16fb75 | ||
|
|
ae10c15d2a | ||
|
|
844bc6d307 | ||
|
|
c343cb3587 | ||
|
|
7f0709f502 | ||
|
|
d8427d22a9 | ||
|
|
626b7ec961 | ||
|
|
278ebee2c0 | ||
|
|
822af71d7f | ||
|
|
b5f9d14ab1 | ||
|
|
0a012311dd | ||
|
|
c49b7002ce | ||
|
|
bb605ea530 | ||
|
|
a3ffdd16fc | ||
|
|
b880c23f05 | ||
|
|
df3e46f34d | ||
|
|
a45fcfef20 | ||
|
|
3b65deb8d1 | ||
|
|
3fdfa19b74 | ||
|
|
8d60181b96 | ||
|
|
cb5df68489 | ||
|
|
88f43a924a | ||
|
|
6f50c1adfd | ||
|
|
c6d9901d5e | ||
|
|
bd2d631b02 | ||
|
|
e25412175f | ||
|
|
b6ca1e5166 | ||
|
|
3d0ce212a9 | ||
|
|
2a4c08a69e | ||
|
|
3ddb8959c5 | ||
|
|
37906f6548 | ||
|
|
ce2640f9cf | ||
|
|
9e42db6fcb | ||
|
|
fd85b9d819 | ||
|
|
2dd3fd1e84 | ||
|
|
21dc25c2a4 | ||
|
|
ea8d6b3391 | ||
|
|
1efbb7155b | ||
|
|
22194283aa | ||
|
|
56d8186e0a | ||
|
|
9e5e671a1a | ||
|
|
dc3005bc99 | ||
|
|
dedb8b9475 | ||
|
|
6f978c8df0 | ||
|
|
8ce7714bca | ||
|
|
f8b4ef611f | ||
|
|
057eddb4b2 | ||
|
|
6dfc13ee6d | ||
|
|
b77f29a1c2 | ||
|
|
55f807f407 | ||
|
|
2e2b3b8ee4 | ||
|
|
234da6d914 | ||
|
|
36068c9ad3 | ||
|
|
359b81a44f | ||
|
|
20b3a1969d | ||
|
|
d59d128bd1 | ||
|
|
f5ce635f97 | ||
|
|
d6121b3ce9 | ||
|
|
e5ccf68774 | ||
|
|
f3699e12cd | ||
|
|
88452a8b07 | ||
|
|
2d8753a6a5 | ||
|
|
a7a5d029d5 | ||
|
|
dabb4b2cd7 | ||
|
|
f318e2456d | ||
|
|
8250615bca | ||
|
|
f7c2d6555f | ||
|
|
a15bd68a59 | ||
|
|
5d82708d56 | ||
|
|
fda807a97b | ||
|
|
c076d32fc1 | ||
|
|
da7cccb50b | ||
|
|
349d811c66 | ||
|
|
4c7e86893d | ||
|
|
b040885e8b | ||
|
|
925a2913c4 | ||
|
|
76785c6c55 | ||
|
|
13991b8b5e | ||
|
|
e5ad863e2d | ||
|
|
3c2e52f47e | ||
|
|
137210c886 | ||
|
|
60e83d0e0b | ||
|
|
338b54f3c5 | ||
|
|
5fc5c065df | ||
|
|
435fdead51 | ||
|
|
61f4697406 | ||
|
|
6122942c95 | ||
|
|
57d42b29ba | ||
|
|
ee97d75160 | ||
|
|
cff4119203 | ||
|
|
4dfb3c8e9f | ||
|
|
50526ab7a4 | ||
|
|
6a9c656af6 | ||
|
|
ee1c50166c | ||
|
|
18189760b7 | ||
|
|
e8c86ad588 | ||
|
|
d9ff20b22c | ||
|
|
c03deba9a5 | ||
|
|
6358f19144 | ||
|
|
8ef5df72f0 | ||
|
|
704ba7332e | ||
|
|
bc4e48c5fd | ||
|
|
587aa7e304 | ||
|
|
bacaf4df44 | ||
|
|
1da65002ba | ||
|
|
11dc28cea3 | ||
|
|
8c21b7126a | ||
|
|
7da5b74811 | ||
|
|
893391cc3b | ||
|
|
20c2bfdbef | ||
|
|
4e40ae2b1d | ||
|
|
52fc7597ca | ||
|
|
f176bf6f56 | ||
|
|
67c7a0ef49 | ||
|
|
04a12487c0 | ||
|
|
4305ed8bd9 | ||
|
|
2f66dbc882 | ||
|
|
9d8e885aec | ||
|
|
fbbc5195f7 | ||
|
|
72109ba7b6 | ||
|
|
f263431ab1 | ||
|
|
fae20e6a71 | ||
|
|
706fe7855f | ||
|
|
f5e5357de7 | ||
|
|
cb434e1180 | ||
|
|
df9bf1f5e9 | ||
|
|
a0754c5397 | ||
|
|
997e176017 | ||
|
|
8f9da1cf83 | ||
|
|
6b29e84fda | ||
|
|
317f2db41f | ||
|
|
2c7400d446 | ||
|
|
9549a30646 | ||
|
|
77b4802177 | ||
|
|
7f9b132db9 | ||
|
|
58745e7a4d | ||
|
|
1d9d2f798c | ||
|
|
8e11109e6f | ||
|
|
2f6c263221 | ||
|
|
b8d46f0cee | ||
|
|
70367ebff8 | ||
|
|
c60876d078 | ||
|
|
e391ce4cd3 | ||
|
|
f28f625a93 | ||
|
|
bfc4a0198d | ||
|
|
9436578123 | ||
|
|
fd88141567 | ||
|
|
2c10272d01 | ||
|
|
a6bb4625d7 | ||
|
|
cb1c236f5c | ||
|
|
466c3c073d | ||
|
|
56f1ce20a1 | ||
|
|
119df317f2 | ||
|
|
532cb88cf0 | ||
|
|
b5f5c95680 | ||
|
|
9d0cfca668 | ||
|
|
4c02dfd878 | ||
|
|
83655d42a5 | ||
|
|
e4bc989560 | ||
|
|
05dae25ae7 | ||
|
|
f500aae1e7 | ||
|
|
adcf084901 | ||
|
|
3cabca0a7a | ||
|
|
6d6ee93d7c | ||
|
|
7663e0aa72 | ||
|
|
70518c3d9a | ||
|
|
26f49c9bc6 | ||
|
|
76dc31a30c | ||
|
|
3bdcc831c4 | ||
|
|
a2795d4691 | ||
|
|
fa55cc17d1 | ||
|
|
7f66d28d56 | ||
|
|
de76161779 | ||
|
|
b935a35165 | ||
|
|
e1fad67e75 | ||
|
|
063369866e | ||
|
|
1f6bcaabdf | ||
|
|
1ee3fb8bed | ||
|
|
a0bd5f7304 | ||
|
|
534f39c6a7 | ||
|
|
6cb067ce06 | ||
|
|
c8aba156f7 | ||
|
|
53693bdeba | ||
|
|
2dd35ecb40 | ||
|
|
c278fb2454 | ||
|
|
ab0d82e7f5 | ||
|
|
f726b3c6d4 | ||
|
|
300aa903bd | ||
|
|
e332fa127f | ||
|
|
6653bed2eb | ||
|
|
3f822852bf | ||
|
|
3e71fee21c | ||
|
|
3a8b1a2cd7 | ||
|
|
bfe8934e88 | ||
|
|
6b737583ee | ||
|
|
108c8005d4 | ||
|
|
75830aa8bc | ||
|
|
7e8f89418c | ||
|
|
6f94d01850 | ||
|
|
bd9c837102 | ||
|
|
d29ac4215c | ||
|
|
a548bac591 | ||
|
|
0f22978db4 | ||
|
|
4b8567131f | ||
|
|
6c0c6508ab | ||
|
|
08b48b842f | ||
|
|
6e2f615551 | ||
|
|
fed14313e4 | ||
|
|
9c7c381849 |
5
.gitattributes
vendored
@@ -1,3 +1,4 @@
|
||||
Dockerfile linguist-documentation=false
|
||||
.husky/* linguist-vendored
|
||||
*.md linguist-detectable=true
|
||||
|
||||
*.svg linguist-language=md
|
||||
*.md linguist-detectable=true
|
||||
|
||||
20
.github/workflows/ci.yml
vendored
@@ -9,10 +9,10 @@ jobs:
|
||||
if: github.repository == 'jaywcjlove/reference'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
EOF
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
commit_message: ${{ github.event.head_commit.message }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
id: changelog
|
||||
uses: jaywcjlove/changelog-generator@main
|
||||
with:
|
||||
filter-author: (小弟调调™|github-actions-bot|@github-actions-bot|dependabot|renovate\\[bot\\]|dependabot\\[bot\\]|Renovate Bot)
|
||||
filter-author: (小弟调调™|\@github-actions-bot\@renovate-bot|dependabot|renovate\\[bot\\]|dependabot\\[bot\\]|Renovate Bot)
|
||||
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
|
||||
|
||||
- name: Create Release
|
||||
@@ -124,15 +124,17 @@ jobs:
|
||||
```
|
||||
|
||||
# Create Docker Image
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- run: docker buildx prune
|
||||
|
||||
- name: Build and push image:latest
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
@@ -140,7 +142,7 @@ jobs:
|
||||
tags: wcjiang/reference:latest
|
||||
|
||||
- name: Build and push image:tags
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v5
|
||||
if: steps.create_tag.outputs.successful
|
||||
with:
|
||||
push: true
|
||||
|
||||
8
.github/workflows/win.yml
vendored
@@ -9,10 +9,10 @@ jobs:
|
||||
if: github.repository == 'jaywcjlove/reference'
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
cd dist
|
||||
ls
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: ${{ github.workspace }}\dist\**\*
|
||||
|
||||
3
.husky/pre-commit
vendored
@@ -1,4 +1 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install lint-staged
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
"MD024": false,
|
||||
"MD033": false,
|
||||
"MD040": false,
|
||||
"MD055": false,
|
||||
"MD056": false,
|
||||
"MD051": false,
|
||||
"MD010": {
|
||||
"code_blocks": true,
|
||||
"spaces_per_tab": 2
|
||||
|
||||
609
CONTRIBUTING.md
@@ -1,7 +1,7 @@
|
||||
Contributing 贡献
|
||||
====
|
||||
|
||||
感谢您对**备忘清单**贡献的兴趣👍👍,是像您这样的人使 [`Quick Reference`](https://jaywcjlove.github.io/reference) 成为如此出色的网站 🎉🎉。随时提交问题和增强请求。
|
||||
感谢您对**备忘清单**贡献的兴趣👍👍,是像您这样的人使 [`Quick Reference`](https://jaywcjlove.github.io/reference) 成为如此出色的网站 🎉🎉。随时提交问题和增强请求,还提供一个[在线说明排版说明]( https://wangchujiang.com/reference/docs/quickreference.html),所以各种使用技巧,都在这个排版说明中有预览和实现代码。
|
||||
|
||||
`docs/{filename}.md` 文件将被处理成备忘清单,让我们创建或编辑一个 `markdown` 文件:
|
||||
|
||||
@@ -98,6 +98,123 @@ $ npm run start # 监听 md 文件编译输出 HTML
|
||||
$ git clone https://github.com/jaywcjlove/reference.git -b gh-pages
|
||||
```
|
||||
|
||||
**定时更新**
|
||||
|
||||
在 Linux 服务执行创建 `git-down-pages.sh` 脚本,将脚本放置在 `/opt/cron/` 目录下
|
||||
|
||||
> 注意:⚠️ 脚本会根据线上 pages 的 commit 和 本地 commit 比较。如果不一致才会同步更新,否则跳过
|
||||
|
||||
下面是脚本 `git-down-pages.sh` 的源码
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
#author: 南宫乘风
|
||||
|
||||
DATA_DIR="/data"
|
||||
REPO_URL="https://gitee.com/jaywcjlove/reference.git"
|
||||
BRANCH="gh-pages"
|
||||
MAX_BACKUPS=3
|
||||
|
||||
# 函数:备份旧版本
|
||||
backup_old_version() {
|
||||
echo "备份旧版本..."
|
||||
mv ../reference ../reference_backup_$(date +%Y%m%d%H%M%S)
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "备份完成。"
|
||||
remove_old_backups
|
||||
else
|
||||
echo "备份时出现错误。"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 函数:删除多余备份,保留最近的三个
|
||||
remove_old_backups() {
|
||||
echo "删除多余备份,保留最近的三个..."
|
||||
ls -1d ../reference_backup_* | head -n -${MAX_BACKUPS} | xargs -r rm -r
|
||||
}
|
||||
|
||||
# 函数:拉取最新代码
|
||||
clone_latest_code() {
|
||||
echo "拉取最新代码..."
|
||||
# 进入 /data 目录
|
||||
cd $DATA_DIR
|
||||
git clone $REPO_URL -b $BRANCH
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "拉取最新代码完成。"
|
||||
else
|
||||
echo "拉取最新代码时出现错误。"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 检查是否存在 DATA_DIR 目录,不存在则创建
|
||||
if [ ! -d "$DATA_DIR" ]; then
|
||||
echo "目录 $DATA_DIR 不存在,创建中..."
|
||||
mkdir -p "$DATA_DIR"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "目录创建成功。"
|
||||
else
|
||||
echo "目录创建失败。"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 进入 /data 目录
|
||||
cd $DATA_DIR
|
||||
|
||||
# 检查是否存在 reference 目录
|
||||
if [ -d "reference" ]; then
|
||||
# 进入 reference 目录
|
||||
cd reference
|
||||
|
||||
# 获取远程和本地的 commit 哈希值
|
||||
REMOTE_COMMIT=$(git ls-remote $REPO_URL $BRANCH | cut -f1)
|
||||
LOCAL_COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
# 比较远程和本地的 commit
|
||||
if [ "$REMOTE_COMMIT" == "$LOCAL_COMMIT" ]; then
|
||||
echo "本地 'reference' 目录已经是最新版本,无需拉取。"
|
||||
else
|
||||
echo "本地 'reference' 目录不是最新版本,开始拉取最新代码..."
|
||||
backup_old_version
|
||||
clone_latest_code
|
||||
fi
|
||||
else
|
||||
# 如果目录不存在,直接克隆
|
||||
clone_latest_code
|
||||
fi
|
||||
|
||||
echo "----------------------------------------------------------------------------"
|
||||
endDate=`date +"%Y-%m-%d %H:%M:%S"`
|
||||
echo "★[$endDate] Successful"
|
||||
echo "----------------------------------------------------------------------------"
|
||||
```
|
||||
|
||||
**创建定时任务**
|
||||
|
||||
注意:请把脚本放在 `/opt/cron/` 目录下 (时间可以根据自己需求设定),下面案例:每十分钟同步线上的 `pages` 的内容
|
||||
|
||||
```shell
|
||||
crontab -e
|
||||
|
||||
*/10 * * * * /opt/cron/git-down-pages.sh >> /opt/cron/git-down.log 2>&1
|
||||
```
|
||||
|
||||
**添加 NGINX 配置:**
|
||||
|
||||
```nginx
|
||||
listen 80;
|
||||
listen 443 ssl http2;
|
||||
server_name xxx.xxx.top; #配置你的域名
|
||||
index index.php index.html index.htm default.php default.htm default.html;
|
||||
root /data/reference; # 文件存放的位置
|
||||
```
|
||||
|
||||
|
||||
### 方法二,使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版
|
||||
|
||||
```shell
|
||||
@@ -147,7 +264,7 @@ REF_LABEL=网站首页
|
||||
- [linzhe.top](https://linzhe.top/)
|
||||
- [xushanxiang.com](https://xushanxiang.com/ref/)
|
||||
- [winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)
|
||||
- [hestudio.org](https://quickref.hestudio.org)
|
||||
- [quickref.hestudio.net](https://quickref.hestudio.net)
|
||||
- [surcode.cn](https://ref.surcode.cn)
|
||||
- [cms.im](https://quickref.cms.im/)
|
||||
- [nuomiphp.com](https://reference.tool.nuomiphp.com/)
|
||||
@@ -161,6 +278,7 @@ REF_LABEL=网站首页
|
||||
- [quickreference.pages.dev](https://quickreference.pages.dev/)
|
||||
- [code05.com](https://reference.code05.com/)
|
||||
- [xhfun.cn](https://ref.xhfun.cn/)
|
||||
- [ownit.top](https://memo.ownit.top/)
|
||||
|
||||
感谢🙏
|
||||
|
||||
@@ -210,348 +328,151 @@ jobs:
|
||||
|
||||
请参阅[贡献指南](./CONTRIBUTING.md)了解如何开始。一如既往,感谢我们出色的贡献者!
|
||||
|
||||
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调">
|
||||
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/>
|
||||
</a>
|
||||
<a href="https://github.com/fwqaaq" title="fwqaaq">
|
||||
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/>
|
||||
</a>
|
||||
<a href="https://github.com/mofelee" title="mofelee">
|
||||
<img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/>
|
||||
</a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang">
|
||||
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/>
|
||||
</a>
|
||||
<a href="https://github.com/aixcyi" title="砹小翼">
|
||||
<img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/>
|
||||
</a>
|
||||
<a href="https://github.com/Alex-Programmer-Bro" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</a>
|
||||
<a href="https://github.com/Country-If" title="Maylon">
|
||||
<img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/>
|
||||
</a>
|
||||
<a href="https://github.com/LufsX" title="LufsX">
|
||||
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
||||
</a>
|
||||
<a href="https://github.com/expoli" title="expoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/k23223" title="k23223">
|
||||
<img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/>
|
||||
</a>
|
||||
<a href="https://github.com/eryajf" title="二丫讲梵">
|
||||
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
|
||||
</a>
|
||||
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu">
|
||||
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/>
|
||||
</a>
|
||||
<a href="https://github.com/mailbaoer" title="baoer">
|
||||
<img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/>
|
||||
</a>
|
||||
<a href="https://github.com/chaos-cn" title="chaos">
|
||||
<img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/>
|
||||
</a>
|
||||
<a href="https://github.com/MackDing" title="Blossom">
|
||||
<img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/>
|
||||
</a>
|
||||
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice">
|
||||
<img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/>
|
||||
</a>
|
||||
<a href="https://github.com/qyl27" title="秋 雨落">
|
||||
<img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/>
|
||||
</a>
|
||||
<a href="https://github.com/undefined-hestudio" title="undefined">
|
||||
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/>
|
||||
</a>
|
||||
<a href="https://github.com/webeautiful" title="Albert">
|
||||
<img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/>
|
||||
</a>
|
||||
<a href="https://github.com/dadatom" title="Da Da">
|
||||
<img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/>
|
||||
</a>
|
||||
<a href="https://github.com/XYZscratcher" title="XYZ">
|
||||
<img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/>
|
||||
</a>
|
||||
<a href="https://github.com/1834423612" title="kjch">
|
||||
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
||||
</a>
|
||||
<a href="https://github.com/mancuoj" title="mancuoj">
|
||||
<img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/>
|
||||
</a>
|
||||
<a href="https://github.com/pangxiaoli" title="pangxiaoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/partoneplay" title="partoneplay">
|
||||
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
|
||||
</a>
|
||||
<a href="https://github.com/ryanhex53" title="ryanhex53">
|
||||
<img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/>
|
||||
</a>
|
||||
<a href="https://github.com/catcto" title="catcto">
|
||||
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="catcto"/>
|
||||
</a>
|
||||
<a href="https://github.com/itldg" title="老大哥">
|
||||
<img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/>
|
||||
</a>
|
||||
<a href="https://github.com/wsypower" title="魏">
|
||||
<img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/>
|
||||
</a>
|
||||
<a href="https://github.com/13812700839" title="花殇">
|
||||
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
|
||||
</a>
|
||||
<a href="https://github.com/dousha0w0" title="dousha0w0">
|
||||
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/>
|
||||
</a>
|
||||
<a href="https://github.com/Brid9e" title="Joe">
|
||||
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/>
|
||||
</a>
|
||||
<a href="https://github.com/ch3nnn" title="chentong">
|
||||
<img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/>
|
||||
</a>
|
||||
<a href="https://github.com/CharlotteZeng" title="hanchZ">
|
||||
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
|
||||
</a>
|
||||
<a href="https://github.com/ohto-ai" title="Choo">
|
||||
<img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/>
|
||||
</a>
|
||||
<a href="https://github.com/Damao2250" title="Damao">
|
||||
<img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/>
|
||||
</a>
|
||||
<a href="https://github.com/dasferco" title="Dasferco">
|
||||
<img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/>
|
||||
</a>
|
||||
<a href="https://github.com/demigodliu" title="DemigodLiu">
|
||||
<img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/>
|
||||
</a>
|
||||
<a href="https://github.com/eeeeeio" title="EEEEE">
|
||||
<img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/>
|
||||
</a>
|
||||
<a href="https://github.com/sirius-fan" title="Fan">
|
||||
<img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/>
|
||||
</a>
|
||||
<a href="https://github.com/Fuku-L" title="Fuku-L">
|
||||
<img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Fuku-L"/>
|
||||
</a>
|
||||
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu">
|
||||
<img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/>
|
||||
</a>
|
||||
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma">
|
||||
<img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/>
|
||||
</a>
|
||||
<a href="https://github.com/ljq" title="Jack Liu">
|
||||
<img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/>
|
||||
</a>
|
||||
<a href="https://github.com/jasnzhuang" title="Jason Zhuang">
|
||||
<img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/>
|
||||
</a>
|
||||
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
|
||||
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
|
||||
</a>
|
||||
<a href="https://github.com/LightQuanta" title="Light_Quanta">
|
||||
<img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/>
|
||||
</a>
|
||||
<a href="https://github.com/Lihuagreek" title="Lihuagreek">
|
||||
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
|
||||
</a>
|
||||
<a href="https://github.com/likeshop-github" title="LikeShop技术社区">
|
||||
<img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="LikeShop技术社区"/>
|
||||
</a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
|
||||
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
|
||||
</a>
|
||||
<a href="https://github.com/malcolmyu" title="Minghao Yu">
|
||||
<img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/>
|
||||
</a>
|
||||
<a href="https://github.com/Moeyuuko" title="Moeyuuko">
|
||||
<img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/>
|
||||
</a>
|
||||
<a href="https://github.com/mo3et" title="Monet Lee">
|
||||
<img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/>
|
||||
</a>
|
||||
<a href="https://github.com/HanaNoryu" title="Noryu">
|
||||
<img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/>
|
||||
</a>
|
||||
<a href="https://github.com/Perzch" title="Perzch">
|
||||
<img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/>
|
||||
</a>
|
||||
<a href="https://github.com/PipecraftNet" title="Pipecraft">
|
||||
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
||||
</a>
|
||||
<a href="https://github.com/sevenleave" title="Poirot Hercule">
|
||||
<img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/>
|
||||
</a>
|
||||
<a href="https://github.com/QDelta" title="QDelta">
|
||||
<img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/>
|
||||
</a>
|
||||
<a href="https://github.com/RivailleF" title="RivailleF">
|
||||
<img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/>
|
||||
</a>
|
||||
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou">
|
||||
<img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/>
|
||||
</a>
|
||||
<a href="https://github.com/SkylarLeo" title="SkylarLeo">
|
||||
<img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="SkylarLeo"/>
|
||||
</a>
|
||||
<a href="https://github.com/YLee9527" title="Terry Young">
|
||||
<img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/>
|
||||
</a>
|
||||
<a href="https://github.com/whb1998a" title="WHB">
|
||||
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
||||
</a>
|
||||
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()">
|
||||
<img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/>
|
||||
</a>
|
||||
<a href="https://github.com/hi-liyan" title="嘉木旅人">
|
||||
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="嘉木旅人"/>
|
||||
</a>
|
||||
<a href="https://github.com/Yo-gurts" title="Yogurt">
|
||||
<img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/>
|
||||
</a>
|
||||
<a href="https://github.com/dfshizhiqiang" title="Zech">
|
||||
<img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/>
|
||||
</a>
|
||||
<a href="https://github.com/yikuaibro" title="yikuaibro">
|
||||
<img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/>
|
||||
</a>
|
||||
<a href="https://github.com/zhu0629" title="cc">
|
||||
<img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="cc"/>
|
||||
</a>
|
||||
<a href="https://github.com/Leaderzhangyi" title="ZinkCas">
|
||||
<img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/>
|
||||
</a>
|
||||
<a href="https://github.com/y52y" title="Zyj">
|
||||
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
||||
</a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm">
|
||||
<img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/>
|
||||
</a>
|
||||
<a href="https://github.com/chyok" title="chyok">
|
||||
<img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/>
|
||||
</a>
|
||||
<a href="https://github.com/gaoxiaoduan" title="CoderDuan">
|
||||
<img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/>
|
||||
</a>
|
||||
<a href="https://github.com/cool9203" title="cool9203">
|
||||
<img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/>
|
||||
</a>
|
||||
<a href="https://github.com/fakevn" title="fakevn">
|
||||
<img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/>
|
||||
</a>
|
||||
<a href="https://github.com/fjqz177" title="fjqz177">
|
||||
<img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/>
|
||||
</a>
|
||||
<a href="https://github.com/gi-b716" title="gi-b716">
|
||||
<img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="gi-b716"/>
|
||||
</a>
|
||||
<a href="https://github.com/godotc" title="godot42">
|
||||
<img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/>
|
||||
</a>
|
||||
<a href="https://github.com/greyhao" title="greyhao">
|
||||
<img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/>
|
||||
</a>
|
||||
<a href="https://github.com/sunny0826" title="Xudong Guo">
|
||||
<img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/>
|
||||
</a>
|
||||
<a href="https://github.com/hua03" title="hua03">
|
||||
<img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/>
|
||||
</a>
|
||||
<a href="https://github.com/yanxuplay" title="hupilan">
|
||||
<img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/>
|
||||
</a>
|
||||
<a href="https://github.com/hweining" title="hweining">
|
||||
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
|
||||
</a>
|
||||
<a href="https://github.com/infanx" title="infanx">
|
||||
<img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/>
|
||||
</a>
|
||||
<a href="https://github.com/auroraslot" title="Tang Weize">
|
||||
<img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="Tang Weize"/>
|
||||
</a>
|
||||
<a href="https://github.com/joyfully-W" title="joyfully-W">
|
||||
<img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/>
|
||||
</a>
|
||||
<a href="https://github.com/k983551019" title="k983551019">
|
||||
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
|
||||
</a>
|
||||
<a href="https://github.com/kdxcxs" title="kdxcxs">
|
||||
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
|
||||
</a>
|
||||
<a href="https://github.com/genius-kim" title="kim">
|
||||
<img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="kim"/>
|
||||
</a>
|
||||
<a href="https://github.com/kubeme" title="kubernetes for me">
|
||||
<img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/>
|
||||
</a>
|
||||
<a href="https://github.com/larry-xue" title="larry">
|
||||
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
||||
</a>
|
||||
<a href="https://github.com/liliangrong777" title="liliangrong777">
|
||||
<img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/>
|
||||
</a>
|
||||
<a href="https://github.com/lykjjj" title="lykjjj">
|
||||
<img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/>
|
||||
</a>
|
||||
<a href="https://github.com/miclon-dev" title="miclon-dev">
|
||||
<img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/>
|
||||
</a>
|
||||
<a href="https://github.com/onewesong" title="onewesong">
|
||||
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
|
||||
</a>
|
||||
<a href="https://github.com/phygerr" title="phygerr">
|
||||
<img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/>
|
||||
</a>
|
||||
<a href="https://github.com/Mowmowj" title="nexo">
|
||||
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/>
|
||||
</a>
|
||||
<a href="https://github.com/swift-fs" title="swift">
|
||||
<img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/>
|
||||
</a>
|
||||
<a href="https://github.com/wannima66" title="tmen">
|
||||
<img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/>
|
||||
</a>
|
||||
<a href="https://github.com/wjjwkwindy" title="Hudson Alen">
|
||||
<img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/>
|
||||
</a>
|
||||
<a href="https://github.com/xing133" title="xing133">
|
||||
<img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/>
|
||||
</a>
|
||||
<a href="https://github.com/hiyms" title="yms">
|
||||
<img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/>
|
||||
</a>
|
||||
<a href="https://github.com/zhouhw0306" title="zhouhw0306">
|
||||
<img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/>
|
||||
</a>
|
||||
<a href="https://github.com/zxx457" title="zxx457">
|
||||
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/>
|
||||
</a>
|
||||
<a href="https://github.com/lvzhenbo" title="吕振波">
|
||||
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
|
||||
</a>
|
||||
<a href="https://github.com/LuckyJie12" title="夜未央">
|
||||
<img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/>
|
||||
</a>
|
||||
<a href="https://github.com/ZIDOUZI" title="ZIDOUZI">
|
||||
<img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="ZIDOUZI"/>
|
||||
</a>
|
||||
<a href="https://github.com/lisheng741" title="芦荟柚子茶">
|
||||
<img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/>
|
||||
</a>
|
||||
<a href="https://github.com/HuaChan233" title="花开花落">
|
||||
<img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/>
|
||||
</a>
|
||||
<a href="https://github.com/1250422131" title="萌新杰少">
|
||||
<img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/>
|
||||
</a>
|
||||
<a href="https://github.com/qwxingzhe" title="行者">
|
||||
<img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/>
|
||||
</a>
|
||||
<a href="https://github.com/binscor" title="Zheng Nai Bin">
|
||||
<img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/>
|
||||
</a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样">
|
||||
<img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/>
|
||||
</a><!--GAMFC-END-->
|
||||
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调"><img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/></a>
|
||||
<a href="https://github.com/fwqaaq" title="fwqaaq"><img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/></a>
|
||||
<a href="https://github.com/mofelee" title="mofelee"><img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/></a>
|
||||
<a href="https://github.com/Country-If" title="Maylon"><img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/></a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang"><img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/></a>
|
||||
<a href="https://github.com/LesterChang0987" title="Steve Hartwell"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="Steve Hartwell"/></a>
|
||||
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"/></a>
|
||||
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/></a>
|
||||
<a href="https://github.com/Alex20180512" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/></a>
|
||||
<a href="https://github.com/undefined-hestudio" title="undefined"><img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/></a>
|
||||
<a href="https://github.com/eryajf" title="二丫讲梵"><img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/></a>
|
||||
<a href="https://github.com/k23223" title="k23223"><img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/></a>
|
||||
<a href="https://github.com/expoli" title="expoli"><img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/></a>
|
||||
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/></a>
|
||||
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/></a>
|
||||
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice"><img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/></a>
|
||||
<a href="https://github.com/genius-kim" title="Kim同学"><img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="Kim同学"/></a>
|
||||
<a href="https://github.com/qyl27" title="秋 雨落"><img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/></a>
|
||||
<a href="https://github.com/MackDing" title="Blossom"><img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/></a>
|
||||
<a href="https://github.com/1250422131" title="萌新杰少"><img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/></a>
|
||||
<a href="https://github.com/zhangymPerson" title="zhangym"><img src="https://avatars.githubusercontent.com/u/40376181?v=4" width="42;" alt="zhangym"/></a>
|
||||
<a href="https://github.com/chaos-cn" title="chaos"><img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/></a>
|
||||
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
|
||||
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
|
||||
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
|
||||
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
|
||||
<a href="https://github.com/wsypower" title="魏"><img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/></a>
|
||||
<a href="https://github.com/itldg" title="老大哥"><img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/></a>
|
||||
<a href="https://github.com/catcto" title="小武Alan"><img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="小武Alan"/></a>
|
||||
<a href="https://github.com/ryanhex53" title="ryanhex53"><img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/></a>
|
||||
<a href="https://github.com/partoneplay" title="partoneplay"><img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/></a>
|
||||
<a href="https://github.com/pangxiaoli" title="pangxiaoli"><img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/></a>
|
||||
<a href="https://github.com/mancuoj" title="mancuoj"><img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/></a>
|
||||
<a href="https://github.com/webeautiful" title="Albert"><img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/></a>
|
||||
<a href="https://github.com/dadatom" title="Da Da"><img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/></a>
|
||||
<a href="https://github.com/ljq" title="Jack Liu"><img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/></a>
|
||||
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
|
||||
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
|
||||
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
|
||||
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
|
||||
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
|
||||
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
|
||||
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
|
||||
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
|
||||
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
|
||||
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
|
||||
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
|
||||
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
|
||||
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
|
||||
<a href="https://github.com/auroraslot" title="irony"><img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="irony"/></a>
|
||||
<a href="https://github.com/jlchen5" title="jlchen5"><img src="https://avatars.githubusercontent.com/u/61578993?v=4" width="42;" alt="jlchen5"/></a>
|
||||
<a href="https://github.com/joyfully-W" title="joyfully-W"><img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/></a>
|
||||
<a href="https://github.com/jqzhao7" title="jqzhao"><img src="https://avatars.githubusercontent.com/u/54694535?v=4" width="42;" alt="jqzhao"/></a>
|
||||
<a href="https://github.com/jussker" title="jussker"><img src="https://avatars.githubusercontent.com/u/33953356?v=4" width="42;" alt="jussker"/></a>
|
||||
<a href="https://github.com/k983551019" title="k983551019"><img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/></a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
|
||||
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
|
||||
<a href="https://github.com/godotc" title="godot42"><img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/></a>
|
||||
<a href="https://github.com/gi-b716" title="Gavin"><img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="Gavin"/></a>
|
||||
<a href="https://github.com/fjqz177" title="fjqz177"><img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/></a>
|
||||
<a href="https://github.com/fakevn" title="fakevn"><img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/></a>
|
||||
<a href="https://github.com/cool9203" title="cool9203"><img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/></a>
|
||||
<a href="https://github.com/gaoxiaoduan" title="CoderDuan"><img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/></a>
|
||||
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
|
||||
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
|
||||
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
|
||||
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
|
||||
<a href="https://github.com/Leaderzhangyi" title="ZinkCas"><img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/></a>
|
||||
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
|
||||
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
|
||||
<a href="https://github.com/HanaChan233" title="花开花落"><img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/></a>
|
||||
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
|
||||
<a href="https://github.com/ZIDOUZI" title="ZIDOUZI"><img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="ZIDOUZI"/></a>
|
||||
<a href="https://github.com/LuckyJie12" title="夜未央"><img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/></a>
|
||||
<a href="https://github.com/lvzhenbo" title="吕振波"><img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/></a>
|
||||
<a href="https://github.com/zxx457" title="zxx457"><img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/></a>
|
||||
<a href="https://github.com/zhouhw0306" title="zhouhw0306"><img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/></a>
|
||||
<a href="https://github.com/hiyms" title="yms"><img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/></a>
|
||||
<a href="https://github.com/xing133" title="xing133"><img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/></a>
|
||||
<a href="https://github.com/wjjwkwindy" title="Hudson Alen"><img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/></a>
|
||||
<a href="https://github.com/wannima66" title="tmen"><img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/></a>
|
||||
<a href="https://github.com/swift-fs" title="swift"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/></a>
|
||||
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
|
||||
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
|
||||
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
|
||||
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
|
||||
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
|
||||
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
|
||||
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
|
||||
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
|
||||
<a href="https://github.com/larry-xue" title="larry"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/></a>
|
||||
<a href="https://github.com/kubeme" title="kubernetes for me"><img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/></a>
|
||||
<a href="https://github.com/kdxcxs" title="kdxcxs"><img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/></a>
|
||||
<a href="https://github.com/zhu0629" title="zhucong"><img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/></a>
|
||||
<a href="https://github.com/likeshop-github" title="likeshop技术社区"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeshop技术社区"/></a>
|
||||
<a href="https://github.com/Lihuagreek" title="Lihuagreek"><img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/></a>
|
||||
<a href="https://github.com/LightQuanta" title="Light_Quanta"><img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/></a>
|
||||
<a href="https://github.com/JetSquirrel" title="JetSquirrel"><img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/></a>
|
||||
<a href="https://github.com/jeremyjone" title="Jeremy Jone"><img src="https://avatars.githubusercontent.com/u/37676231?v=4" width="42;" alt="Jeremy Jone"/></a>
|
||||
<a href="https://github.com/JavaZeroo" title="JavaZero"><img src="https://avatars.githubusercontent.com/u/71128095?v=4" width="42;" alt="JavaZero"/></a>
|
||||
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma"><img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/></a>
|
||||
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu"><img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/></a>
|
||||
<a href="https://github.com/Fuku-L" title="Fuku-L"><img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Fuku-L"/></a>
|
||||
<a href="https://github.com/sirius-fan" title="Fan"><img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/></a>
|
||||
<a href="https://github.com/eeeeeio" title="EEEEE"><img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/></a>
|
||||
<a href="https://github.com/demigodliu" title="DemigodLiu"><img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/></a>
|
||||
<a href="https://github.com/dasferco" title="Dasferco"><img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/></a>
|
||||
<a href="https://github.com/Damao2250" title="Damao"><img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/></a>
|
||||
<a href="https://github.com/DEEMO101" title="DEEMO101"><img src="https://avatars.githubusercontent.com/u/35123091?v=4" width="42;" alt="DEEMO101"/></a>
|
||||
<a href="https://github.com/ohto-ai" title="Choo"><img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/></a>
|
||||
<a href="https://github.com/CharlotteZeng" title="hanchZ"><img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/></a>
|
||||
<a href="https://github.com/ch3nnn" title="chentong"><img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/></a>
|
||||
<a href="https://github.com/Brid9e" title="Joe"><img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/></a>
|
||||
<a href="https://github.com/BobH-Official" title="BobH"><img src="https://avatars.githubusercontent.com/u/29333228?v=4" width="42;" alt="BobH"/></a>
|
||||
<a href="https://github.com/Blanket58" title="Blanket58"><img src="https://avatars.githubusercontent.com/u/39766189?v=4" width="42;" alt="Blanket58"/></a>
|
||||
<a href="https://github.com/BlacAmDK" title="BlacAmDK"><img src="https://avatars.githubusercontent.com/u/10971397?v=4" width="42;" alt="BlacAmDK"/></a>
|
||||
<a href="https://github.com/gitchenze" title="Aze"><img src="https://avatars.githubusercontent.com/u/13357869?v=4" width="42;" alt="Aze"/></a>
|
||||
<a href="https://github.com/dousha0w0" title="dousha0w0"><img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/></a>
|
||||
<a href="https://github.com/13812700839" title="花殇"><img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/></a>
|
||||
<a href="https://github.com/yikuaibro" title="yikuaibro"><img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/></a>
|
||||
<a href="https://github.com/dfshizhiqiang" title="Zech"><img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/></a>
|
||||
<a href="https://github.com/Yo-gurts" title="Yogurt"><img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/></a>
|
||||
<a href="https://github.com/hi-liyan" title="李李李"><img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="李李李"/></a>
|
||||
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()"><img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/></a>
|
||||
<a href="https://github.com/dwgeneral" title="Happy-Engineer"><img src="https://avatars.githubusercontent.com/u/8654993?v=4" width="42;" alt="Happy-Engineer"/></a>
|
||||
<a href="https://github.com/whb1998a" title="Wafer"><img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="Wafer"/></a>
|
||||
<a href="https://github.com/YLee9527" title="Terry Young"><img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/></a>
|
||||
<a href="https://github.com/TRDSCSH" title="TRDSCSH"><img src="https://avatars.githubusercontent.com/u/125717891?v=4" width="42;" alt="TRDSCSH"/></a>
|
||||
<a href="https://github.com/Xiwin" title="Xiwin"><img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/></a>
|
||||
<a href="https://github.com/DataEraserC" title="Sacabambaspis"><img src="https://avatars.githubusercontent.com/u/102341238?v=4" width="42;" alt="Sacabambaspis"/></a>
|
||||
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou"><img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/></a>
|
||||
<a href="https://github.com/RivailleF" title="RivailleF"><img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/></a>
|
||||
<a href="https://github.com/QDelta" title="QDelta"><img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/></a>
|
||||
<a href="https://github.com/sevenleave" title="Poirot Hercule"><img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/></a>
|
||||
<a href="https://github.com/PipecraftNet" title="Pipecraft"><img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/></a>
|
||||
<a href="https://github.com/Perzch" title="Perzch"><img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/></a>
|
||||
<a href="https://github.com/PILIHU2022" title="PILIHU2022"><img src="https://avatars.githubusercontent.com/u/100511118?v=4" width="42;" alt="PILIHU2022"/></a>
|
||||
<a href="https://github.com/HanaNoryu" title="Noryu"><img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/></a>
|
||||
<a href="https://github.com/NianwenDan" title="NianwenDan"><img src="https://avatars.githubusercontent.com/u/74407127?v=4" width="42;" alt="NianwenDan"/></a>
|
||||
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
|
||||
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
|
||||
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a>
|
||||
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a><!--GAMFC-END-->
|
||||
|
||||
上图贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成贡献者图片。
|
||||
|
||||
|
||||
602
README.md
@@ -25,8 +25,8 @@ Quick Reference
|
||||
[C#](./docs/cs.md)<!--rehype:style=background: rgb(6 147 13);&class=contributing-->
|
||||
[Django](./docs/django.md)<!--rehype:style=background: rgb(12 75 51);&class=contributing tag&data-lang=Python-->
|
||||
[FFmpeg](./docs/ffmpeg.md)<!--rehype:style=background: rgb(0 193 9);&class=contributing-->
|
||||
[Flask](./docs/flask.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[FastAPI](./docs/fastapi.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[Flask](./docs/flask.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[FastAPI](./docs/fastapi.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[Flutter](./docs/flutter.md)<!--rehype:style=background: rgb(150 220 254);&class=contributing tag&data-lang=Dart-->
|
||||
[Gitlab CI/CD](./docs/gitlab-ci.md)<!--rehype:style=background: rgb(226 67 41);&class=contributing-->
|
||||
[LaTeX](./docs/latex.md)<!--rehype:style=background: rgb(0 128 128);&class=contributing-->
|
||||
@@ -36,20 +36,26 @@ Quick Reference
|
||||
[Oracle](./docs/oracle.md)<!--rehype:style=background: rgb(255 0 0);&class=contributing tag&data-lang=SQL-->
|
||||
[Pytorch](./docs/pytorch.md)<!--rehype:style=background: rgb(238 76 44);&class=contributing tag&data-lang=Python&data-info=👆看看还缺点儿什么?-->
|
||||
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=contributing-->
|
||||
[Github Copilot](./docs/github-copilot.md)<!--rehype:style=background: rgb(125 45 220);&class=tag contributing&data-lang=AI&data-info=👆看看还缺点儿什么?-->
|
||||
[Chown](./docs/chown.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing-->
|
||||
[R 语言](./docs/r.md)<!--rehype:style=background: rgb(39 108 192);&class=contributing-->
|
||||
[Elixir](./docs/elixir.md)<!--rehype:style=background: rgb(124 26 156);&class=contributing tag&data-lang=Elixir-->
|
||||
[Tauri](./docs/tauri.md)<!--rehype:style=background: rgb(103 214 237);&class=contributing-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 编程
|
||||
|
||||
[Bash](./docs/bash.md)<!--rehype:style=background: rgb(72 143 223);-->
|
||||
[C](./docs/c.md)<!--rehype:style=background: rgb(92 107 192);-->
|
||||
[C 语言](./docs/c.md)<!--rehype:style=background: rgb(92 107 192);-->
|
||||
[C#](./docs/cs.md)<!--rehype:style=background: rgb(6 147 13);&class=contributing-->
|
||||
[C++](./docs/cpp.md)<!--rehype:style=background: rgb(6 147 13);&class=contributing-->
|
||||
[Dart](./docs/dart.md)<!--rehype:style=background: rgb(64 196 255);-->
|
||||
[Docker](./docs/docker.md)<!--rehype:style=background: rgb(72 143 223);-->
|
||||
[Dockerfile](./docs/dockerfile.md)<!--rehype:style=background: rgb(0 72 153);&class=tag&data-lang=Docker-->
|
||||
[Django](./docs/django.md)<!--rehype:style=background: rgb(12 75 51);&class=contributing tag&data-lang=Python-->
|
||||
[Flask](./docs/flask.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[FastAPI](./docs/fastapi.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[Django](./docs/django.md)<!--rehype:style=background: rgb(12 75 51);&class=contributing tag&data-lang=Python-->
|
||||
[Elixir](./docs/elixir.md)<!--rehype:style=background: rgb(124 26 156);&class=contributing tag&data-lang=Elixir-->
|
||||
[Flask](./docs/flask.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[FastAPI](./docs/fastapi.md)<!--rehype:style=background: rgb(210 168 255);&class=contributing tag&data-lang=Python-->
|
||||
[Flutter](./docs/flutter.md)<!--rehype:style=background: rgb(150 220 254);&class=contributing tag&data-lang=Dart-->
|
||||
[Golang](./docs/golang.md)<!--rehype:style=background: rgb(39 160 193);-->
|
||||
[GraphQL](./docs/graphql.md)<!--rehype:style=background: rgb(214 66 146);-->
|
||||
@@ -63,6 +69,7 @@ Quick Reference
|
||||
[MATLAB](./docs/matlab.md)<!--rehype:style=background: rgb(0 118 168);&class=contributing-->
|
||||
[PHP](./docs/php.md)<!--rehype:style=background: rgb(79 91 147);-->
|
||||
[Python](./docs/python.md)<!--rehype:style=background: rgb(43 91 132);-->
|
||||
[R 语言](./docs/r.md)<!--rehype:style=background: rgb(39 108 192);&class=contributing&data-info-->
|
||||
[Ruby](./docs/ruby.md)<!--rehype:style=background: rgb(204 52 45);-->
|
||||
[Rust](./docs/rust.md)<!--rehype:style=background: rgb(71 71 71);-->
|
||||
[Scala](./docs/scala.md)<!--rehype:style=background: rgb(34 82 94);-->
|
||||
@@ -95,6 +102,7 @@ Quick Reference
|
||||
[React Native](./docs/react-native.md)<!--rehype:style=background: rgb(34 143 173);&class=tag&data-lang=React-->
|
||||
[RegEx 正则表达式](./docs/regex.md)<!--rehype:style=background: rgb(149 36 155);-->
|
||||
[TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198);-->
|
||||
[Tauri](./docs/tauri.md)<!--rehype:style=background: rgb(103 214 237);&class=contributing-->
|
||||
[Vue 2](./docs/vue2.md)<!--rehype:style=background: rgb(64 184 131);-->
|
||||
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=contributing-->
|
||||
[</> htmx](./docs/htmx.md)<!--rehype:style=background: rgb(52 101 164);&class=contributing-->
|
||||
@@ -113,7 +121,7 @@ Quick Reference
|
||||
## Nodejs
|
||||
|
||||
[Express.js](./docs/expressjs.md)<!--rehype:style=background: rgb(95 151 206);-->
|
||||
[Ejs](./docs/ejs.md)<!--rehype:style=background: rgb(169 30 80);&class=tag&data-lang=JavaScript-->
|
||||
[Ejs](./docs/ejs.md)<!--rehype:style=background: rgb(169 30 80);&class=tag&data-lang=JavaScript-->
|
||||
[Jest](./docs/jest.md)<!--rehype:style=background: rgb(153 66 91);-->
|
||||
[Koa.js](./docs/koajs.md)<!--rehype:style=background: rgb(95 151 206);-->
|
||||
[Lerna](./docs/lerna.md)<!--rehype:style=background: rgb(192 132 252);-->
|
||||
@@ -122,6 +130,7 @@ Quick Reference
|
||||
[PM2](./docs/pm2.md)<!--rehype:style=background: rgb(73 117 241);&class=contributing-->
|
||||
[package.json](./docs/package.json.md)<!--rehype:style=background: rgb(132 132 132);-->
|
||||
[Yarn](./docs/yarn.md)<!--rehype:style=background: rgb(33 136 182);-->
|
||||
[nvm](./docs/nvm.md)<!--rehype:style=background: rgb(132 132 132);-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 工具
|
||||
@@ -139,46 +148,54 @@ Quick Reference
|
||||
[ADB, Android Debug Bridge](./docs/adb.md)<!--rehype:style=background: rgb(238 0 0);&class=contributing tag&data-lang=Android&data-info=👆看看还缺点儿什么?-->
|
||||
[Ansible](./docs/ansible.md)<!--rehype:style=background: rgb(238 0 0);&class=contributing tag&data-lang=RedHat&data-info=👆看看还缺点儿什么?-->
|
||||
[Awk](./docs/awk.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Conan](./docs/conan.md)<!--rehype:style=background: rgb(0 193 9);&class=tag&data-lang=C/C++-->
|
||||
[Conda](./docs/conda.md)<!--rehype:style=background: rgb(68 168 51);&class=tag&data-lang=Python-->
|
||||
[CocoaPods](./docs/cocoapods.md)<!--rehype:style=background: rgb(251 0 6);&class=tag&data-lang=C/C++-->
|
||||
[Cargo](./docs/cargo.md)<!--rehype:style=background: rgb(71 71 71);&class=tag&data-lang=Rust-->
|
||||
[Curl](./docs/curl.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Chown](./docs/chown.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing-->
|
||||
[Cron](./docs/cron.md)<!--rehype:style=background: rgb(239 68 68);-->
|
||||
[CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192);&class=contributing-->
|
||||
[Make](./docs/make.md)<!--rehype:style=background: rgb(99 99 99);&class=contributing-->
|
||||
[Gdb](./docs/gdb.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[CMD](./docs/cmd.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Find](./docs/find.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[FFmpeg](./docs/ffmpeg.md)<!--rehype:style=background: rgb(0 193 9);&class=contributing-->
|
||||
[Gdb](./docs/gdb.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=版本控制-->
|
||||
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Htop](./docs/htop.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Homebrew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87);&class=tag&data-lang=macOS-->
|
||||
[Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[iptables](./docs/iptables.md)<!--rehype:style=background: rgb(32 74 135);-->
|
||||
[jq](./docs/jq.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=JSON-->
|
||||
[Justfile](./docs/justfile.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Lsof](./docs/lsof.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
|
||||
[Make](./docs/make.md)<!--rehype:style=background: rgb(99 99 99);&class=contributing-->
|
||||
[Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Netcat](./docs/netcat.md)<!--rehype:style=background: rgb(4 92 135);-->
|
||||
[OpenSSL](./docs/openssl.md)<!--rehype:style=background: rgb(114 20 18);-->
|
||||
[ps](./docs/ps.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Pandoc](./docs/pandoc.md)<!--rehype:style=background: rgb(99 99 99);&class=tag&data-lang=文档转换器-->
|
||||
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Systemd](./docs/systemd.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[SSH](./docs/ssh.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Subversion (SVN)](./docs/subversion.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Subversion (SVN)](./docs/subversion.md)<!--rehype:style=background: rgb(99 99 99);&class=tag&data-lang=版本控制-->
|
||||
[Screen](./docs/screen.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Sysdig](./docs/sysdig.md)<!--rehype:style=background: rgb(1 171 199);-->
|
||||
[Tmux](./docs/tmux.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Taskset](./docs/taskset.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[YUM](./docs/yum.md)<!--rehype:style=background: rgb(86 86 123);-->
|
||||
[CMD](./docs/cmd.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Zip](./docs/zip.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=解压缩-->
|
||||
[Zip](./docs/zip.md)<!--rehype:style=background: rgb(99 99 99);&class=tag&data-lang=解压缩-->
|
||||
[FTP](./docs/ftp.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 工具箱
|
||||
|
||||
[APT](./docs/apt.md)<!--rehype:style=background: rgb(30 144 255);-->
|
||||
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||
[pacman](./docs/pacman.md)<!--rehype:style=background: rgb(24 147 209);&class=tag&data-lang=archlinux&class=contributing-->
|
||||
[Conan](./docs/conan.md)<!--rehype:style=background: rgb(0 193 9);&class=tag&data-lang=C/C++-->
|
||||
[Conda](./docs/conda.md)<!--rehype:style=background: rgb(68 168 51);&class=tag&data-lang=Python-->
|
||||
[CocoaPods](./docs/cocoapods.md)<!--rehype:style=background: rgb(251 0 6);&class=tag&data-lang=C/C++-->
|
||||
[Cargo](./docs/cargo.md)<!--rehype:style=background: rgb(71 71 71);&class=tag&data-lang=Rust-->
|
||||
[Homebrew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87);&class=tag&data-lang=macOS-->
|
||||
[Linux Command](./docs/linux-command.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=命令速查-->
|
||||
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
|
||||
[Pacman](./docs/pacman.md)<!--rehype:style=background: rgb(24 147 209);&class=tag&data-lang=archlinux&class=contributing-->
|
||||
[YUM](./docs/yum.md)<!--rehype:style=background: rgb(86 86 123);-->
|
||||
[SDKMAN](./docs/sdkman.md)<!--rehype:style=background: rgb(0 118 198);-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 数据库
|
||||
@@ -188,6 +205,8 @@ Quick Reference
|
||||
[Oracle](./docs/oracle.md)<!--rehype:style=background: rgb(255 0 0);&class=tag&data-lang=SQL-->
|
||||
[PostgreSQL](./docs/postgres.md)<!--rehype:style=background: rgb(43 109 163);&class=tag&data-lang=SQL-->
|
||||
[Redis](./docs/redis.md)<!--rehype:style=background: rgb(198 47 44);-->
|
||||
[Elasticsearch](./docs/elasticsearch.md)<!--rehype:style=background: rgb(36 187 177);-->
|
||||
[Neo4j](./docs/neo4j.md)<!--rehype:style=background: rgb(86 86 123);-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 快捷键
|
||||
@@ -198,14 +217,18 @@ Quick Reference
|
||||
[Android Studio](./docs/android-studio.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Blender](./docs/blender.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Firefox](./docs/firefox.md)<!--rehype:style=background: rgb(253 53 76);-->
|
||||
[Finder](./docs/finder.md)<!--rehype:style=background: rgb(253 53 76);&class=tag&data-lang=macOS-->
|
||||
[Figma](./docs/figma.md)<!--rehype:style=background: rgb(147 90 238);-->
|
||||
[Gmail](./docs/gmail.md)<!--rehype:style=background: rgb(234 67 54);-->
|
||||
[Gitlab](./docs/gitlab.md)<!--rehype:style=background: rgb(226 67 41);-->
|
||||
[Google Chrome](./docs/google-chrome.md)<!--rehype:style=background: rgb(29 116 232);-->
|
||||
[IntelliJ IDEA](./docs/intelli-j-idea.md)<!--rehype:style=background: rgb(223 148 0);&class=tag&data-lang=Java-->
|
||||
[PyCharm](./docs/pycharm.md)<!--rehype:style=background: rgb(36 215 137);&class=tag&data-lang=Python-->
|
||||
[PhpStorm](./docs/phpstorm.md)<!--rehype:style=\-\-bg\-opacity: 0.75;background-image: linear-gradient(to left, rgba(255 106 172 / var(\-\-bg\-opacity)), rgba(183 173 255 / var(\-\-bg\-opacity)));-->
|
||||
[Sketch](./docs/sketch.md)<!--rehype:style=background: rgb(223 148 0);&class=tag&data-lang=macOS-->
|
||||
[Sublime Text](./docs/sublime-text.md)<!--rehype:style=background: rgb(223 148 0);-->
|
||||
[VSCode](./docs/vscode.md)<!--rehype:style=background: rgb(91 163 230);-->
|
||||
[Twitter](./docs/twitter.md)<!--rehype:style=background: rgb(91 163 230);-->
|
||||
[WebStorm](./docs/webstorm.md)<!--rehype:style=background: rgb(32 148 220);-->
|
||||
[Xcode](./docs/xcode.md)<!--rehype:style=background: rgb(24 151 233);&class=tag&data-lang=macOS-->
|
||||
<!--rehype:class=home-card-->
|
||||
@@ -221,7 +244,8 @@ Quick Reference
|
||||
[Colors Named](./docs/colors-named.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=CSS-->
|
||||
[HTTP 状态码](./docs/http-status-code.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[HTML 字符实体](./docs/html-char.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=HTML-->
|
||||
[ISO 639-1 Language Code](./docs/iso-639-1.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[ISO-3166 国家代码](./docs/iso-3166-1.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[ISO-639 语言代码](./docs/iso-639-1.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Emoji](./docs/emoji.md)<!--rehype:style=\-\-bg\-opacity: 0.75;background-image: linear-gradient(to left, rgba(74 222 128 / var(\-\-bg\-opacity)), rgba(59 130 246 / var(\-\-bg\-opacity)));-->
|
||||
[MIME types](./docs/mime.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Resolutions](./docs/resolutions.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
@@ -242,348 +266,151 @@ Quick Reference
|
||||
请参阅 [Quick Reference](./docs/quickreference.md) 了解如何开始。一如既往,感谢我们出色的[贡献者](https://github.com/jaywcjlove/reference/graphs/contributors)!
|
||||
<!--rehype:style=padding-bottom:1rem;-->
|
||||
|
||||
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调">
|
||||
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/>
|
||||
</a>
|
||||
<a href="https://github.com/fwqaaq" title="fwqaaq">
|
||||
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/>
|
||||
</a>
|
||||
<a href="https://github.com/mofelee" title="mofelee">
|
||||
<img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/>
|
||||
</a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang">
|
||||
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/>
|
||||
</a>
|
||||
<a href="https://github.com/aixcyi" title="砹小翼">
|
||||
<img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/>
|
||||
</a>
|
||||
<a href="https://github.com/Alex-Programmer-Bro" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</a>
|
||||
<a href="https://github.com/Country-If" title="Maylon">
|
||||
<img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/>
|
||||
</a>
|
||||
<a href="https://github.com/LufsX" title="LufsX">
|
||||
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
||||
</a>
|
||||
<a href="https://github.com/expoli" title="expoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/k23223" title="k23223">
|
||||
<img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/>
|
||||
</a>
|
||||
<a href="https://github.com/eryajf" title="二丫讲梵">
|
||||
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
|
||||
</a>
|
||||
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu">
|
||||
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/>
|
||||
</a>
|
||||
<a href="https://github.com/mailbaoer" title="baoer">
|
||||
<img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/>
|
||||
</a>
|
||||
<a href="https://github.com/chaos-cn" title="chaos">
|
||||
<img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/>
|
||||
</a>
|
||||
<a href="https://github.com/MackDing" title="Blossom">
|
||||
<img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/>
|
||||
</a>
|
||||
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice">
|
||||
<img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/>
|
||||
</a>
|
||||
<a href="https://github.com/qyl27" title="秋 雨落">
|
||||
<img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/>
|
||||
</a>
|
||||
<a href="https://github.com/undefined-hestudio" title="undefined">
|
||||
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/>
|
||||
</a>
|
||||
<a href="https://github.com/webeautiful" title="Albert">
|
||||
<img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/>
|
||||
</a>
|
||||
<a href="https://github.com/dadatom" title="Da Da">
|
||||
<img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/>
|
||||
</a>
|
||||
<a href="https://github.com/XYZscratcher" title="XYZ">
|
||||
<img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/>
|
||||
</a>
|
||||
<a href="https://github.com/1834423612" title="kjch">
|
||||
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
||||
</a>
|
||||
<a href="https://github.com/mancuoj" title="mancuoj">
|
||||
<img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/>
|
||||
</a>
|
||||
<a href="https://github.com/pangxiaoli" title="pangxiaoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/partoneplay" title="partoneplay">
|
||||
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
|
||||
</a>
|
||||
<a href="https://github.com/ryanhex53" title="ryanhex53">
|
||||
<img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/>
|
||||
</a>
|
||||
<a href="https://github.com/catcto" title="catcto">
|
||||
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="catcto"/>
|
||||
</a>
|
||||
<a href="https://github.com/itldg" title="老大哥">
|
||||
<img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/>
|
||||
</a>
|
||||
<a href="https://github.com/wsypower" title="魏">
|
||||
<img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/>
|
||||
</a>
|
||||
<a href="https://github.com/13812700839" title="花殇">
|
||||
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
|
||||
</a>
|
||||
<a href="https://github.com/dousha0w0" title="dousha0w0">
|
||||
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/>
|
||||
</a>
|
||||
<a href="https://github.com/Brid9e" title="Joe">
|
||||
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/>
|
||||
</a>
|
||||
<a href="https://github.com/ch3nnn" title="chentong">
|
||||
<img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/>
|
||||
</a>
|
||||
<a href="https://github.com/CharlotteZeng" title="hanchZ">
|
||||
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
|
||||
</a>
|
||||
<a href="https://github.com/ohto-ai" title="Choo">
|
||||
<img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/>
|
||||
</a>
|
||||
<a href="https://github.com/Damao2250" title="Damao">
|
||||
<img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/>
|
||||
</a>
|
||||
<a href="https://github.com/dasferco" title="Dasferco">
|
||||
<img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/>
|
||||
</a>
|
||||
<a href="https://github.com/demigodliu" title="DemigodLiu">
|
||||
<img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/>
|
||||
</a>
|
||||
<a href="https://github.com/eeeeeio" title="EEEEE">
|
||||
<img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/>
|
||||
</a>
|
||||
<a href="https://github.com/sirius-fan" title="Fan">
|
||||
<img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/>
|
||||
</a>
|
||||
<a href="https://github.com/Fuku-L" title="Fuku-L">
|
||||
<img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Fuku-L"/>
|
||||
</a>
|
||||
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu">
|
||||
<img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/>
|
||||
</a>
|
||||
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma">
|
||||
<img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/>
|
||||
</a>
|
||||
<a href="https://github.com/ljq" title="Jack Liu">
|
||||
<img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/>
|
||||
</a>
|
||||
<a href="https://github.com/jasnzhuang" title="Jason Zhuang">
|
||||
<img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/>
|
||||
</a>
|
||||
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
|
||||
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
|
||||
</a>
|
||||
<a href="https://github.com/LightQuanta" title="Light_Quanta">
|
||||
<img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/>
|
||||
</a>
|
||||
<a href="https://github.com/Lihuagreek" title="Lihuagreek">
|
||||
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
|
||||
</a>
|
||||
<a href="https://github.com/likeshop-github" title="LikeShop技术社区">
|
||||
<img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="LikeShop技术社区"/>
|
||||
</a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
|
||||
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
|
||||
</a>
|
||||
<a href="https://github.com/malcolmyu" title="Minghao Yu">
|
||||
<img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/>
|
||||
</a>
|
||||
<a href="https://github.com/Moeyuuko" title="Moeyuuko">
|
||||
<img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/>
|
||||
</a>
|
||||
<a href="https://github.com/mo3et" title="Monet Lee">
|
||||
<img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/>
|
||||
</a>
|
||||
<a href="https://github.com/HanaNoryu" title="Noryu">
|
||||
<img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/>
|
||||
</a>
|
||||
<a href="https://github.com/Perzch" title="Perzch">
|
||||
<img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/>
|
||||
</a>
|
||||
<a href="https://github.com/PipecraftNet" title="Pipecraft">
|
||||
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
||||
</a>
|
||||
<a href="https://github.com/sevenleave" title="Poirot Hercule">
|
||||
<img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/>
|
||||
</a>
|
||||
<a href="https://github.com/QDelta" title="QDelta">
|
||||
<img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/>
|
||||
</a>
|
||||
<a href="https://github.com/RivailleF" title="RivailleF">
|
||||
<img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/>
|
||||
</a>
|
||||
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou">
|
||||
<img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/>
|
||||
</a>
|
||||
<a href="https://github.com/SkylarLeo" title="SkylarLeo">
|
||||
<img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="SkylarLeo"/>
|
||||
</a>
|
||||
<a href="https://github.com/YLee9527" title="Terry Young">
|
||||
<img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/>
|
||||
</a>
|
||||
<a href="https://github.com/whb1998a" title="WHB">
|
||||
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
||||
</a>
|
||||
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()">
|
||||
<img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/>
|
||||
</a>
|
||||
<a href="https://github.com/hi-liyan" title="嘉木旅人">
|
||||
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="嘉木旅人"/>
|
||||
</a>
|
||||
<a href="https://github.com/Yo-gurts" title="Yogurt">
|
||||
<img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/>
|
||||
</a>
|
||||
<a href="https://github.com/dfshizhiqiang" title="Zech">
|
||||
<img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/>
|
||||
</a>
|
||||
<a href="https://github.com/yikuaibro" title="yikuaibro">
|
||||
<img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/>
|
||||
</a>
|
||||
<a href="https://github.com/zhu0629" title="cc">
|
||||
<img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="cc"/>
|
||||
</a>
|
||||
<a href="https://github.com/Leaderzhangyi" title="ZinkCas">
|
||||
<img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/>
|
||||
</a>
|
||||
<a href="https://github.com/y52y" title="Zyj">
|
||||
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
||||
</a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm">
|
||||
<img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/>
|
||||
</a>
|
||||
<a href="https://github.com/chyok" title="chyok">
|
||||
<img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/>
|
||||
</a>
|
||||
<a href="https://github.com/gaoxiaoduan" title="CoderDuan">
|
||||
<img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/>
|
||||
</a>
|
||||
<a href="https://github.com/cool9203" title="cool9203">
|
||||
<img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/>
|
||||
</a>
|
||||
<a href="https://github.com/fakevn" title="fakevn">
|
||||
<img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/>
|
||||
</a>
|
||||
<a href="https://github.com/fjqz177" title="fjqz177">
|
||||
<img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/>
|
||||
</a>
|
||||
<a href="https://github.com/gi-b716" title="gi-b716">
|
||||
<img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="gi-b716"/>
|
||||
</a>
|
||||
<a href="https://github.com/godotc" title="godot42">
|
||||
<img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/>
|
||||
</a>
|
||||
<a href="https://github.com/greyhao" title="greyhao">
|
||||
<img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/>
|
||||
</a>
|
||||
<a href="https://github.com/sunny0826" title="Xudong Guo">
|
||||
<img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/>
|
||||
</a>
|
||||
<a href="https://github.com/hua03" title="hua03">
|
||||
<img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/>
|
||||
</a>
|
||||
<a href="https://github.com/yanxuplay" title="hupilan">
|
||||
<img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/>
|
||||
</a>
|
||||
<a href="https://github.com/hweining" title="hweining">
|
||||
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
|
||||
</a>
|
||||
<a href="https://github.com/infanx" title="infanx">
|
||||
<img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/>
|
||||
</a>
|
||||
<a href="https://github.com/auroraslot" title="Tang Weize">
|
||||
<img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="Tang Weize"/>
|
||||
</a>
|
||||
<a href="https://github.com/joyfully-W" title="joyfully-W">
|
||||
<img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/>
|
||||
</a>
|
||||
<a href="https://github.com/k983551019" title="k983551019">
|
||||
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
|
||||
</a>
|
||||
<a href="https://github.com/kdxcxs" title="kdxcxs">
|
||||
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
|
||||
</a>
|
||||
<a href="https://github.com/genius-kim" title="kim">
|
||||
<img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="kim"/>
|
||||
</a>
|
||||
<a href="https://github.com/kubeme" title="kubernetes for me">
|
||||
<img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/>
|
||||
</a>
|
||||
<a href="https://github.com/larry-xue" title="larry">
|
||||
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
||||
</a>
|
||||
<a href="https://github.com/liliangrong777" title="liliangrong777">
|
||||
<img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/>
|
||||
</a>
|
||||
<a href="https://github.com/lykjjj" title="lykjjj">
|
||||
<img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/>
|
||||
</a>
|
||||
<a href="https://github.com/miclon-dev" title="miclon-dev">
|
||||
<img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/>
|
||||
</a>
|
||||
<a href="https://github.com/onewesong" title="onewesong">
|
||||
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
|
||||
</a>
|
||||
<a href="https://github.com/phygerr" title="phygerr">
|
||||
<img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/>
|
||||
</a>
|
||||
<a href="https://github.com/Mowmowj" title="nexo">
|
||||
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/>
|
||||
</a>
|
||||
<a href="https://github.com/swift-fs" title="swift">
|
||||
<img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/>
|
||||
</a>
|
||||
<a href="https://github.com/wannima66" title="tmen">
|
||||
<img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/>
|
||||
</a>
|
||||
<a href="https://github.com/wjjwkwindy" title="Hudson Alen">
|
||||
<img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/>
|
||||
</a>
|
||||
<a href="https://github.com/xing133" title="xing133">
|
||||
<img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/>
|
||||
</a>
|
||||
<a href="https://github.com/hiyms" title="yms">
|
||||
<img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/>
|
||||
</a>
|
||||
<a href="https://github.com/zhouhw0306" title="zhouhw0306">
|
||||
<img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/>
|
||||
</a>
|
||||
<a href="https://github.com/zxx457" title="zxx457">
|
||||
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/>
|
||||
</a>
|
||||
<a href="https://github.com/lvzhenbo" title="吕振波">
|
||||
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
|
||||
</a>
|
||||
<a href="https://github.com/LuckyJie12" title="夜未央">
|
||||
<img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/>
|
||||
</a>
|
||||
<a href="https://github.com/ZIDOUZI" title="ZIDOUZI">
|
||||
<img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="ZIDOUZI"/>
|
||||
</a>
|
||||
<a href="https://github.com/lisheng741" title="芦荟柚子茶">
|
||||
<img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/>
|
||||
</a>
|
||||
<a href="https://github.com/HuaChan233" title="花开花落">
|
||||
<img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/>
|
||||
</a>
|
||||
<a href="https://github.com/1250422131" title="萌新杰少">
|
||||
<img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/>
|
||||
</a>
|
||||
<a href="https://github.com/qwxingzhe" title="行者">
|
||||
<img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/>
|
||||
</a>
|
||||
<a href="https://github.com/binscor" title="Zheng Nai Bin">
|
||||
<img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/>
|
||||
</a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样">
|
||||
<img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/>
|
||||
</a><!--GAMFC-END-->
|
||||
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调"><img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调"/></a>
|
||||
<a href="https://github.com/fwqaaq" title="fwqaaq"><img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fwqaaq"/></a>
|
||||
<a href="https://github.com/mofelee" title="mofelee"><img src="https://avatars.githubusercontent.com/u/5069410?v=4" width="42;" alt="mofelee"/></a>
|
||||
<a href="https://github.com/Country-If" title="Maylon"><img src="https://avatars.githubusercontent.com/u/62837275?v=4" width="42;" alt="Maylon"/></a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson Huang"><img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson Huang"/></a>
|
||||
<a href="https://github.com/LesterChang0987" title="Steve Hartwell"><img src="https://avatars.githubusercontent.com/u/114913921?v=4" width="42;" alt="Steve Hartwell"/></a>
|
||||
<a href="https://github.com/nangongchengfeng" title="南宫乘风"><img src="https://avatars.githubusercontent.com/u/46562911?v=4" width="42;" alt="南宫乘风"/></a>
|
||||
<a href="https://github.com/aixcyi" title="砹小翼"><img src="https://avatars.githubusercontent.com/u/75880483?v=4" width="42;" alt="砹小翼"/></a>
|
||||
<a href="https://github.com/Alex20180512" title="Alex"><img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/></a>
|
||||
<a href="https://github.com/undefined-hestudio" title="undefined"><img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="undefined"/></a>
|
||||
<a href="https://github.com/eryajf" title="二丫讲梵"><img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/></a>
|
||||
<a href="https://github.com/k23223" title="k23223"><img src="https://avatars.githubusercontent.com/u/57606136?v=4" width="42;" alt="k23223"/></a>
|
||||
<a href="https://github.com/expoli" title="expoli"><img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/></a>
|
||||
<a href="https://github.com/mailbaoer" title="baoer"><img src="https://avatars.githubusercontent.com/u/5282978?v=4" width="42;" alt="baoer"/></a>
|
||||
<a href="https://github.com/LufsX" title="LufsX"><img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/></a>
|
||||
<a href="https://github.com/Darkiiiiiice" title="Darkiiiiiice"><img src="https://avatars.githubusercontent.com/u/3959555?v=4" width="42;" alt="Darkiiiiiice"/></a>
|
||||
<a href="https://github.com/genius-kim" title="Kim同学"><img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="Kim同学"/></a>
|
||||
<a href="https://github.com/qyl27" title="秋 雨落"><img src="https://avatars.githubusercontent.com/u/53731501?v=4" width="42;" alt="秋 雨落"/></a>
|
||||
<a href="https://github.com/MackDing" title="Blossom"><img src="https://avatars.githubusercontent.com/u/19878893?v=4" width="42;" alt="Blossom"/></a>
|
||||
<a href="https://github.com/1250422131" title="萌新杰少"><img src="https://avatars.githubusercontent.com/u/52126790?v=4" width="42;" alt="萌新杰少"/></a>
|
||||
<a href="https://github.com/zhangymPerson" title="zhangym"><img src="https://avatars.githubusercontent.com/u/40376181?v=4" width="42;" alt="zhangym"/></a>
|
||||
<a href="https://github.com/chaos-cn" title="chaos"><img src="https://avatars.githubusercontent.com/u/71205599?v=4" width="42;" alt="chaos"/></a>
|
||||
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
|
||||
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
|
||||
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
|
||||
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
|
||||
<a href="https://github.com/wsypower" title="魏"><img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/></a>
|
||||
<a href="https://github.com/itldg" title="老大哥"><img src="https://avatars.githubusercontent.com/u/13432299?v=4" width="42;" alt="老大哥"/></a>
|
||||
<a href="https://github.com/catcto" title="小武Alan"><img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="小武Alan"/></a>
|
||||
<a href="https://github.com/ryanhex53" title="ryanhex53"><img src="https://avatars.githubusercontent.com/u/360426?v=4" width="42;" alt="ryanhex53"/></a>
|
||||
<a href="https://github.com/partoneplay" title="partoneplay"><img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/></a>
|
||||
<a href="https://github.com/pangxiaoli" title="pangxiaoli"><img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/></a>
|
||||
<a href="https://github.com/mancuoj" title="mancuoj"><img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/></a>
|
||||
<a href="https://github.com/webeautiful" title="Albert"><img src="https://avatars.githubusercontent.com/u/3364316?v=4" width="42;" alt="Albert"/></a>
|
||||
<a href="https://github.com/dadatom" title="Da Da"><img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/></a>
|
||||
<a href="https://github.com/ljq" title="Jack Liu"><img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/></a>
|
||||
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
|
||||
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
|
||||
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
|
||||
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
|
||||
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
|
||||
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
|
||||
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
|
||||
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
|
||||
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
|
||||
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
|
||||
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
|
||||
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
|
||||
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
|
||||
<a href="https://github.com/auroraslot" title="irony"><img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="irony"/></a>
|
||||
<a href="https://github.com/jlchen5" title="jlchen5"><img src="https://avatars.githubusercontent.com/u/61578993?v=4" width="42;" alt="jlchen5"/></a>
|
||||
<a href="https://github.com/joyfully-W" title="joyfully-W"><img src="https://avatars.githubusercontent.com/u/32212924?v=4" width="42;" alt="joyfully-W"/></a>
|
||||
<a href="https://github.com/jqzhao7" title="jqzhao"><img src="https://avatars.githubusercontent.com/u/54694535?v=4" width="42;" alt="jqzhao"/></a>
|
||||
<a href="https://github.com/jussker" title="jussker"><img src="https://avatars.githubusercontent.com/u/33953356?v=4" width="42;" alt="jussker"/></a>
|
||||
<a href="https://github.com/k983551019" title="k983551019"><img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/></a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
|
||||
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
|
||||
<a href="https://github.com/godotc" title="godot42"><img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godot42"/></a>
|
||||
<a href="https://github.com/gi-b716" title="Gavin"><img src="https://avatars.githubusercontent.com/u/78394473?v=4" width="42;" alt="Gavin"/></a>
|
||||
<a href="https://github.com/fjqz177" title="fjqz177"><img src="https://avatars.githubusercontent.com/u/83070583?v=4" width="42;" alt="fjqz177"/></a>
|
||||
<a href="https://github.com/fakevn" title="fakevn"><img src="https://avatars.githubusercontent.com/u/11464386?v=4" width="42;" alt="fakevn"/></a>
|
||||
<a href="https://github.com/cool9203" title="cool9203"><img src="https://avatars.githubusercontent.com/u/29609607?v=4" width="42;" alt="cool9203"/></a>
|
||||
<a href="https://github.com/gaoxiaoduan" title="CoderDuan"><img src="https://avatars.githubusercontent.com/u/69953511?v=4" width="42;" alt="CoderDuan"/></a>
|
||||
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
|
||||
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
|
||||
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
|
||||
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
|
||||
<a href="https://github.com/Leaderzhangyi" title="ZinkCas"><img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/></a>
|
||||
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
|
||||
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
|
||||
<a href="https://github.com/HanaChan233" title="花开花落"><img src="https://avatars.githubusercontent.com/u/75212820?v=4" width="42;" alt="花开花落"/></a>
|
||||
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
|
||||
<a href="https://github.com/ZIDOUZI" title="ZIDOUZI"><img src="https://avatars.githubusercontent.com/u/53157536?v=4" width="42;" alt="ZIDOUZI"/></a>
|
||||
<a href="https://github.com/LuckyJie12" title="夜未央"><img src="https://avatars.githubusercontent.com/u/102901105?v=4" width="42;" alt="夜未央"/></a>
|
||||
<a href="https://github.com/lvzhenbo" title="吕振波"><img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/></a>
|
||||
<a href="https://github.com/zxx457" title="zxx457"><img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx457"/></a>
|
||||
<a href="https://github.com/zhouhw0306" title="zhouhw0306"><img src="https://avatars.githubusercontent.com/u/82752681?v=4" width="42;" alt="zhouhw0306"/></a>
|
||||
<a href="https://github.com/hiyms" title="yms"><img src="https://avatars.githubusercontent.com/u/84654050?v=4" width="42;" alt="yms"/></a>
|
||||
<a href="https://github.com/xing133" title="xing133"><img src="https://avatars.githubusercontent.com/u/5336490?v=4" width="42;" alt="xing133"/></a>
|
||||
<a href="https://github.com/wjjwkwindy" title="Hudson Alen"><img src="https://avatars.githubusercontent.com/u/9508591?v=4" width="42;" alt="Hudson Alen"/></a>
|
||||
<a href="https://github.com/wannima66" title="tmen"><img src="https://avatars.githubusercontent.com/u/26410255?v=4" width="42;" alt="tmen"/></a>
|
||||
<a href="https://github.com/swift-fs" title="swift"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift"/></a>
|
||||
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
|
||||
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
|
||||
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
|
||||
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
|
||||
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
|
||||
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
|
||||
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
|
||||
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
|
||||
<a href="https://github.com/larry-xue" title="larry"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/></a>
|
||||
<a href="https://github.com/kubeme" title="kubernetes for me"><img src="https://avatars.githubusercontent.com/u/16346220?v=4" width="42;" alt="kubernetes for me"/></a>
|
||||
<a href="https://github.com/kdxcxs" title="kdxcxs"><img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/></a>
|
||||
<a href="https://github.com/zhu0629" title="zhucong"><img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/></a>
|
||||
<a href="https://github.com/likeshop-github" title="likeshop技术社区"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeshop技术社区"/></a>
|
||||
<a href="https://github.com/Lihuagreek" title="Lihuagreek"><img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/></a>
|
||||
<a href="https://github.com/LightQuanta" title="Light_Quanta"><img src="https://avatars.githubusercontent.com/u/18213217?v=4" width="42;" alt="Light_Quanta"/></a>
|
||||
<a href="https://github.com/JetSquirrel" title="JetSquirrel"><img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/></a>
|
||||
<a href="https://github.com/jeremyjone" title="Jeremy Jone"><img src="https://avatars.githubusercontent.com/u/37676231?v=4" width="42;" alt="Jeremy Jone"/></a>
|
||||
<a href="https://github.com/JavaZeroo" title="JavaZero"><img src="https://avatars.githubusercontent.com/u/71128095?v=4" width="42;" alt="JavaZero"/></a>
|
||||
<a href="https://github.com/Ding-Kyoma" title="HooinKyoma"><img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/></a>
|
||||
<a href="https://github.com/gongyeheyu" title="GONGYE Heyu"><img src="https://avatars.githubusercontent.com/u/85177605?v=4" width="42;" alt="GONGYE Heyu"/></a>
|
||||
<a href="https://github.com/Fuku-L" title="Fuku-L"><img src="https://avatars.githubusercontent.com/u/38535911?v=4" width="42;" alt="Fuku-L"/></a>
|
||||
<a href="https://github.com/sirius-fan" title="Fan"><img src="https://avatars.githubusercontent.com/u/25720015?v=4" width="42;" alt="Fan"/></a>
|
||||
<a href="https://github.com/eeeeeio" title="EEEEE"><img src="https://avatars.githubusercontent.com/u/20723545?v=4" width="42;" alt="EEEEE"/></a>
|
||||
<a href="https://github.com/demigodliu" title="DemigodLiu"><img src="https://avatars.githubusercontent.com/u/30372735?v=4" width="42;" alt="DemigodLiu"/></a>
|
||||
<a href="https://github.com/dasferco" title="Dasferco"><img src="https://avatars.githubusercontent.com/u/92622404?v=4" width="42;" alt="Dasferco"/></a>
|
||||
<a href="https://github.com/Damao2250" title="Damao"><img src="https://avatars.githubusercontent.com/u/19251992?v=4" width="42;" alt="Damao"/></a>
|
||||
<a href="https://github.com/DEEMO101" title="DEEMO101"><img src="https://avatars.githubusercontent.com/u/35123091?v=4" width="42;" alt="DEEMO101"/></a>
|
||||
<a href="https://github.com/ohto-ai" title="Choo"><img src="https://avatars.githubusercontent.com/u/46275725?v=4" width="42;" alt="Choo"/></a>
|
||||
<a href="https://github.com/CharlotteZeng" title="hanchZ"><img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/></a>
|
||||
<a href="https://github.com/ch3nnn" title="chentong"><img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="chentong"/></a>
|
||||
<a href="https://github.com/Brid9e" title="Joe"><img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Joe"/></a>
|
||||
<a href="https://github.com/BobH-Official" title="BobH"><img src="https://avatars.githubusercontent.com/u/29333228?v=4" width="42;" alt="BobH"/></a>
|
||||
<a href="https://github.com/Blanket58" title="Blanket58"><img src="https://avatars.githubusercontent.com/u/39766189?v=4" width="42;" alt="Blanket58"/></a>
|
||||
<a href="https://github.com/BlacAmDK" title="BlacAmDK"><img src="https://avatars.githubusercontent.com/u/10971397?v=4" width="42;" alt="BlacAmDK"/></a>
|
||||
<a href="https://github.com/gitchenze" title="Aze"><img src="https://avatars.githubusercontent.com/u/13357869?v=4" width="42;" alt="Aze"/></a>
|
||||
<a href="https://github.com/dousha0w0" title="dousha0w0"><img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/></a>
|
||||
<a href="https://github.com/13812700839" title="花殇"><img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/></a>
|
||||
<a href="https://github.com/yikuaibro" title="yikuaibro"><img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/></a>
|
||||
<a href="https://github.com/dfshizhiqiang" title="Zech"><img src="https://avatars.githubusercontent.com/u/7030019?v=4" width="42;" alt="Zech"/></a>
|
||||
<a href="https://github.com/Yo-gurts" title="Yogurt"><img src="https://avatars.githubusercontent.com/u/44612841?v=4" width="42;" alt="Yogurt"/></a>
|
||||
<a href="https://github.com/hi-liyan" title="李李李"><img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="李李李"/></a>
|
||||
<a href="https://github.com/BATTLEHAWK00" title="While True: learn()"><img src="https://avatars.githubusercontent.com/u/45313304?v=4" width="42;" alt="While True: learn()"/></a>
|
||||
<a href="https://github.com/dwgeneral" title="Happy-Engineer"><img src="https://avatars.githubusercontent.com/u/8654993?v=4" width="42;" alt="Happy-Engineer"/></a>
|
||||
<a href="https://github.com/whb1998a" title="Wafer"><img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="Wafer"/></a>
|
||||
<a href="https://github.com/YLee9527" title="Terry Young"><img src="https://avatars.githubusercontent.com/u/18697332?v=4" width="42;" alt="Terry Young"/></a>
|
||||
<a href="https://github.com/TRDSCSH" title="TRDSCSH"><img src="https://avatars.githubusercontent.com/u/125717891?v=4" width="42;" alt="TRDSCSH"/></a>
|
||||
<a href="https://github.com/Xiwin" title="Xiwin"><img src="https://avatars.githubusercontent.com/u/107191230?v=4" width="42;" alt="Xiwin"/></a>
|
||||
<a href="https://github.com/DataEraserC" title="Sacabambaspis"><img src="https://avatars.githubusercontent.com/u/102341238?v=4" width="42;" alt="Sacabambaspis"/></a>
|
||||
<a href="https://github.com/qinxiongzhou" title="Ryan Zhou"><img src="https://avatars.githubusercontent.com/u/33239096?v=4" width="42;" alt="Ryan Zhou"/></a>
|
||||
<a href="https://github.com/RivailleF" title="RivailleF"><img src="https://avatars.githubusercontent.com/u/93083015?v=4" width="42;" alt="RivailleF"/></a>
|
||||
<a href="https://github.com/QDelta" title="QDelta"><img src="https://avatars.githubusercontent.com/u/60222316?v=4" width="42;" alt="QDelta"/></a>
|
||||
<a href="https://github.com/sevenleave" title="Poirot Hercule"><img src="https://avatars.githubusercontent.com/u/24411140?v=4" width="42;" alt="Poirot Hercule"/></a>
|
||||
<a href="https://github.com/PipecraftNet" title="Pipecraft"><img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/></a>
|
||||
<a href="https://github.com/Perzch" title="Perzch"><img src="https://avatars.githubusercontent.com/u/67987641?v=4" width="42;" alt="Perzch"/></a>
|
||||
<a href="https://github.com/PILIHU2022" title="PILIHU2022"><img src="https://avatars.githubusercontent.com/u/100511118?v=4" width="42;" alt="PILIHU2022"/></a>
|
||||
<a href="https://github.com/HanaNoryu" title="Noryu"><img src="https://avatars.githubusercontent.com/u/109856546?v=4" width="42;" alt="Noryu"/></a>
|
||||
<a href="https://github.com/NianwenDan" title="NianwenDan"><img src="https://avatars.githubusercontent.com/u/74407127?v=4" width="42;" alt="NianwenDan"/></a>
|
||||
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
|
||||
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
|
||||
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a>
|
||||
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a><!--GAMFC-END-->
|
||||
|
||||
[贡献者](https://github.com/jaywcjlove/reference/graphs/contributors)列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 根据提交次数的先后顺序自动生成
|
||||
<!--rehype:style=padding-top:1rem;-->
|
||||
@@ -593,6 +420,7 @@ Quick Reference
|
||||
|
||||
由于中国国内访问,时常打不开,你可以访问下面镜像网站(国内打不开的不再收录)。推荐自己的[镜像网站](https://github.com/jaywcjlove/reference/discussions/206#discussion-4625735)
|
||||
|
||||
[dev.bi](https://dev.bi)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[server.wiki](https://ref.server.wiki)<!--rehype:target=_blank-->
|
||||
[nihaosi.com](https://refs.nihaosi.com)<!--rehype:target=_blank-->
|
||||
[quickref.cn](https://quickref.cn)<!--rehype:target=_blank-->
|
||||
@@ -607,6 +435,10 @@ Quick Reference
|
||||
[quickref.binscor.top](https://quickref.binscor.top)<!--rehype:target=_blank&data-info=👆每天自动同步-->
|
||||
[srebro.cn](https://ref.srebro.cn)<!--rehype:target=_blank&data-info=👆每天自动同步-->
|
||||
[haah.net](https://ref.haah.net)<!--rehype:target=_blank&data-info=👆每天自动同步-->
|
||||
[xiechengqi.top](https://ref.xiechengqi.top)<!--rehype:target=_blank&data-info=👆每天自动同步-->
|
||||
[ownit.top](https://memo.ownit.top)<!--rehype:target=_blank&data-info=👆每十分钟自动同步-->
|
||||
[666666.dev](https://cheat.666666.dev)<!--rehype:target=_blank&data-info=👆每天自动同步-->
|
||||
[mmoke.com](https://ref.mmoke.com)<!--rehype:target=_blank&data-info=👆每天自动同步-->
|
||||
[laoleng.vip](http://bbs.laoleng.vip/reference/)<!--rehype:target=_blank-->
|
||||
[dbyun.net](https://www.dbyun.net/reference/index.html)<!--rehype:target=_blank-->
|
||||
[if010.com](https://quickref.if010.com/)<!--rehype:target=_blank-->
|
||||
@@ -645,10 +477,46 @@ Quick Reference
|
||||
[chenchen.site](https://img.chenchen.site/reference/)<!--rehype:target=_blank-->
|
||||
[jgeek.cn](http://reference.jgeek.cn/)<!--rehype:target=_blank-->
|
||||
[itzcy.com](https://reference.itzcy.com/)<!--rehype:target=_blank-->
|
||||
[fifo.site](https://ref.fifo.site)<!--rehype:target=_blank-->
|
||||
[gaojs.com.cn](https://study.gaojs.com.cn)<!--rehype:target=_blank-->
|
||||
[15926.tech](https://ref.15926.tech)<!--rehype:target=_blank-->
|
||||
[jeffjade.com](https://codehelp.jeffjade.com)<!--rehype:target=_blank-->
|
||||
[okhk.net](https://ref.okhk.net)<!--rehype:target=_blank-->
|
||||
[wdft.com](https://ref.wdft.com)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[xuyiyang.vip](https://reference.xuyiyang.vip/)<!--rehype:target=_blank-->
|
||||
[zsccodelnc.cn](https://zsccodelnc.cn/coderef/)<!--rehype:target=_blank-->
|
||||
[chanlun.pro](https://ref.chanlun.pro)<!--rehype:target=_blank-->
|
||||
[likui.info](https://r.likui.info)<!--rehype:target=_blank-->
|
||||
[ruiange.work](https://code.ruiange.work/)<!--rehype:target=_blank-->
|
||||
[denganliang.com](https://ref.denganliang.com)<!--rehype:target=_blank-->
|
||||
[coderjia.cn](https://refer.coderjia.cn)<!--rehype:target=_blank-->
|
||||
[ivanz.cc](https://ref.ivanz.cc)<!--rehype:target=_blank-->
|
||||
[dev6.site](https://ref.dev6.site/)<!--rehype:target=_blank-->
|
||||
[mingming.dev](https://ref.mingming.dev)<!--rehype:target=_blank-->
|
||||
[clf.lol](https://ref.clf.lol/)<!--rehype:target=_blank-->
|
||||
[zishu.me](https://ref.zishu.me/)<!--rehype:target=_blank-->
|
||||
[sucan2233.cn](http://reference.sucan2233.cn)<!--rehype:target=_blank-->
|
||||
[reference-bk9.pages.dev](https://reference-bk9.pages.dev/)<!--rehype:target=_blank&class=contributing&data-info=👆自动实时同步-->
|
||||
[hrzweb.xyz](https://r.hrzweb.xyz)<!--rehype:target=_blank-->
|
||||
[bobh.cool](https://quickref.bobh.cool)<!--rehype:target=_blank-->
|
||||
[tangwudi.com](https://doc.tangwudi.com)<!--rehype:target=_blank-->
|
||||
[alomerry.com](https://ref.alomerry.com)<!--rehype:target=_blank-->
|
||||
[osz.icu](https://ref.osz.icu/)<!--rehype:target=_blank-->
|
||||
[ylmty.cc](https://docs.ylmty.cc)<!--rehype:target=_blank-->
|
||||
[g31.top](https://ref.g31.top/)<!--rehype:target=_blank-->
|
||||
[9up.dev](https://devref.9up.dev)<!--rehype:target=_blank-->
|
||||
[cizai.io](https://reference.cizai.io)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[docs.willxup.top](https://docs.willxup.top)<!--rehype:target=_blank-->
|
||||
[wangchunfei.com](https://ref.wangchunfei.com/)<!--rehype:target=_blank-->
|
||||
[object.cool](https://r.object.cool)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[luckyits.com](https://ref.luckyits.com/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[jeremyjone.com](https://ref.jeremyjone.com/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
<!--rehype:class=home-card home-links-->
|
||||
|
||||
如果你有资源,可以很方便[部署 web 版](https://github.com/jaywcjlove/reference/issues/102#issue-1451649637),这非常简单,只需要克隆 [gh-pages](https://github.com/jaywcjlove/reference/tree/gh-pages) 分支代码到你的静态服务就可以了,还可以使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版。
|
||||
|
||||
|
||||
|
||||
<!--rehype:ignore:start-->
|
||||
## License
|
||||
|
||||
|
||||
1
assets/chown.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 1024 1024" version="1.1" fill="currentColor" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em"><path d="M912.9 130.6c-26.1 4.5-52.8 6.9-80.2 6.9-115.4 0-221.1-41.9-302.6-111.2-10.6-9-26.2-9-36.8 0-81.5 69.4-187.2 111.2-302.6 111.2-27 0-53.5-2.3-79.2-6.7-17.2-2.9-32.9 10.4-33 27.9-0.2 109.1-0.4 238.1-0.4 242.5 0 471 394.5 592.7 431 603 1.8 0.5 3.6 0.5 5.4 0C550.9 994 943 873 945.5 405.7l0.4-247c0-17.6-15.8-31.1-33-28.1zM546 568.9v154.5c0 18.8-15.2 34-34 34s-34-15.2-34-34V568.9c-68.2-15.5-119.1-76.4-119.1-149.3 0-84.5 68.5-153.1 153.1-153.1S665.1 335 665.1 419.6c0 72.9-50.9 133.9-119.1 149.3z"></path></svg>
|
||||
|
After Width: | Height: | Size: 640 B |
5
assets/elasticsearch.svg
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg viewBox="0 0 256 288" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
|
||||
<path d="M0 143.82c0 12.44 1.744 24.441 4.71 35.956h175.067c19.856 0 35.955-16.1 35.955-35.956 0-19.865-16.1-35.955-35.955-35.955H4.71C1.744 119.371 0 131.38 0 143.82" fill="#343741"/>
|
||||
<path d="M242.013 68.863c5.025-4.629 9.7-9.6 13.987-14.93C229.636 21.079 189.213 0 143.82 0 87 0 38.101 33.052 14.775 80.9h196.559c11.38 0 22.319-4.324 30.678-12.037" fill="#FEC514"/>
|
||||
<path d="M211.334 206.742H14.774c23.336 47.839 72.226 80.9 129.045 80.9 45.393 0 85.816-21.088 112.18-53.933a136.604 136.604 0 0 0-13.987-14.94c-8.36-7.721-19.299-12.027-30.678-12.027" fill="#00BFB3"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 703 B |
1
assets/elixir.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711950965872" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4680" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M519.381333 967.722667c-164.693333 0-298.24-155.306667-298.24-346.88 0-156.928 118.314667-348.672 209.749334-465.493334 43.264-55.296 125.013333-99.072 125.013333-99.072s-41.898667 223.530667 71.808 312.277334c100.949333 78.805333 175.189333 181.333333 175.189333 271.488 0 180.565333-118.784 327.68-283.52 327.68z" fill="currentColor" p-id="4681"></path></svg>
|
||||
|
After Width: | Height: | Size: 694 B |
7
assets/figma.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7.678 7.68" height="1em" width="1em">
|
||||
<path d="M2.56 7.68A1.28 1.28 0 0 0 3.84 6.4V5.12H2.56a1.28 1.28 0 0 0 0 2.56z" fill="#0acf83"/>
|
||||
<path d="M1.28 3.84a1.28 1.28 0 0 1 1.28-1.28h1.28v2.56H2.56a1.28 1.28 0 0 1-1.28-1.28z" fill="#a259ff"/>
|
||||
<path d="M1.28 1.28A1.28 1.28 0 0 1 2.559 0h1.28v2.56H2.56a1.28 1.28 0 0 1-1.28-1.28z" fill="#f24e1e"/>
|
||||
<path d="M3.84 0h1.28a1.28 1.28 0 0 1 0 2.56H3.84z" fill="#ff7262"/>
|
||||
<path d="M6.4 3.84a1.28 1.28 0 0 1-2.56 0 1.28 1.28 0 0 1 2.56 0z" fill="#1abcfe"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 568 B |
1
assets/finder.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 465 512"><path fill="currentColor" d="M248.872 63.164H0v381.678h261.91c-5.933-22.006-9.425-44.83-10.382-68.447c-68.347 4.003-133.766-13.78-180.387-34.21l8.366-19.544c57.24 24.51 114.676 35.3 171.812 32.432c.446-20.1 2.592-40.72 6.53-61.851h-80.66c-1.25-89.57 29.694-162.884 71.683-230.058m-134.6 60.62h21.255v51.408h-21.256z"/><path fill="currentColor" d="M275.335 353.01c37.076-4.358 73.997-14.42 110.621-30.343l8.48 19.491c-39.404 17.135-79.134 27.89-119.027 32.342c.925 24.412 4.796 47.862 11.426 70.342h177.716V63.164H277.265c-48.15 73.047-72.046 138.577-75.561 206.144h85.683c-4.489 18.091-10.965 48.315-12.052 83.702m60.787-177.818h-21.256v-51.407h21.256zM277.265 63.164c10.43-15.824 21.947-31.984 34.7-48.613L292.992 0c-16.643 21.701-31.247 42.669-44.12 63.164zm-15.378 381.678c6.312 23.342 15.365 45.765 27.28 67.158l20.893-11.635c-9.876-17.731-17.584-36.272-23.275-55.523z"/></svg>
|
||||
|
After Width: | Height: | Size: 968 B |
4
assets/github-copilot.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="1em" height="1em" viewBox="0 0 600 528" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M300.05 526.091C129.331 526.091 5.42623 417.044 0.748474 385.796V312.898C3.92935 289.397 26.0832 249.805 60.1747 235.622C60.6612 233.002 61.0728 230.27 61.5219 227.464C62.6071 220.615 63.7672 213.094 66.237 204.561C58.7152 185.551 56.7318 163.996 56.7318 142.59C56.7318 110.033 61.5219 76.3908 82.6653 49.6341C104.333 22.2037 138.574 7.57172 184.603 2.4449C229.734 -2.56966 269.252 3.71724 294.773 31.0728C296.645 33.0561 298.366 35.1143 299.975 37.2474C301.622 35.1143 303.493 33.0561 305.326 31.0728C330.848 3.71724 370.366 -2.56966 415.497 2.4449C461.526 7.57172 495.767 22.2037 517.435 49.6341C538.615 76.3908 543.368 110.033 543.368 142.59C543.368 163.996 541.385 185.551 533.863 204.561C536.333 213.094 537.53 220.615 538.578 227.464C539.027 230.308 539.476 233.002 539.963 235.622C574.541 250.029 596.919 290.669 599.501 314.021V384.075C599.501 412.74 474.1 526.091 300.05 526.091ZM300.05 470.52C385.372 470.52 471.593 428.981 487.235 416.894V257.663L486.374 253.322C468.037 261.181 446.146 264.212 421.746 264.212C378.861 264.212 344.694 251.975 320.333 227.127C312.303 218.871 305.498 209.508 300.125 199.322C294.697 209.512 287.842 218.875 279.767 227.127C255.443 251.975 221.277 264.212 178.353 264.212C153.954 264.212 132.1 261.181 113.726 253.322L112.865 257.663V416.894C128.545 428.981 214.728 470.52 300.05 470.52ZM253.796 69.3555C246.574 61.6466 229.958 53.9002 190.852 58.2412C152.719 62.4698 135.505 73.3597 126.748 84.4366C117.505 96.1123 112.94 113.963 112.94 142.59C112.94 172.266 117.767 186.412 124.466 193.896C130.528 200.669 143.888 208.079 178.428 208.079C210.349 208.079 228.536 199.285 239.726 187.871C251.514 175.821 259.447 156.923 262.815 129.755C267.193 94.7651 261.43 77.5509 253.796 69.3555ZM409.285 58.2412C370.216 53.9002 353.601 61.6466 346.378 69.3555C338.744 77.5509 332.944 94.7651 337.322 129.755C340.728 156.923 348.661 175.821 360.449 187.871C371.638 199.285 389.788 208.079 421.746 208.079C456.25 208.079 469.647 200.669 475.709 193.896C482.408 186.412 487.235 172.266 487.235 142.59C487.235 113.963 482.632 96.1123 473.389 84.4366C464.669 73.3597 447.455 62.4698 409.285 58.2412Z"/>
|
||||
<path d="M234.636 301.634C242.08 301.634 249.219 304.591 254.482 309.855C259.746 315.118 262.703 322.257 262.703 329.701V385.871C262.703 393.315 259.746 400.454 254.482 405.717C249.219 410.981 242.08 413.938 234.636 413.938C227.193 413.938 220.054 410.981 214.79 405.717C209.527 400.454 206.57 393.315 206.57 385.871V329.701C206.57 322.257 209.527 315.118 214.79 309.855C220.054 304.591 227.193 301.634 234.636 301.634ZM393.68 329.701V385.871C393.68 393.315 390.723 400.454 385.459 405.717C380.196 410.981 373.057 413.938 365.613 413.938C358.17 413.938 351.031 410.981 345.767 405.717C340.504 400.454 337.547 393.315 337.547 385.871V329.701C337.547 322.257 340.504 315.118 345.767 309.855C351.031 304.591 358.17 301.634 365.613 301.634C373.057 301.634 380.196 304.591 385.459 309.855C390.723 315.118 393.68 322.257 393.68 329.701Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
1
assets/neo4j.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" fill="#4581C3" role="img" viewBox="0 0 24 24"><title>Neo4j</title><path d="M9.629 13.227c-.593 0-1.139.2-1.58.533l-2.892-1.976a2.61 2.61 0 0 0 .101-.711 2.633 2.633 0 0 0-2.629-2.629A2.632 2.632 0 0 0 0 11.073a2.632 2.632 0 0 0 2.629 2.629c.593 0 1.139-.2 1.579-.533L7.1 15.145c-.063.226-.1.465-.1.711 0 .247.037.484.1.711l-2.892 1.976a2.608 2.608 0 0 0-1.579-.533A2.632 2.632 0 0 0 0 20.639a2.632 2.632 0 0 0 2.629 2.629 2.632 2.632 0 0 0 2.629-2.629c0-.247-.037-.485-.101-.711l2.892-1.976c.441.333.987.533 1.58.533a2.633 2.633 0 0 0 2.629-2.629c0-1.45-1.18-2.629-2.629-2.629ZM16.112.732c-4.72 0-7.888 2.748-7.888 8.082v3.802a3.525 3.525 0 0 1 3.071.008v-3.81c0-3.459 1.907-5.237 4.817-5.237s4.817 1.778 4.817 5.237v8.309H24V8.814C24 3.448 20.832.732 16.112.732Z"/></svg>
|
||||
|
After Width: | Height: | Size: 837 B |
6
assets/nvm.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" fill="currentColor" height="1em" width="1em">
|
||||
<g>
|
||||
<path d="M499.8 990c-12.6 0-25.2-3.4-36.4-10.1l-115.9-71c-17.3-10-8.8-13.6-3.2-15.6 23.1-8.3 30-12.4 54.6-26.9 2.6-1.5 6-.9 8.7.7l86.9 51.4c3.2 1.9 7.8 1.9 10.8 0l339.5-201.8c3.2-1.9 5.3-5.8 5.3-9.7V298.5c0-4-2.1-7.9-5.4-9.9L505.3 81.5c-3.2-2-7.5-2-10.7 0L155.5 288.6c-3.4 2-5.5 5.9-5.5 9.8V707c0 4 2.1 7.7 5.4 9.6l87.3 52.4c51.6 26.7 82.2-.4 82.2-32V335.3c0-5.8 4.5-10.3 10.1-10.3h49.9c5.5 0 10.1 4.5 10.1 10.3v401.8c0 71.2-42.3 112.1-107.6 112.1-20 0-35.9 0-80-22.5l-91-54.2C93.9 759.1 80 734 80 707.1V292.6c0-26.9 13.9-52 36.5-65.4L463.6 19.6c21.9-12.9 51.1-12.9 72.9 0l347 207.5c22.5 13.5 36.5 38.6 36.5 65.4V707c0 26.9-13.9 52-36.5 65.5l-347 207.3c-11.1 6.6-23.7 10.1-36.5 10.1l-.2.1z" />
|
||||
<path d="M607.1 710c-141.3 0-183.8-69.1-183.8-129.7 0-5.8 4.5-10.3 10-10.3h44.9c5 0 9.2 3.7 10 8.8 6.7 47.3 36.6 68.1 118.8 68.1 73.1 0 103-22.6 103-62.7 0-23.2-7.6-40.3-121.2-51.8-95-9.7-153.8-31.4-153.8-110 0-72.5 59.1-114.8 158-114.8 100.9 0 167.3 30.6 173.2 111.2.2 2.9-.8 5.8-2.7 8-1.9 2.1-4.5 3.3-7.3 3.3h-45c-4.7 0-8.8-3.4-9.8-8.1-9.6-37.1-37.1-51.2-108.4-51.2-79.8 0-89.1 27.9-89.1 49.5 0 26.2 11 33.8 118.8 48.5C729.3 483.2 780 503.9 780 581.4c0 78.3-63.1 128.6-172.9 128.6z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
3
assets/phpstorm.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 256 256">
|
||||
<defs><linearGradient id="IconifyId18e425c03bba7dc7a0" x1="40.196%" x2="55.577%" y1="64.058%" y2="47.965%"><stop offset="0%" stop-color="#AF1DF5"/><stop offset="21%" stop-color="#BC20E4"/><stop offset="63%" stop-color="#DD29B8"/><stop offset="100%" stop-color="#FF318C"/></linearGradient><linearGradient id="IconifyId18e425c03bba7dc7a1" x1="42.885%" x2="63.378%" y1="78.603%" y2="-4.057%"><stop offset="2%" stop-color="#6B57FF"/><stop offset="42%" stop-color="#B74AF7"/><stop offset="75%" stop-color="#FF318C"/></linearGradient><linearGradient id="IconifyId18e425c03bba7dc7a2" x1="73.258%" x2="32.049%" y1="102.209%" y2="-3.688%"><stop offset="0%" stop-color="#293896"/><stop offset="8%" stop-color="#3B3AA2"/><stop offset="29%" stop-color="#6740C0"/><stop offset="49%" stop-color="#8A44D8"/><stop offset="68%" stop-color="#A347E9"/><stop offset="86%" stop-color="#B249F3"/><stop offset="100%" stop-color="#B74AF7"/></linearGradient><linearGradient id="IconifyId18e425c03bba7dc7a3" x1="62.87%" x2="39.747%" y1="72.446%" y2="45.568%"><stop offset="2%" stop-color="#6B57FF"/><stop offset="78%" stop-color="#B74AF7"/></linearGradient></defs><path fill="url(#IconifyId18e425c03bba7dc7a0)" d="M141.307 45.013L132.773 19.2L43.68 0L0 49.413l48 24.56v-28.96z"/><path fill="url(#IconifyId18e425c03bba7dc7a1)" d="m48 61.813l-48-12.4l24.4 146.56l23.52-.186z"/><path fill="url(#IconifyId18e425c03bba7dc7a2)" d="M208 45.013h-83.493L158.053 15.2l64.64 12L256 109.973l-47.973 47.654z"/><path fill="url(#IconifyId18e425c03bba7dc7a3)" d="M208.053 108.88L208 205.013H70.56l3.547 20.907L160.4 256l95.6-57.227z"/><path d="M47 43.771h162v162H47z"/><path fill="#FFF" d="M67.947 175.093h60v10h-60zm52.32-58.133l7.813-9.6a27.573 27.573 0 0 0 17.973 7.307c5.334 0 8.694-2.16 8.694-5.68v-.16c0-1.364-.343-2.46-1.422-3.451l-.242-.211a7.3 7.3 0 0 0-.557-.414l-.315-.204a11.058 11.058 0 0 0-.522-.302l-.382-.2a15.25 15.25 0 0 0-.201-.1l-.425-.198a20.305 20.305 0 0 0-.454-.198l-.484-.199a27.087 27.087 0 0 0-.254-.1l-.531-.198a34.56 34.56 0 0 0-.278-.1l-.58-.201l-.303-.101l-.63-.203l-.667-.205l-.702-.208c-.12-.035-.242-.07-.365-.104l-.758-.212l-.795-.215l-2.44-.633l-.766-.205l-1.126-.31l-.368-.105l-.728-.212l-.714-.215a67.125 67.125 0 0 1-.351-.11l-.694-.222l-.68-.226a50.843 50.843 0 0 1-.334-.116l-.658-.235l-.643-.24a23.119 23.119 0 0 1-.316-.124l-.622-.251l-.606-.259c-6.286-2.757-10.049-6.826-10.165-14.88l-.002-.573c0-10.792 8.59-17.981 20.68-18.131l.386-.003a34.667 34.667 0 0 1 22.347 7.654l-6.88 9.973a28.107 28.107 0 0 0-15.653-5.92c-5.067 0-7.734 2.32-7.734 5.333v.187c0 2.23.852 3.644 3.457 4.932l.414.197c.143.066.29.131.443.196l.472.195l.502.195l.533.195l.563.196l.596.198l.629.199l.662.202l1.057.308l1.137.318l1.219.328l1.303.341c.287.075.572.151.853.228l.836.232c.275.078.548.157.817.237l.8.242c.131.04.262.082.392.123l.772.25l.754.256c.372.13.737.262 1.096.397l.707.273c7.675 3.042 11.938 7.422 12.063 15.448l.003.554c0 11.947-9.12 18.667-22.106 18.667a38.27 38.27 0 0 1-25.52-9.627M68 65.333h24.533c14.15 0 22.786 8.312 22.958 20.354l.002.526c0 13.867-10.8 21.067-24.24 21.067h-9.92v17.973H68zm23.627 30.214c6.586 0 10.453-3.92 10.453-9.067v-.16c0-5.92-4.107-9.093-10.667-9.093h-10.08v18.32z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
1
assets/r.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4.29c-5.5 0-10 3-10 6.71c0 3.28 3.56 6 8.24 6.58v2.13h3.41v-2.12c.85-.09 1.64-.25 2.39-.48l1.38 2.6h3.86l-2.32-3.91C20.83 14.58 22 12.87 22 11c0-3.71-4.5-6.71-10-6.71m1.53 2.62c4.2 0 7.3 1.4 7.3 4.59c0 1.71-.92 2.91-2.42 3.65c-.09-.05-.17-.1-.22-.15c-.36-.16-.96-.34-.96-.34s2.98-.22 2.98-3.19c0-2.97-3.12-3.02-3.12-3.02h-6.85v7.16c-2.55-.74-4.31-2.31-4.31-4.11c0-2.54 3.4-4.59 7.6-4.59m.15 3.98h2.07s.95-.05.95.94c0 .97-.95.97-.95.97h-2.07zm-.03 4.41h.92c.18 0 .27.05.43.2c.13.1.27.29.39.46c-.55.07-1.13.1-1.74.1z"/></svg>
|
||||
|
After Width: | Height: | Size: 641 B |
6
assets/tauri.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg viewBox="0 0 256 289" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
|
||||
<path d="M178.497 104.93c0 15.155-12.285 27.44-27.44 27.44-15.153 0-27.438-12.285-27.438-27.44 0-15.153 12.285-27.438 27.439-27.438s27.439 12.285 27.439 27.439Z" fill="#FFC131"/>
|
||||
<circle fill="#24C8DB" transform="rotate(180 104.91 183.505)" cx="104.911" cy="183.505" r="27.439"/>
|
||||
<path d="M207.93 192.86a104.766 104.766 0 0 1-36.168 14.717 73.586 73.586 0 0 0 3.617-33.176c29.953-10.472 49.82-38.964 49.292-70.69-.53-31.727-21.336-59.542-51.622-69.008-30.286-9.467-63.23 1.546-81.733 27.324a122.227 122.227 0 0 0-40.16 11.723C64.86 29.536 105.956-.445 152.244.005c46.288.45 86.794 31.224 99.636 75.697 12.841 44.473-5.026 92.103-43.95 117.157ZM52.404 92.832l25.693 3.118a73.586 73.586 0 0 1 3.243-14.593 104.766 104.766 0 0 0-28.936 11.475Z" fill="#FFC131"/>
|
||||
<path d="M47.913 95.577a104.766 104.766 0 0 1 36.419-14.842 73.46 73.46 0 0 0-4.116 33.3c-29.847 10.619-49.549 39.148-48.906 70.822.642 31.673 21.484 59.38 51.738 68.78 30.253 9.399 63.127-1.62 81.604-27.352a122.227 122.227 0 0 0 40.16-11.6c-13.736 44.169-54.812 74.1-101.064 73.645-46.252-.453-86.733-31.184-99.602-75.612-12.87-44.427 4.92-92.037 43.768-117.141Zm155.528 100.026-.5.25.5-.25Z" fill="#24C8DB"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
3
assets/twitter.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M283.02655555 307.55600001c140.717 72.074 260.839 66.925 260.839 66.92499999s-44.617-157.87599999 94.384-228.234c138.998-70.359 236.816 48.048 236.816 48.048s24.025-6.863 42.901-13.728 44.617-18.87599999 44.61700001-18.876l-42.90100001 77.222 66.92500001-6.863s-8.579 12.014-34.31900001 36.038c-25.741 24.025-37.754 37.754-37.754 37.754s10.297 190.483-90.95 338.062c-99.53 147.58000001-229.952 235.099-417.002 253.973-187.05 18.87599999-310.606-58.347-310.606-58.347s82.37-5.149 133.852-24.025c51.483-20.592 126.99-73.79 126.99-73.79s-106.397-32.605-145.866-70.35899999-48.048-60.062-48.048-60.06200001l106.397-1.716s-111.542-60.062-142.433-106.397c-30.89-46.333-36.038-92.666-36.038-92.666l80.656 32.605s-66.925-92.666-77.222-163.025c-10.297-72.074 12.014-109.826 12.014-109.826s36.038 65.21 176.752 137.283z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 944 B |
@@ -127,10 +127,10 @@ $ adb pull /sdcard/test.txt pulledTest.txt
|
||||
`/data/data/<package>/shared_prefs/` | 共享偏好设置
|
||||
`/data/app` | 用户安装的 APK
|
||||
`/system/app` | 系统预装的 APK 文件
|
||||
`/mmt/asec` | 加密的应用程序(App2SD)
|
||||
`/mmt/emmc` | 内部 SD 卡
|
||||
`/mmt/adcard` | 外部/内部 SD 卡
|
||||
`/mmt/adcard/external_sd` | 外置 SD 卡
|
||||
`/mnt/asec` | 加密的应用程序(App2SD)
|
||||
`/mnt/emmc` | 内部 SD 卡
|
||||
`/mnt/sdcard` | 外部/内部 SD 卡
|
||||
`/mnt/sdcard/external_sd` | 外置 SD 卡
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
---
|
||||
|
||||
@@ -140,7 +140,7 @@ $ ansible target -m copy -a "src=/tmp/seq dest=/tmp/seq"
|
||||
### Ansible 命令帮助
|
||||
<!--rehype:wrap-class=col-span-2 row-span-3-->
|
||||
|
||||
```bash
|
||||
```shell
|
||||
$ ansible
|
||||
$ ansible <host-pattern> [options]
|
||||
```
|
||||
@@ -171,6 +171,7 @@ $ ansible <host-pattern> [options]
|
||||
`--vault-password-file=VAULT_PASSWORD_FILE` | 保险库密码文件
|
||||
`-v`, `--verbose` | 详细模式(-vvv 更多,-vvvv 启用连接调试)
|
||||
`--version` | 显示程序的版本号并退出
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
控制谁以及如何连接到主机,连接选项:
|
||||
|
||||
@@ -182,24 +183,26 @@ $ ansible <host-pattern> [options]
|
||||
`-c CONNECTION`, `--connection=CONNECTION` | 要使用的连接类型 (default=smart)
|
||||
`-T TIMEOUT`, `--timeout=TIMEOUT` | 以秒为单位覆盖连接超时 (default=10)
|
||||
`--ssh-common-args=SSH_COMMON_ARGS` | 指定要传递给 sftp/scp/ssh 的常用参数 (e.g. ProxyCommand)
|
||||
`--sftp-extra-args=SFTP_EXTRA_ARGS` | 指定仅传递给 sftp 的额外参数 (e.g. -f, -l)
|
||||
`--sftp-extra-args=SFTP_EXTRA_ARGS` | 指定仅传递给 `sftp` 的额外参数 (e.g. -f, -l)
|
||||
`--scp-extra-args=SCP_EXTRA_ARGS` | 指定仅传递给 `scp` 的额外参数 (e.g. -l)
|
||||
`--ssh-extra-args=SSH_EXTRA_ARGS` | 指定仅传递给 `ssh` 的额外参数 (e.g. -R)
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
控制您成为目标主机上的用户的方式和用户,特权升级选项:
|
||||
|
||||
:- | -
|
||||
:- | -
|
||||
`-s`, `--sudo` | 使用 sudo (nopasswd) 运行操作(已弃用,使用 become)
|
||||
`-U SUDO_USER`, `--sudo-user=SUDO_USER` | 所需的 sudo 用户(默认=root)(已弃用,使用 become)
|
||||
`-S`, `--su` | 使用 su 运行操作(已弃用,使用 become)
|
||||
`-R SU_USER`, `--su-user=SU_USER` | 以该用户身份使用 su 运行操作(默认 = root)(已弃用,使用 become)
|
||||
~~`-s`~~, ~~`--sudo`~~ | 使用 sudo (nopasswd) 运行操作(已弃用,使用 become)
|
||||
~~`-U SUDO_USER`~~, ~~`--sudo-user=SUDO_USER`~~ | 所需的 sudo 用户(默认=root)(已弃用,使用 become)
|
||||
~~`-S`~~, ~~`--su`~~ | 使用 su 运行操作(已弃用,使用 become)
|
||||
~~`-R SU_USER`~~, ~~`--su-user=SU_USER`~~ | 以该用户身份使用 su 运行操作(默认 = root)(已弃用,使用 become)
|
||||
`-b`, `--become` | 使用 become 运行操作(不暗示密码提示)
|
||||
`--become-method=BECOME_METHOD` | 要使用的权限提升方法(默认=sudo),有效选择:[ sudo | su | pbrun | pfexec | runas | doas | dzdo ]
|
||||
`--become-method=BECOME_METHOD` | 要使用的权限提升方法(默认=sudo),有效选择:\[ `sudo` \| `su` \| `pbrun` \| `pfexec` \| `runas` \| `doas` \| `dzdo` \]
|
||||
`--become-user=BECOME_USER` | 以该用户身份运行操作(默认=root)
|
||||
`--ask-sudo-pass` | 询问 sudo 密码(已弃用,使用 become)
|
||||
`--ask-su-pass` | 询问 su 密码(已弃用,使用 become)
|
||||
~~`--ask-sudo-pass`~~ | 询问 sudo 密码(已弃用,使用 become)
|
||||
~~`--ask-su-pass`~~ | 询问 su 密码(已弃用,使用 become)
|
||||
`-K`, `--ask-become-pass` | 要求提权密码
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### Ansible Galaxy 工具
|
||||
|
||||
@@ -409,6 +412,38 @@ $ ansible-pull -U <repository> [options]
|
||||
<!-- ### ansible-playbook -->
|
||||
<!-- todo -->
|
||||
|
||||
### ansible常用模块
|
||||
<!--rehype:wrap-class=col-span-3 -->
|
||||
|
||||
`Ansible` 的模块已经高达 `3000+` 之多。但是个人在日常工作中,比较常见的大约 `20` 多个
|
||||
|
||||
```bash
|
||||
$ ansible-doc --list #查询所有模块
|
||||
$ ansible <host-pattern> [options] # 标准使用方式
|
||||
```
|
||||
|
||||
---
|
||||
| :- | - | - |
|
||||
| ---------------- | ------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| ping | 检查指定节点机器是否还能连通 | `ansible all -m ping` |
|
||||
| command | 用于在各受控端节点运行指定的命令 | `ansible all -m command -a 'hostname'` |
|
||||
| shell | shell模块可以特殊字符,而command是不支持 | `ansible all -m shell -a 'hostname && date'` |
|
||||
| hostname | 修改远程受控节点的主机名的模块 | `ansible -i /opt/hosts xx -m hostname -a 'name=ansible-client-199'` |
|
||||
| copy | 在远程主机执行复制操作文件 | `ansible all -m copy -a 'src=/etc/hosts dest=/opt/hosts backup=yes'` |
|
||||
| fetch | 从远程主机获取文件到管理节点,但是不支持目录操作 | `ansible all -m fetch -a "src=/etc/yum.repos.d/epel.repo dest=/usr/local/src"` |
|
||||
| script | 管理端一个脚本,然后在远程服务器上执行 | `ansible all -m script -a '/root/time.sh'` |
|
||||
| file | 主要用于远程主机上的文件和目录操作 | `ansible all -m file -a "path=/root/rsync.password mode=600 state=touch"` |
|
||||
| cron | 管理执行任务计划模块(增删改查) | `ansible all -m cron -a "name='test a job' user=root job='/bin/sh /server/scripts/test.sh' minute=* hour=* day=* month=* weekday=*"` |
|
||||
| yum | RedHat和CentOS的软件包安装和管理 | 安装<br />`ansible all -m yum -a "name=httpd state=present"`<br/>`ansible all -m yum -a "name=httpd state=installed"`<br />卸载<br />`ansible all -m yum -a "name=httpd state=absent"`<br/>`ansible all -m yum -a "name=httpd state=removed"` |
|
||||
| `service`和`systemd` | 用于管理远程主机的服务 | `ansible all -m systemd -a "name=httpd state=started enabled=yes"`<br />`ansible all -m systemd -a "name=httpd state=restarted"` |
|
||||
| user | useradd, userdel, usermod | `ansible all -m user -a 'name=haha remove=no state=absent'` |
|
||||
| group | groupadd, groupdel, groupmod | `ansible all -m group -a 'name=mygroup state=absent'` |
|
||||
| setup | 可收集远程主机的facts变量的信息 | `ansible all -m setup -a 'filter=ansible_default_ipv4'` |
|
||||
| authorized_key | 为特定的用户账号添加或删除 SSH authorized keys | `ansible all -m authorized_key -a "user=root key='{{lookup('file','/root/.ssh/id_rsa.pub')}}' path=/root/.ssh/authorized_keys manage_dir=no"` |
|
||||
| replace | 和 sed 命令比较类似,用于正则匹配和替换 | `ansible all -m replace -a "path=/etc/fstab regexp=^(UUID.*) replace='#\1'"` |
|
||||
| lineinfile | 正则匹配,更改某个关键参数值 | `ansible all -m lineinfile -a "path=/etc/selinux/config regexp='^SELINUX=' line='SELINUX=disabled'"` |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
||||
164
docs/bash.md
@@ -61,6 +61,7 @@ bash 注释
|
||||
`$@` | 所有参数,从第一个开始
|
||||
`$-` | 当前选项
|
||||
`$_` | 上一个命令的最后一个参数
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
见:[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)
|
||||
|
||||
@@ -152,6 +153,7 @@ Bash 参数扩展
|
||||
`${FOO:=val}` | 如果未设置,则将 `$FOO` 设置为 `val`
|
||||
`${FOO:+val}` | `val` 如果设置了`$FOO`
|
||||
`${FOO:?message}` | 如果 `$FOO` 未设置,则显示消息并退出
|
||||
<!--rehype:className=code-nowrap left-align-->
|
||||
|
||||
### 替代 Substitution
|
||||
|
||||
@@ -195,15 +197,21 @@ echo ${name:0:length} # => Jo
|
||||
SRC="/path/to/foo.cpp"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```bash
|
||||
BASEPATH=${SRC##*/}
|
||||
echo $BASEPATH # => "foo.cpp"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```bash
|
||||
DIRPATH=${SRC%$BASEPATH}
|
||||
echo $DIRPATH # => "/path/to/"
|
||||
```
|
||||
|
||||
### Transform
|
||||
### 转换
|
||||
|
||||
```bash
|
||||
STR="HELLO WORLD!"
|
||||
@@ -265,7 +273,7 @@ for e in "${Fruits[@]}"; do
|
||||
done
|
||||
```
|
||||
|
||||
#### With index
|
||||
#### 有索引
|
||||
|
||||
```bash
|
||||
for i in "${!Fruits[@]}"; do
|
||||
@@ -348,12 +356,12 @@ Bash 条件句
|
||||
|
||||
条件 | 描述
|
||||
:- | -
|
||||
`[[ NUM -eq NUM ]]` | 等于 <yel>Eq</yel>ual |
|
||||
`[[ NUM -ne NUM ]]` | 不等于 <yel>N</yel>ot <yel>e</yel>qual |
|
||||
`[[ NUM -lt NUM ]]` | 小于 <yel>L</yel>ess <yel>t</yel>han |
|
||||
`[[ NUM -le NUM ]]` | 小于等于 <yel>L</yel>ess than or <yel>e</yel>qual |
|
||||
`[[ NUM -gt NUM ]]` | 大于 <yel>G</yel>reater <yel>t</yel>han |
|
||||
`[[ NUM -ge NUM ]]` | 大于等于 <yel>G</yel>reater than or <yel>e</yel>qual |
|
||||
`[[ NUM -eq NUM ]]` | 等于 <yel>Eq</yel>ual
|
||||
`[[ NUM -ne NUM ]]` | 不等于 <yel>N</yel>ot <yel>e</yel>qual
|
||||
`[[ NUM -lt NUM ]]` | 小于 <yel>L</yel>ess <yel>t</yel>han
|
||||
`[[ NUM -le NUM ]]` | 小于等于 <yel>L</yel>ess than or <yel>e</yel>qual
|
||||
`[[ NUM -gt NUM ]]` | 大于 <yel>G</yel>reater <yel>t</yel>han
|
||||
`[[ NUM -ge NUM ]]` | 大于等于 <yel>G</yel>reater than or <yel>e</yel>qual
|
||||
`(( NUM < NUM ))` | 小于
|
||||
`(( NUM <= NUM ))` | 小于或等于
|
||||
`(( NUM > NUM ))` | 比...更大
|
||||
@@ -448,10 +456,10 @@ fi
|
||||
|
||||
条件 | 描述
|
||||
:- | -
|
||||
`[[ -o noclobber ]]` | 如果启用 OPTION
|
||||
`[[ ! EXPR ]]` | 不是 Not
|
||||
`[[ X && Y ]]` | 和 And
|
||||
`[[ X \|\| Y ]]` | 或者 Or
|
||||
`[[ -o noclobber ]]` | 如果启用 <pur>OPTION</pur>
|
||||
`[[ ! EXPR ]]` | 不是 <pur>Not</pur>
|
||||
`[[ X && Y ]]` | 和 <pur>And</pur>
|
||||
`[[ X \|\| Y ]]` | 或者 <pur>Or</pur>
|
||||
|
||||
### 逻辑和,或
|
||||
|
||||
@@ -536,10 +544,10 @@ done
|
||||
```bash
|
||||
for number in $(seq 1 3); do
|
||||
if [[ $number == 2 ]]; then
|
||||
# Skip entire rest of loop.
|
||||
# 跳过整个循环的其余部分。
|
||||
break;
|
||||
fi
|
||||
# This will only print 1
|
||||
# 这只会打印 1
|
||||
echo "$number"
|
||||
done
|
||||
```
|
||||
@@ -558,7 +566,7 @@ done
|
||||
|
||||
```bash
|
||||
while true; do
|
||||
# here is some code.
|
||||
# 下面是一些代码
|
||||
done
|
||||
```
|
||||
|
||||
@@ -566,7 +574,7 @@ done
|
||||
|
||||
```bash
|
||||
while :; do
|
||||
# here is some code.
|
||||
# 下面是一些代码
|
||||
done
|
||||
```
|
||||
|
||||
@@ -589,8 +597,9 @@ myfunc() {
|
||||
}
|
||||
```
|
||||
|
||||
同上(替代语法)
|
||||
|
||||
```bash
|
||||
# 同上(替代语法)
|
||||
function myfunc() {
|
||||
echo "hello $1"
|
||||
}
|
||||
@@ -635,42 +644,61 @@ Bash 选项
|
||||
|
||||
### 选项
|
||||
|
||||
避免覆盖文件
|
||||
|
||||
```bash
|
||||
# 避免覆盖文件
|
||||
# (echo "hi" > foo)
|
||||
set -o noclobber
|
||||
```
|
||||
|
||||
# 用于出错时退出
|
||||
# 避免级联错误
|
||||
用于出错时退出,避免级联错误
|
||||
|
||||
```bash
|
||||
set -o errexit
|
||||
```
|
||||
|
||||
# 揭示隐藏的失败
|
||||
揭示隐藏的失败
|
||||
|
||||
```bash
|
||||
set -o pipefail
|
||||
```
|
||||
|
||||
# 公开未设置的变量
|
||||
公开未设置的变量
|
||||
|
||||
```bash
|
||||
set -o nounset
|
||||
```
|
||||
|
||||
### 全局选项
|
||||
|
||||
不匹配的 glob 被删除
|
||||
|
||||
```bash
|
||||
# 不匹配的 glob 被删除
|
||||
# ('*.foo' => '')
|
||||
shopt -s nullglob
|
||||
shopt -s nullglob # ('*.foo' => '')
|
||||
```
|
||||
|
||||
# 不匹配的 glob 抛出错误
|
||||
不匹配的 glob 抛出错误
|
||||
|
||||
```bash
|
||||
shopt -s failglob
|
||||
```
|
||||
|
||||
# 不区分大小写的球体
|
||||
不区分大小写的球体
|
||||
|
||||
```bash
|
||||
shopt -s nocaseglob
|
||||
```
|
||||
|
||||
# 通配符匹配点文件
|
||||
# ("*.sh" => ".foo.sh")
|
||||
shopt -s dotglob
|
||||
通配符匹配点文件
|
||||
|
||||
# 允许 ** 进行递归匹配
|
||||
# ('lib/**/*.rb' => 'lib/a/b/c.rb')
|
||||
shopt -s globstar
|
||||
```bash
|
||||
shopt -s dotglob # ("*.sh" => ".foo.sh")
|
||||
```
|
||||
|
||||
允许 ** 进行递归匹配
|
||||
|
||||
```bash
|
||||
shopt -s globstar # ('lib/**/*.rb' => 'lib/a/b/c.rb')
|
||||
```
|
||||
|
||||
Bash 历史
|
||||
@@ -682,8 +710,9 @@ Bash 历史
|
||||
命令 | 描述
|
||||
:- | -
|
||||
`history` | 显示历史
|
||||
`sudo !!` | 使用 sudo 运行上一个命令
|
||||
`sudo !!` | 使用 `sudo` 运行上一个命令
|
||||
`shopt -s histverify` | 不要立即执行扩展结果
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### 表达式
|
||||
|
||||
@@ -694,6 +723,7 @@ Bash 历史
|
||||
`!-n` | 展开第 `n` 个最近的命令
|
||||
`!n` | 展开历史中的第 `n` 个命令
|
||||
`!<command>` | 展开最近调用的命令 `<command>`
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### 操作
|
||||
|
||||
@@ -704,6 +734,7 @@ Bash 历史
|
||||
`!!:gs/<FROM>/<TO>/` | 在最近的命令中将所有出现的 `<FROM>` 替换为 `<TO>`
|
||||
`!$:t` | 仅从最近命令的最后一个参数扩展基本名称
|
||||
`!$:h` | 仅从最近命令的最后一个参数展开目录
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
`!!` 和 `!$` 可以替换为任何有效的扩展。
|
||||
|
||||
@@ -716,34 +747,35 @@ Bash 历史
|
||||
`!$` | 从最近的命令中展开最后一个标记
|
||||
`!!:n-m` | 从最近的命令扩展令牌范围
|
||||
`!!:n-$` | 从最近的命令中将第 `n` 个标记展开到最后
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
`!!` 可以替换为任何有效的扩展,即 `!cat`、`!-2`、`!42` 等。
|
||||
|
||||
杂项
|
||||
-------------
|
||||
---
|
||||
|
||||
### 数值计算
|
||||
|
||||
```bash
|
||||
$((a + 200)) # Add 200 to $a
|
||||
$((a + 200)) # $a 加 200
|
||||
```
|
||||
|
||||
```bash
|
||||
$(($RANDOM%200)) # Random number 0..199
|
||||
$(($RANDOM%200)) # 随机数 0..199
|
||||
```
|
||||
|
||||
### 子 shell
|
||||
|
||||
```bash
|
||||
(cd somedir; echo "I'm now in $PWD")
|
||||
pwd # still in first directory
|
||||
pwd # 仍然在第一个目录
|
||||
```
|
||||
|
||||
### 检查命令
|
||||
|
||||
```bash
|
||||
command -V cd
|
||||
#=> "cd is a function/alias/whatever"
|
||||
#=> "cd 是一个函数/别名/其他"
|
||||
```
|
||||
|
||||
### 重定向
|
||||
@@ -964,11 +996,11 @@ END
|
||||
### 转到上一个目录
|
||||
|
||||
```bash
|
||||
pwd # /home/user/foo
|
||||
pwd # /home/user/foo
|
||||
cd bar/
|
||||
pwd # /home/user/foo/bar
|
||||
pwd # /home/user/foo/bar
|
||||
cd -
|
||||
pwd # /home/user/foo
|
||||
pwd # /home/user/foo
|
||||
```
|
||||
|
||||
### 读取输入
|
||||
@@ -1020,7 +1052,7 @@ echo "${args[@]}"
|
||||
$ bash -x myscript.sh
|
||||
```
|
||||
|
||||
在bash脚本中打开调试(针对部分内容打印调试信息)。
|
||||
在 bash 脚本中打开调试(针对部分内容打印调试信息)
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
@@ -1037,10 +1069,6 @@ Bash 颜色
|
||||
|
||||
您可以通过为其输出着色来使您的 BASH 脚本更漂亮,使用以下模板编写彩色文本:
|
||||
|
||||
```bash
|
||||
echo -e "\e[COLORm文字变色了\e[0m"
|
||||
```
|
||||
|
||||
#### 示例
|
||||
|
||||
```bash
|
||||
@@ -1098,35 +1126,36 @@ m # 设置图形模式
|
||||
`5` | 缓慢闪烁
|
||||
`6` | 快速闪烁
|
||||
`7` | 反显
|
||||
`8` | 隐藏 | 未广泛支持。
|
||||
`8` | 隐藏 | 未广泛支持
|
||||
`9` | 划除
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### ANSI — 颜色转义码
|
||||
|
||||
颜色 | 前景色 | 背景色 | 示例
|
||||
:- | -- | -- | --
|
||||
`Black` 黑色 | 30 | 40 | ``<!--rehype:style=background:#000;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Red` 红色 | 31 | 41 | ``<!--rehype:style=background:#c23621;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Green` 绿色 | 32 | 42 | ``<!--rehype:style=background:#25bc26;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Yellow` 黄色 | 33 | 43 | ``<!--rehype:style=background:#cdcd00;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Blue` 蓝色 | 34 | 44 | ``<!--rehype:style=background:#0000ee;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Purple` 紫色 | 35 | 45 | ``<!--rehype:style=background:#cd00cd;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Cyan` 青色 | 36 | 46 | ``<!--rehype:style=background:#00AAAA;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`White` 白色 | 37 | 47 | ``<!--rehype:style=background:#e5e5e5;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
颜色 | 名称 | 前景色 | 背景色 | 示例
|
||||
:- | --| -- | -- | --
|
||||
`Black` | 黑色 | 30 | 40 | `黑`<!--rehype:style=background:#000;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Red` | 红色 | 31 | 41 | `红`<!--rehype:style=background:#c23621;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Green` | 绿色 | 32 | 42 | `绿`<!--rehype:style=background:#25bc26;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Yellow` | 黄色 | 33 | 43 | `黄`<!--rehype:style=background:#cdcd00;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Blue` | 蓝色 | 34 | 44 | `蓝`<!--rehype:style=background:#0000ee;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Purple` | 紫色 | 35 | 45 | `紫`<!--rehype:style=background:#cd00cd;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Cyan` | 青色 | 36 | 46 | `青`<!--rehype:style=background:#00AAAA;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`White` | 白色 | 37 | 47 | `白`<!--rehype:style=background:#e5e5e5;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### ANSI — 颜色转义码(亮色)
|
||||
|
||||
颜色 | 前景色 | 背景色 | 示例
|
||||
颜色 | 前色 | 背色 | 示例
|
||||
:- | -- | -- | --
|
||||
`Bright Black(Gray)` 灰色 | 90 | 100 | ``<!--rehype:style=background:#555555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Red` 亮红色 | 91 | 101 | ``<!--rehype:style=background:#FF5555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Green` 亮绿色 | 92 | 102 | ``<!--rehype:style=background:#55FF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Yellow` 亮黄色 | 93 | 103 | ``<!--rehype:style=background:#FFFF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Blue` 亮蓝色 | 94 | 104 | ``<!--rehype:style=background:#5555FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Magenta` 亮紫色 | 95 | 105 | ``<!--rehype:style=background:#FF55FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Cyan` 亮青色 | 96 | 106 | ``<!--rehype:style=background:#55FFFF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright White` 浅灰 | 97 | 107 | ``<!--rehype:style=background:#ffffff;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`BrightBlack(Gray)` 灰色 | 90 | 100 | `90`<!--rehype:style=background:#555555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Red` 亮红色 | 91 | 101 | `91`<!--rehype:style=background:#FF5555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Green` 亮绿色 | 92 | 102 | `92`<!--rehype:style=background:#55FF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Yellow` 亮黄色 | 93 | 103 | `93`<!--rehype:style=background:#FFFF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Blue` 亮蓝色 | 94 | 104 | `94`<!--rehype:style=background:#5555FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Magenta` 亮紫色 | 95 | 105 | `95`<!--rehype:style=background:#FF55FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Cyan` 亮青色 | 96 | 106 | `96`<!--rehype:style=background:#55FFFF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright White` 浅灰 | 97 | 107 | `97`<!--rehype:style=background:#ffffff;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### 可用功能
|
||||
@@ -1153,6 +1182,7 @@ m # 设置图形模式
|
||||
`6n` | DSR – 设备状态报告 | 以 `ESC[n;mR` (就像在键盘上输入)向应用程序报告光标位置(CPR),其中 `n`是行, `m` 是列
|
||||
`s` | SCP – 保存光标位置 | 保存光标的当前位置
|
||||
`u` | RCP – 恢复光标位置 | 恢复保存的光标位置
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
18
docs/c.md
@@ -38,7 +38,10 @@ $ ./hello
|
||||
int myNum = 15;
|
||||
|
||||
int myNum2; // 声明变量 myNum2
|
||||
myNum2 = 15; // 变量声明后第一次赋值我们称为初始化,如果 初始化 和 赋值 在同一行,那么我们可以直接称为 定义变量 myNum2
|
||||
// 变量声明后第一次赋值我们称为初始化
|
||||
// 如果 初始化 和 赋值 在同一行
|
||||
// 那么我们可以直接称为 定义变量 myNum2
|
||||
myNum2 = 15;
|
||||
|
||||
int myNum3 = 15; // myNum3 值为 15
|
||||
myNum3 = 10; // 现在 myNum3 值为 10
|
||||
@@ -749,7 +752,8 @@ Carole 和 Debra: 我们爱你!
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
#define tokenpaster(n) printf ("token" #n " = %d", token##n)
|
||||
#define tokenpaster(n) \
|
||||
printf ("token" #n " = %d", token##n)
|
||||
|
||||
int main(void){
|
||||
int token34 = 40;
|
||||
@@ -768,8 +772,9 @@ int main(void){
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
printf("Here is the message: %s\n", MESSAGE);
|
||||
return 0;
|
||||
printf("信息如下: %s\n", \
|
||||
MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -794,8 +799,9 @@ int square(int x) {
|
||||
#define MAX(x,y) ((x) > (y) ? (x) : (y))
|
||||
|
||||
int main(void) {
|
||||
printf("Max between 20 and 10 is %d\n", MAX(10, 20));
|
||||
return 0;
|
||||
printf("20 到 10 之间的最大值是 %d\n", \
|
||||
MAX(10, 20));
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
149
docs/chown.md
Normal file
@@ -0,0 +1,149 @@
|
||||
Chown 备忘清单
|
||||
===
|
||||
|
||||
这份快速参考备忘单提供了改变文件或目录的所有者的简要概述,以及 chown 命令的操作
|
||||
|
||||
入门
|
||||
--------
|
||||
|
||||
### 介绍
|
||||
|
||||
Linux/Unix 系统中的一个命令,全称为 `change owner`,用于改变文件或目录的所有者
|
||||
|
||||
```shell
|
||||
chown [选项] [所有者][:[组]] 文件或目录名
|
||||
```
|
||||
|
||||
命令可以更改某个文件或目录的属主(owner),也可以同时更改其属组(group)
|
||||
|
||||
#### 示例
|
||||
|
||||
```shell
|
||||
$ chown :groupname file1.txt
|
||||
$ chown -R username:groupname *
|
||||
$ chown $USER file.txt
|
||||
```
|
||||
|
||||
`注意` 只有超级用户(root)才有权限改变文件或目录的所有者
|
||||
|
||||
### 选项
|
||||
|
||||
- `-c` : 显示更改的部分的信息
|
||||
- `-f` : 忽略错误信息
|
||||
- `-h` :修复符号链接
|
||||
- `-v` : 显示详细的处理信息
|
||||
- `-R` : 处理指定目录以及其子目录下的所有文件
|
||||
- `--help` : 显示辅助说明
|
||||
- `--version` : 显示版本
|
||||
|
||||
示例
|
||||
--------
|
||||
|
||||
### 更改文件所有者
|
||||
|
||||
```shell
|
||||
$ chown root /var/run/httpd.pid
|
||||
```
|
||||
|
||||
把 `/var/run/httpd.pid` 的所有者设为 `root`
|
||||
|
||||
#### 仅更改所有者
|
||||
|
||||
```bash
|
||||
$ chown new_owner file.txt
|
||||
```
|
||||
|
||||
### 递归更改目录及其内容的所有者
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```shell
|
||||
chown -R new_owner:new_group directory/
|
||||
```
|
||||
|
||||
将文件夹 `directory` 的拥有者设为 `new_owner` ,群体的使用者设为 `new_group`
|
||||
|
||||
```shell
|
||||
$ chown username:groupname file1.txt
|
||||
```
|
||||
|
||||
将文件 file1.txt 的拥有者设为 `username` ,群体的使用者设为 `groupname`
|
||||
|
||||
```shell
|
||||
$ chown -R username:groupname *
|
||||
```
|
||||
|
||||
将当前目录以及子目录的所有文件的拥有者设为 `username` ,群体的使用者设为 `groupname`
|
||||
|
||||
### 更改所有者为当前用户
|
||||
|
||||
```bash
|
||||
$ chown $USER file.txt
|
||||
```
|
||||
|
||||
递归更改目录及其内容的所有者为当前用户
|
||||
|
||||
```bash
|
||||
sudo chown -R $USER directory/
|
||||
```
|
||||
|
||||
### 递归并且不显示错误信息
|
||||
|
||||
```bash
|
||||
chown -R -f new_owner:new_group directory/
|
||||
```
|
||||
|
||||
更改目录及其内容的所有者和组为 `alice`
|
||||
|
||||
```bash
|
||||
chown -R alice: directory/
|
||||
```
|
||||
|
||||
### 仅更改组
|
||||
|
||||
```shell
|
||||
$ chown :groupname file1.txt
|
||||
```
|
||||
|
||||
不修改文件 `file1.txt` 的拥有者,将文件使用群体改为 `groupname`
|
||||
|
||||
### 变更符号链接的所有者
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
$ chown -h new_owner:new_group symlink
|
||||
```
|
||||
|
||||
变更符号链接的所有者而不是链接指向的文件
|
||||
|
||||
```bash
|
||||
$ chown -h manager symlink
|
||||
```
|
||||
|
||||
更改符号链接的所有者为"manager"
|
||||
|
||||
### 更改所有者为根用户
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
sudo chown root:root file.txt
|
||||
```
|
||||
|
||||
#### 递归更改所有者为当前用户
|
||||
|
||||
```bash
|
||||
sudo chown -R $USER directory/
|
||||
# 更改目录及其内容的所有者和组为"alice":
|
||||
chown -R alice: directory/
|
||||
```
|
||||
|
||||
### 将文件所有者更改为其他用户,但保留组
|
||||
|
||||
```bash
|
||||
chown new_owner file.txt
|
||||
```
|
||||
|
||||
### 将文件所有者更改为其他用户,同时更改组
|
||||
|
||||
```bash
|
||||
chown new_owner:new_group file.txt
|
||||
```
|
||||
177
docs/cpp.md
@@ -73,6 +73,11 @@ int a = 5, b = 10;
|
||||
std::swap(a, b);
|
||||
// 输出: a=10, b=5
|
||||
std::cout << "a=" << a << ", b=" << b;
|
||||
|
||||
// 整数交换的奇技淫巧
|
||||
(x ^= y), (y ^= x), (x ^= y);
|
||||
// 注意! 以下操作会造成 undefined behavior
|
||||
x ^= y ^= x ^= y;
|
||||
```
|
||||
|
||||
### 注释
|
||||
@@ -108,13 +113,13 @@ for (int i = 0; i < 10; i++) {
|
||||
|
||||
```cpp
|
||||
#include <iostream>
|
||||
|
||||
|
||||
void hello(); // 声明
|
||||
|
||||
|
||||
int main() { // 主函数
|
||||
hello(); // 执行函数
|
||||
}
|
||||
|
||||
|
||||
void hello() { // 定义
|
||||
std::cout << "Hello Quick Reference!\n";
|
||||
}
|
||||
@@ -155,7 +160,7 @@ using namespace ns1;
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
cout << val();
|
||||
cout << val();
|
||||
}
|
||||
```
|
||||
|
||||
@@ -237,7 +242,7 @@ for (int i = 0; i < 2; ++i) {
|
||||
std::cout << x[i][j] << " ";
|
||||
}
|
||||
}
|
||||
// 输出: 1 2 3 4 5 6 6 5 4 3 2 1
|
||||
// 输出: 1 2 3 4 5 6 6 5 4 3 2 1
|
||||
```
|
||||
|
||||
C++ 条件
|
||||
@@ -475,7 +480,7 @@ for (char c: hello)
|
||||
{
|
||||
std::cout << c << " ";
|
||||
}
|
||||
// 输出: Q u i c k R e f . M E
|
||||
// 输出: Q u i c k R e f . M E
|
||||
```
|
||||
|
||||
### 中断语句
|
||||
@@ -502,6 +507,16 @@ for (int i = 0, j = 2; i < 3; i++, j--){
|
||||
// 输出: i=0,j=2;i=1,j=1;i=2,j=0;
|
||||
```
|
||||
|
||||
### auto
|
||||
|
||||
```cpp
|
||||
std:: string s = "hello world";
|
||||
for(auto c: s){
|
||||
std:: cout << c << " ";
|
||||
}
|
||||
// 输出: h e l l o w o r l d
|
||||
```
|
||||
|
||||
C++ 函数
|
||||
------------
|
||||
|
||||
@@ -510,10 +525,10 @@ C++ 函数
|
||||
```cpp
|
||||
#include <iostream>
|
||||
int add(int a, int b) {
|
||||
return a + b;
|
||||
return a + b;
|
||||
}
|
||||
int main() {
|
||||
std::cout << add(10, 20);
|
||||
std::cout << add(10, 20);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -538,7 +553,7 @@ void fun(int a) {
|
||||
```cpp
|
||||
#include <iostream>
|
||||
#include <cmath> // 导入库
|
||||
|
||||
|
||||
int main() {
|
||||
// sqrt() 来自 cmath
|
||||
std::cout << sqrt(9);
|
||||
@@ -599,16 +614,16 @@ auto func = []() -> return_type { };
|
||||
```cpp
|
||||
int val1 = 123, val2 = 456;
|
||||
string str1("123"), str2(456);
|
||||
|
||||
|
||||
auto func1 = [=, &str1]() -> int
|
||||
{
|
||||
return val1 == std::stoi(str1)
|
||||
return val1 == std::stoi(str1)
|
||||
? val1 : val2;
|
||||
};
|
||||
|
||||
|
||||
auto func2 = [&, val1]() -> int
|
||||
{
|
||||
return str1 == std::to_string(val1)
|
||||
return str1 == std::to_string(val1)
|
||||
? str1 : str2;
|
||||
};
|
||||
```
|
||||
@@ -622,11 +637,11 @@ auto func = []() -> return_type { };
|
||||
|
||||
```cpp
|
||||
// vec中包含1, 2, 3, 4, 5
|
||||
std::vector<int> vec({1, 2, 3, 4, 5});
|
||||
std::for_each(vec.begin(), vec.end(),
|
||||
std::vector<int> vec({1, 2, 3, 4, 5});
|
||||
std::for_each(vec.begin(), vec.end(),
|
||||
[](int& ele) -> void
|
||||
{
|
||||
std::cout << ele
|
||||
std::cout << ele
|
||||
<< " ";
|
||||
});
|
||||
```
|
||||
@@ -665,17 +680,17 @@ class Entry
|
||||
|
||||
Entry entry;
|
||||
// 调用operator()()
|
||||
std::thread my_thread_1(entry);
|
||||
std::thread my_thread_1(entry);
|
||||
// 调用Entry::entry_function
|
||||
std::thread my_thread_2(&Entry::entry_function, &entry);
|
||||
std::thread my_thread_2(&Entry::entry_function, &entry);
|
||||
```
|
||||
|
||||
以lambda表达式作为线程入口函数:
|
||||
|
||||
```cpp
|
||||
std::thread my_thread([]() -> void
|
||||
std::thread my_thread([]() -> void
|
||||
{
|
||||
// ...
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
@@ -693,17 +708,17 @@ my_thread.detach();
|
||||
|
||||
```cpp
|
||||
// 获取当前线程ID
|
||||
std::this_thread::get_id();
|
||||
std::this_thread::get_id();
|
||||
// 使当前线程休眠一段指定时间
|
||||
std::this_thread::sleep_for();
|
||||
std::this_thread::sleep_for();
|
||||
// 使当前线程休眠到指定时间
|
||||
std::this_thread::sleep_until();
|
||||
// 暂停当前线程的执行,让别的线程执行
|
||||
std::this_thread::yield();
|
||||
std::this_thread::yield();
|
||||
```
|
||||
|
||||
### 锁
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
> `#include <mutex>`
|
||||
|
||||
@@ -753,7 +768,7 @@ std::lock_guard<std::mutex> lock(m);
|
||||
```cpp
|
||||
// 手动上锁
|
||||
m.lock();
|
||||
std::lock_guard<mutex> lock(m,
|
||||
std::lock_guard<mutex> lock(m,
|
||||
std::adopt_lock);
|
||||
```
|
||||
|
||||
@@ -773,7 +788,7 @@ std::unique_lock<mutex> lock(m);
|
||||
```cpp
|
||||
// 手动上锁
|
||||
m.lock();
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::adopt_lock);
|
||||
```
|
||||
|
||||
@@ -782,7 +797,7 @@ std::unique_lock<mutex> lock(m,
|
||||
尝试上锁,可以通过`std::unique_lock<Mutex>::owns_lock()`查看状态
|
||||
|
||||
```cpp
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::try_to_lock);
|
||||
if (lock.owns_lock())
|
||||
{
|
||||
@@ -860,19 +875,19 @@ cond.wait(lock, predicate);
|
||||
唤醒所有调用 `wait` 的线程。
|
||||
|
||||
### 获取线程的运行结果
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
> `#include <future>`
|
||||
|
||||
#### 创建异步任务
|
||||
|
||||
```cpp
|
||||
double func(int val);
|
||||
double func(int val);
|
||||
|
||||
// 使用std::async创建异步任务
|
||||
// 使用std::future获取结果
|
||||
// future模板中存放返回值类型
|
||||
std::future<double> result =
|
||||
std::future<double> result =
|
||||
std::async(func, 5);
|
||||
```
|
||||
|
||||
@@ -910,7 +925,7 @@ int val = result.get();
|
||||
```cpp
|
||||
extern double foo(int val) {}
|
||||
|
||||
std::future<double> result =
|
||||
std::future<double> result =
|
||||
async(foo, 5);
|
||||
|
||||
//返回值类型
|
||||
@@ -930,10 +945,10 @@ status = result.wait_for(
|
||||
|
||||
```cpp
|
||||
// 返回值已经准备好
|
||||
if (status ==
|
||||
if (status ==
|
||||
std::future_status::ready)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
// 超时:尚未准备好
|
||||
else if (status ==
|
||||
@@ -947,14 +962,106 @@ else if (status ==
|
||||
|
||||
#### 多个返回值
|
||||
|
||||
如果要多次获取结果,可以使用`std::shared_future`,其会返回结果的一个**拷贝**。
|
||||
|
||||
```cpp
|
||||
std::shared_future<T> result;
|
||||
```
|
||||
|
||||
如果要多次获取结果,可以使用`std::shared_future`,其会返回结果的一个**拷贝**。
|
||||
|
||||
对于不可拷贝对象,可以在`std::shared_future`中存储对象的指针,而非指针本身。
|
||||
|
||||
### 创建线程
|
||||
|
||||
```cpp
|
||||
void threadFunction() {
|
||||
// 线程函数体
|
||||
std::cout << "From thread" << std::endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
// 创建线程并开始执行线程函数
|
||||
std::thread t(threadFunction);
|
||||
|
||||
// 等待线程执行完毕
|
||||
t.join();
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### 传递参数给线程函数
|
||||
|
||||
```cpp
|
||||
void threadFunction(int value) {
|
||||
// 线程函数体
|
||||
std::cout << "Received value: " << value << std::endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int data = 42;
|
||||
std::thread t(threadFunction, data);
|
||||
t.join();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### 使用Lambda表达式创建线程
|
||||
|
||||
```cpp
|
||||
int main() {
|
||||
int data = 42;
|
||||
std::thread t([data]() {
|
||||
// Lambda 表达式作为线程函数
|
||||
std::cout << "Received value: " << data << std::endl;
|
||||
});
|
||||
t.join();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### **处理线程间的同步:**
|
||||
|
||||
```cpp
|
||||
#include <mutex>
|
||||
|
||||
std::mutex mtx;
|
||||
|
||||
void threadFunction() {
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
std::cout << "Thread safe output." << std::endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::thread t1(threadFunction);
|
||||
std::thread t2(threadFunction);
|
||||
t1.join();
|
||||
t2.join();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### **使用`std::async`启动异步任务:**
|
||||
|
||||
```cpp
|
||||
#include <future>
|
||||
|
||||
int taskFunction() {
|
||||
// 异步任务
|
||||
return 42;
|
||||
}
|
||||
|
||||
int main() {
|
||||
// 启动异步任务
|
||||
std::future<int> fut = std::async(std::launch::async, taskFunction);
|
||||
|
||||
// 获取异步任务的结果
|
||||
int result = fut.get();
|
||||
|
||||
std::cout << "Result: " << result << std::endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
C++ 预处理器
|
||||
------------
|
||||
|
||||
|
||||
1212
docs/cs.md
74
docs/dart.md
@@ -320,7 +320,7 @@ int sum = add(2,3); // 回报:5
|
||||
int totalSum = add(2, add(2,3)); // 返回:7
|
||||
```
|
||||
|
||||
### 箭头语法 (=>)
|
||||
### 箭头函数 (=>)
|
||||
|
||||
```dart
|
||||
// 只包含一个表达式的函数,您可以使用简写语法
|
||||
@@ -346,6 +346,63 @@ list.forEach(
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 扩展函数 (Extension)
|
||||
|
||||
```dart
|
||||
//extension 定义扩展名称 on 扩展类
|
||||
extension StringExtension on String {
|
||||
//扩展方法
|
||||
String capitalize() {
|
||||
if (isEmpty) {
|
||||
return this;
|
||||
}
|
||||
// 将字符串的首字母大写
|
||||
String topStr = this[0].toUpperCase();
|
||||
|
||||
return '${topStr}${substring(1)}';
|
||||
}
|
||||
}
|
||||
|
||||
void main(List<String> args) {
|
||||
print("apple".capitalize());
|
||||
// Print: Apple
|
||||
print("苹果apple".capitalize());
|
||||
// Print: 苹果apple
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
在不修改 String 类的前提下为其新增了 capitalize 方法
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 运算符重载 (Extension)
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
```dart
|
||||
class Money {
|
||||
final num amount;
|
||||
Money({required this.amount});
|
||||
}
|
||||
|
||||
// 利用扩展函数特性
|
||||
extension MoneyOperatorExtension<T> on Money {
|
||||
// operator 重载运算符
|
||||
Money operator +(Money elements) {
|
||||
Money newMoney = Money(amount: this.amount + elements.amount);
|
||||
return newMoney;
|
||||
}
|
||||
}
|
||||
|
||||
void main(List<String> args) {
|
||||
// 怎么样?两个类加起来了
|
||||
Money appleMoney = Money(amount: 10.0);
|
||||
Money cardMoney = Money(amount: 6.0);
|
||||
Money allMoney = cardMoney + appleMoney;
|
||||
print(allMoney.amount);
|
||||
//Print: 16.0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
类和对象
|
||||
----------
|
||||
|
||||
@@ -747,6 +804,21 @@ var list2 = [0, ...list];
|
||||
print(list2.length); // 打印: 4
|
||||
```
|
||||
|
||||
### 延迟初始化
|
||||
|
||||
```dart
|
||||
// token 类型非空,但是不用立即赋值
|
||||
late String token;
|
||||
|
||||
void main(List<String> args) {
|
||||
/// print(token);
|
||||
/// Field 'token' has not been initialized
|
||||
/// 在初始化前调用就会报错
|
||||
token = "tokenContent";
|
||||
print(token);
|
||||
}
|
||||
```
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
|
||||
792
docs/docker.md
@@ -9,6 +9,13 @@ Docker 备忘清单
|
||||
|
||||
### 入门
|
||||
|
||||
#### 安装
|
||||
|
||||
```shell
|
||||
curl -sSL https://get.docker.com/ | sh
|
||||
sudo chmod 777 /var/run/docker.sock
|
||||
```
|
||||
|
||||
在后台创建和运行容器
|
||||
|
||||
```shell
|
||||
@@ -169,49 +176,16 @@ Docker 网络
|
||||
----
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 操作
|
||||
|
||||
删除网络
|
||||
|
||||
```shell
|
||||
docker network rm MyOverlayNetwork
|
||||
```
|
||||
|
||||
列出网络
|
||||
|
||||
```shell
|
||||
docker network ls
|
||||
```
|
||||
|
||||
获取有关网络的信息
|
||||
|
||||
```shell
|
||||
docker network inspect MyOverlayNetwork
|
||||
```
|
||||
|
||||
将正在运行的容器连接到网络
|
||||
|
||||
```shell
|
||||
docker network connect MyOverlayNetwork nginx
|
||||
```
|
||||
|
||||
启动时将容器连接到网络
|
||||
|
||||
```shell
|
||||
docker run -it -d --network=MyOverlayNetwork nginx
|
||||
```
|
||||
|
||||
断开容器与网络的连接
|
||||
|
||||
```shell
|
||||
docker network disconnect MyOverlayNetwork nginx
|
||||
```
|
||||
|
||||
### 创建网络
|
||||
|
||||
```shell
|
||||
docker network create -d overlay MyOverlayNetwork
|
||||
docker network create -d bridge MyBridgeNetwork
|
||||
```
|
||||
|
||||
自定义网络子网和网关
|
||||
|
||||
```shell
|
||||
docker network create -d overlay \
|
||||
--subnet=192.168.0.0/16 \
|
||||
--subnet=192.170.0.0/16 \
|
||||
@@ -225,19 +199,82 @@ docker network create -d overlay \
|
||||
MyOverlayNetwork
|
||||
```
|
||||
|
||||
### 操作
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
获取容器连接的网络
|
||||
|
||||
```shell
|
||||
docker inspect MyContainer | grep Network
|
||||
```
|
||||
|
||||
获取有关网络的信息
|
||||
|
||||
```shell
|
||||
docker network inspect <network_name>
|
||||
```
|
||||
|
||||
将正在运行的容器连接到网络
|
||||
|
||||
```shell
|
||||
docker network connect <network_name> <container_name>
|
||||
```
|
||||
|
||||
启动时将容器连接到网络
|
||||
|
||||
```shell
|
||||
docker run -it -d --network=<network_name> <container_name>
|
||||
```
|
||||
|
||||
断开容器与网络的连接
|
||||
|
||||
```shell
|
||||
docker network disconnect <network_name> <container_name>
|
||||
```
|
||||
|
||||
### 删除网络
|
||||
|
||||
```bash
|
||||
docker network rm <network_name>
|
||||
```
|
||||
|
||||
### 列出网络
|
||||
|
||||
```shell
|
||||
docker network ls
|
||||
```
|
||||
|
||||
Docker 快捷键
|
||||
----
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 退出
|
||||
需要特别注意的是,退出快捷键中的删除容器实例,只对于使用 `docker attach` 进入的容器生效,使用 `docker exec` 进入容器后,使用上面的快捷键后将隔离容器,且不会删除容器实例。
|
||||
|
||||
### 退出 - 关闭容器
|
||||
|
||||
| Docker 快捷键 | 说明 |
|
||||
|------------|------|
|
||||
`ctrl+c` | 将关闭容器,并删除当前的容器实例
|
||||
`ctrl+d` | 将保留容器,并退出到Docker主机的命令行界面
|
||||
`ctrl+p+q` | 将容器分离,保留容器,但是不退出
|
||||
`ctrl` `c` | 将关闭容器
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
需要特别注意的是,上面的退出快捷键中的删除容器实例只对于使用`docker attach`进入的容器生效,使用`docker exec`进入容器后使用上面的快捷键后将隔离容器且不会删除容器实例。
|
||||
将关闭容器, 并删除当前的容器实例
|
||||
|
||||
### 退出 - 保留容器
|
||||
|
||||
| Docker 快捷键 | 说明 |
|
||||
|------------|------|
|
||||
`ctrl` `d` | 保留容器
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
将保留容器,并退出到Docker主机的命令行界面
|
||||
|
||||
### 退出 - 容器分离
|
||||
|
||||
| Docker 快捷键 | 说明 |
|
||||
|------------|------|
|
||||
`ctrl` `p` `q` | 容器分离
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
将容器分离,保留容器,但是不退出
|
||||
|
||||
各种各样的
|
||||
----
|
||||
@@ -245,15 +282,15 @@ Docker 快捷键
|
||||
|
||||
### Docker Hub
|
||||
|
||||
| Docker 语法 | 说明 |
|
||||
|------------|------|
|
||||
`docker search search_word` | 在 docker hub 中搜索镜像
|
||||
`docker pull user/image` | 从 docker hub 下载镜像
|
||||
`docker login` | 向 docker hub 进行身份验证
|
||||
`docker push user/image` | 将镜像上传到 docker hub
|
||||
```bash
|
||||
$ docker search search_word # 在 docker hub 中搜索镜像
|
||||
$ docker pull user/image # 从 docker hub 下载镜像
|
||||
$ docker login # 向 docker hub 进行身份验证
|
||||
$ docker push user/image # 将镜像上传到 docker hub
|
||||
```
|
||||
|
||||
### 镜像仓库命令
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
登录到镜像仓库
|
||||
|
||||
@@ -297,23 +334,22 @@ $ docker push eon01/nginx localhost:5000/myadmin/nginx
|
||||
`docker stop -f $(docker ps -a -q)` | 停止所有容器
|
||||
`docker rm -f $(docker ps -a -q)` | 删除所有容器
|
||||
`docker rmi -f $(docker images -q)` | 删除所有镜像
|
||||
`docker volume prune` | 删除所有未使用的Docker Volume
|
||||
`docker network prune` | 删除所有未使用的Docker网络
|
||||
`docker system prune` | 清理所有空闲或与任何Docker容器无关的资源
|
||||
`docker image prune` | 删除悬空的Docker镜像
|
||||
`docker container prune` | 删除所有未使用的Docker 容器
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### 卷 volume
|
||||
|
||||
检查卷
|
||||
|
||||
```shell
|
||||
$ docker volume ls
|
||||
```
|
||||
|
||||
清理未使用的卷
|
||||
|
||||
```shell
|
||||
$ docker volume prune
|
||||
$ docker volume ls # 检查卷
|
||||
$ docker volume prune # 清理未使用的卷
|
||||
```
|
||||
|
||||
### Docker Compose
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
@@ -328,6 +364,7 @@ $ docker volume prune
|
||||
`docker-compose scale <service_name>=<replica>` | 为服务指定容器个数
|
||||
`docker-compose top` | 显示正在运行的进程
|
||||
`docker-compose run -rm -p 2022:22 web bash` | 启动 Web 服务并运行 bash 作为其命令,删除旧容器
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### Docker Services
|
||||
|
||||
@@ -339,8 +376,10 @@ $ docker volume prune
|
||||
`docker service ps` | 列出服务的任务
|
||||
`docker service scale <service_name>=<replica>` | 规模特殊服务
|
||||
`docker service update <options> <service_name>` | 更新服务选项
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### Docker Stack
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
@@ -349,6 +388,7 @@ $ docker volume prune
|
||||
`docker stack services <appname>` | 列出与应用关联的服务
|
||||
`docker stack ps <appname>` | 列出与应用关联的正在运行的容器
|
||||
`docker stack rm <appname>` | 拆掉一个应用程序
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### Docker Machine
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
@@ -369,8 +409,10 @@ $ docker volume prune
|
||||
`docker-machine rm $(docker-machine ls -q)` | 删除所有虚拟机及其磁盘映像
|
||||
`docker-machine scp docker-compose.yml myvm1:~` | 将文件复制到节点的主目录
|
||||
`docker-machine ssh myvm1 "docker stack deploy -c <file> <app>"` | 部署应用
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### docker 主要命令
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
@@ -414,9 +456,68 @@ $ docker volume prune
|
||||
`update` | 更新一个或多个容器的配置
|
||||
`version` | 显示 Docker 版本信息
|
||||
`wait` | 阻塞直到一个或多个容器停止,然后打印它们的退出代码
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### docker 管理命令
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
`docker builder` | 管理构建
|
||||
`docker buildx*` | Docker Buildx(Docker Inc.,v0.7.1)
|
||||
`docker compose*` | Docker Compose(Docker Inc.,v2.2.3)
|
||||
`docker config` | 管理 Docker 配置
|
||||
`docker container` | 管理容器
|
||||
`docker context` | 管理上下文
|
||||
`docker image` | 管理镜像
|
||||
`docker manifest` | 管理 Docker 镜像清单和清单列表
|
||||
`docker network` | 管理网络
|
||||
`docker node` | 管理 Swarm 节点
|
||||
`docker plugin` | 管理插件
|
||||
`docker scan*` | Docker 扫描(Docker Inc.,v0.16.0)
|
||||
`docker secret` | 管理 Docker 机密
|
||||
`docker service` | 管理服务
|
||||
`docker stack` | 管理 Docker 堆栈
|
||||
`docker swarm` | 管理群
|
||||
`docker system` | 管理 Docker
|
||||
`docker trust` | 管理对 Docker 映像的信任
|
||||
`docker volume` | 管理卷
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### docker 全局参数
|
||||
|
||||
```bash
|
||||
--config string # 客户端配置文件的位置(默认“~/.docker”)
|
||||
-c, --context string # 用于连接到守护程序的上下文的名称(
|
||||
# 覆盖 DOCKER_HOST 环境变量和使用
|
||||
# “docker context use” 设置的默认上下文)
|
||||
-D, --debug # 启用调试模式
|
||||
-H, --host list # 要连接的守护进程套接字
|
||||
-l, --log-level string # 设置日志级别
|
||||
# (默认“info”) ("debug"|"info"|"warn"|"error"|"fatal")
|
||||
--tls # 使用 TLS; 由 --tlsverify 暗示
|
||||
--tlscacert string # 仅由该 CA 签署的信任证书
|
||||
#(默认为“~/.docker/ca.pem”)
|
||||
--tlscert string # TLS证书文件路径
|
||||
#(默认“~/.docker/cert.pem”)
|
||||
--tlskey string # TLS 密钥文件的路径
|
||||
#(默认为“~/.docker/key.pem”)
|
||||
--tlsverify # 使用 TLS 并验证远程
|
||||
-v, --version # 打印版本信息并退出
|
||||
```
|
||||
|
||||
### docker images
|
||||
|
||||
```bash
|
||||
-a, --all 显示所有镜像(默认隐藏中间镜像)
|
||||
--digests 显示摘要
|
||||
-f, --filter filter 根据提供的条件过滤输出
|
||||
--format string 使用 Go 模板打印漂亮的镜像
|
||||
--no-trunc 不要截断输出
|
||||
-q, --quiet 仅显示镜像 ID
|
||||
```
|
||||
|
||||
### docker run/create
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
--add-host list # 添加自定义主机到 IP 映射 (host:ip)
|
||||
@@ -426,11 +527,11 @@ $ docker volume prune
|
||||
--cap-add list # 添加 Linux 功能
|
||||
--cap-drop list # 放弃 Linux 功能
|
||||
--cgroup-parent string # 容器的可选父 cgroup
|
||||
--cgroupns string # 要使用的 Cgroup 命名空间(主机|私有)
|
||||
# 'host': 在 Docker 主机的 cgroup 命名空间中运行容器
|
||||
# 'private': 在自己的私有 cgroup 命名空间中运行容器
|
||||
# '': 使用由守护进程上的
|
||||
# default-cgroupns-mode 选项配置的 cgroup 命名空间(默认)
|
||||
--cgroupns string # 要使用的 Cgroup 命名空间(主机|私有)
|
||||
# 'host': 在 Docker 主机的 cgroup 命名空间中运行容器
|
||||
# 'private': 在自己的私有 cgroup 命名空间中运行容器
|
||||
# '': 使用由守护进程上的
|
||||
# default-cgroupns-mode 选项配置的 cgroup 命名空间(默认)
|
||||
--cidfile string # 将容器 ID 写入文件
|
||||
--cpu-period int # 限制 CPU CFS(完全公平调度器)周期
|
||||
--cpu-quota int # 限制 CPU CFS(完全公平调度器)配额
|
||||
@@ -520,60 +621,62 @@ $ docker volume prune
|
||||
|
||||
`run`/`create` 大部分参数一致
|
||||
|
||||
### docker 全局参数
|
||||
### 修改Docker镜像拉取地址
|
||||
|
||||
您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
|
||||
|
||||
```bash
|
||||
--config string # 客户端配置文件的位置(默认“~/.docker”)
|
||||
-c, --context string # 用于连接到守护程序的上下文的名称(
|
||||
# 覆盖 DOCKER_HOST 环境变量和使用“docker context use”设置的默认上下文)
|
||||
-D, --debug # 启用调试模式
|
||||
-H, --host list # 要连接的守护进程套接字
|
||||
-l, --log-level string # 设置日志级别("debug"\|"info"\|"warn"\|"error"\|"fatal") (默认“info”)
|
||||
--tls # 使用 TLS; 由 --tlsverify 暗示
|
||||
--tlscacert string # 仅由该 CA 签署的信任证书(默认为“~/.docker/ca.pem”)
|
||||
--tlscert string # TLS证书文件路径(默认“~/.docker/cert.pem”)
|
||||
--tlskey string # TLS 密钥文件的路径(默认为“~/.docker/key.pem”)
|
||||
--tlsverify # 使用 TLS 并验证远程
|
||||
-v, --version # 打印版本信息并退出
|
||||
sudo mkdir -p /etc/docker
|
||||
sudo tee /etc/docker/daemon.json <<-'EOF'
|
||||
{
|
||||
"registry-mirrors": ["https://1ojaslt1.mirror.aliyuncs.com"]
|
||||
}
|
||||
EOF
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
|
||||
```
|
||||
|
||||
### docker 管理命令
|
||||
### 修改 Docker 数据存储路径
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
`docker builder` | 管理构建
|
||||
`docker buildx*` | Docker Buildx(Docker Inc.,v0.7.1)
|
||||
`docker compose*` | Docker Compose(Docker Inc.,v2.2.3)
|
||||
`docker config` | 管理 Docker 配置
|
||||
`docker container` | 管理容器
|
||||
`docker context` | 管理上下文
|
||||
`docker image` | 管理镜像
|
||||
`docker manifest` | 管理 Docker 镜像清单和清单列表
|
||||
`docker network` | 管理网络
|
||||
`docker node` | 管理 Swarm 节点
|
||||
`docker plugin` | 管理插件
|
||||
`docker scan*` | Docker 扫描(Docker Inc.,v0.16.0)
|
||||
`docker secret` | 管理 Docker 机密
|
||||
`docker service` | 管理服务
|
||||
`docker stack` | 管理 Docker 堆栈
|
||||
`docker swarm` | 管理群
|
||||
`docker system` | 管理 Docker
|
||||
`docker trust` | 管理对 Docker 映像的信任
|
||||
`docker volume` | 管理卷
|
||||
- 停止 Docker 服务:
|
||||
|
||||
### docker images
|
||||
```bash
|
||||
sudo systemctl stop docker
|
||||
```
|
||||
|
||||
- 将现有的 Docker 数据移动到新的目录:
|
||||
|
||||
```bash
|
||||
sudo mv /var/lib/docker /new/path/docker
|
||||
```
|
||||
|
||||
- 更新 Docker 的配置文件 `/etc/docker/daemon.json`,添加或修改 `data-root` 选项:
|
||||
|
||||
```json
|
||||
{ "data-root": "/new/path/docker" }
|
||||
```
|
||||
|
||||
- 重新启动 Docker 服务:
|
||||
|
||||
```bash
|
||||
sudo systemctl start docker
|
||||
```
|
||||
<!--rehype:className=style-timeline-->
|
||||
|
||||
⚠️注意:当你执行此操作时,旧的容器和镜像可能无法正常工作,因为它们的路径已更改。建议在部署 Docker 时执行此操作,以避免这些问题。如有必要,重新启动容器或重新创建它们,以确保它们的配置指向新的路径。
|
||||
|
||||
### Docker降级版本的方法
|
||||
|
||||
```bash
|
||||
-a, --all 显示所有镜像(默认隐藏中间镜像)
|
||||
--digests 显示摘要
|
||||
-f, --filter filter 根据提供的条件过滤输出
|
||||
--format string 使用 Go 模板打印漂亮的镜像
|
||||
--no-trunc 不要截断输出
|
||||
-q, --quiet 仅显示镜像 ID
|
||||
yum downgrade --setopt=obsoletes=0 \
|
||||
-y docker-ce-${version} docker-ce-selinux-${version}
|
||||
```
|
||||
|
||||
Docker 示例
|
||||
`${version}` 指定要降级的版本
|
||||
|
||||
Docker 常用示例
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
@@ -589,6 +692,433 @@ $ docker run -d --name portainer \
|
||||
portainer/portainer-ee:latest
|
||||
```
|
||||
|
||||
### Nginx
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
docker run -itd -p 80:80 --restart=always --name Nginx \
|
||||
-v $HOME/nginx_data/html:/usr/share/nginx/html \
|
||||
-v $HOME/nginx_data/conf:/etc/nginx/conf.d \
|
||||
-v $HOME/nginx_data/nginx.conf:/etc/nginx/nginx.conf \
|
||||
nginx
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
- `-itd`: 启动容器并保持后台运行
|
||||
- `-p 80:80`: 将主机的 80 端口映射到容器的 80 端口,用于访问 Nginx 站点页面
|
||||
- `--name Nginx`: 给容器指定一个名称为 "Nginx"
|
||||
- `--restart=always`: 在容器退出时,总是重新启动容器
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v $HOME/nginx_data/html:/usr/share/nginx/html`| 将容器中的 Nginx 站点页面路径映射到本地
|
||||
`-v $HOME/nginx_data/conf:/etc/nginx/conf.d`| 将容器中的 Nginx 虚拟主机配置文件路径映射到本地 *(需要提前准备好文件)*
|
||||
`-v $HOME/nginx_data/nginx.conf:/etc/nginx/nginx.conf`| 将容器中的 Nginx 主配置文件路径映射到本地 *(需要提前准备好文件)*
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### Tomcat
|
||||
|
||||
```bash
|
||||
docker run -itd -p 8080:8080 --restart=always \
|
||||
--name Tomcat \
|
||||
-v $HOME/Tomcat_data/webapps:/usr/local/tomcat/webapps/ROOT \
|
||||
tomcat
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
- `-itd`: 以后台运行的方式启动容器,并分配一个伪终端(pseudo-TTY)和保持 STDIN 打开
|
||||
- `-p 8080:8080`: 将主机的端口 8080 映射到容器的 8080 端口,用于访问 Tomcat 站点页面
|
||||
- `--name Tomcat`: 为容器指定名称为 "Tomcat"
|
||||
- `--restart=always`: 当容器退出时,总是重新启动容器
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
将容器中的 `/usr/local/tomcat/webapps/ROOT` 路径挂载到宿主机中的 `$HOME/Tomcat_data/webapps` 目录下。
|
||||
|
||||
### Weblogic
|
||||
<!--rehype:style=background:#d7a100;-->
|
||||
|
||||
```bash
|
||||
docker run -itd \
|
||||
-p 7001:7001 \
|
||||
-p 7002:7002 \
|
||||
-p 5556:5556 \
|
||||
--restart=always --name Weblogic ismaleiva90/weblogic12
|
||||
```
|
||||
|
||||
注意:`ismaleiva90/weblogic12` 是非官方或认证的 `Docker` 镜像!
|
||||
|
||||
#### 参数解释
|
||||
|
||||
- `-itd`: 后台运行容器,保持 STDIN 打开
|
||||
- `-p 7001:7001`: 映射主机 7001 端口到容器 7001 端口,访问 Weblogic 控制台页面
|
||||
- `-p 7002:7002`: 映射主机 7002 端口到容器 7002 端口,访问 Weblogic 站点页面
|
||||
- `-p 5556:5556`: 映射主机 5556 端口到容器 5556 端口,访问 Weblogic 站点页面
|
||||
- `--name Weblogic`: 容器名称为 "Weblogic"
|
||||
- `--restart=always`: 容器退出时,总是重新启动容器
|
||||
|
||||
### MySQL
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
docker run -d -it -p 3306:3306 --name MySQL --restart=always \
|
||||
-v $HOME/MySQL_Data/data:/var/lib/mysql \
|
||||
-v $HOME/MySQL_Data/conf:/etc/mysql/conf.d \
|
||||
--privileged=true \
|
||||
-e MYSQL_DATABASE='test_db' \
|
||||
-e MYSQL_ROOT_PASSWORD='abc$123' \
|
||||
-e MYSQL_USER='testuser' -e MYSQL_PASSWORD='abc$123' \
|
||||
mysql:8.0.31 \
|
||||
--character-set-server=utf8mb4 \
|
||||
--collation-server=utf8mb4_unicode_ci
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-d` | 表示以后台运行的方式启动容器
|
||||
`-it` | 分别表示分配一个伪终端(pseudo-TTY)并保持 STDIN 打开
|
||||
`-p 3306:3306` | 将主机的端口映射到容器的端口,这里是将主机的 3306 端口映射到容器的 3306 端口,用于访问 MySQL 数据库
|
||||
`--name MySQL` | 为容器指定一个名称,这里是 "MySQL"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
`--privileged=true` | 若不加字段--privileged=true可能会报权限错误
|
||||
`--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci` | 这两个选项参数是改变所有表的默认编码和排序规则以使用 UTF-8 (utf8mb4)
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v $HOME/MySQL_Data/data:/var/lib/mysql` | 将容器中的 MySQL 数据库数据存储到本地,以确保在容器重启时数据得以保留。
|
||||
`-v $HOME/MySQL_Data/conf:/etc/mysql/conf.d` | 将容器中的 MySQL 自定义配置文件路径映射到本地,以方便自定义配置。*请确保提前准备好文件,否则可能会启动失败*。
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 环境变量解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`MYSQL_ROOT_PASSWORD` *【必填】* | 必需的变量,用于指定 MySQL 的 root 超级用户帐户的密码。如果设置了 *`MYSQL_RANDOM_ROOT_PASSWORD=yes`* ,则会随机生成一个密码,并打印到 stdout。
|
||||
`MYSQL_USER` *【可选】* | 可选变量,用于创建新用户。此用户将被授予指定数据库的超级用户权限。需要同时设置 `MYSQL_PASSWORD` 变量。
|
||||
`MYSQL_PASSWORD` *【可选】* | 可选变量,用于创建新用户并设置密码。此用户将被授予指定数据库的超级用户权限。需要同时设置 `MYSQL_USER` 变量。
|
||||
`MYSQL_DATABASE` *【可选】* | 可选变量,允许在容器启动时指定要创建的数据库的名称。如果设置了 `MYSQL_USER` 和 `MYSQL_PASSWORD`,则该用户将被授予对此数据库的超级用户访问权限。
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### Oracle
|
||||
|
||||
```bash
|
||||
docker run -d -it -p 1521:1521 --name Oracle_11g --restart=always \
|
||||
--mount source=oracle_vol,target=/home/oracle/app/oracle/oradata \
|
||||
registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
|
||||
```
|
||||
|
||||
注意:registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g 是非官方或认证的Docker镜像!
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-d` | 表示以后台运行的方式启动容器
|
||||
`-it` | 分别表示分配一个伪终端(pseudo-TTY)并保持 STDIN 打开
|
||||
`-p 1521:1521` | 将主机的端口映射到容器的端口,这里是将主机的 1521 端口映射到容器的 1521 端口,用于访问 Oracle 数据库
|
||||
`--name Oracle_11g` | 为容器指定一个名称,这里是 "Oracle_11g"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`--mount source=oracle_vol,target=/home/oracle/app/oracle/oradata` | 将名为 "oracle_vol" 的 Docker 卷挂载到容器中的 "/home/oracle/app/oracle/oradata" 路径。这样做的目的是将 Oracle 数据库的数据存储在持久化的卷中,以便数据在容器重启时得以保留
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### PostgreSQL
|
||||
|
||||
```bash
|
||||
docker run -d -p 5432:5432 --restart=always --name PostgreSQL \
|
||||
-e POSTGRES_USER='postgres' \
|
||||
-e POSTGRES_PASSWORD='abc$123' \
|
||||
-e POSTGRES_DB='test' \
|
||||
-e PGDATA=/var/lib/postgresql/data/pgdata \
|
||||
-v $HOME/Postgres_Data:/var/lib/postgresql/data \
|
||||
-d postgres
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-d` | 表示以后台运行的方式启动容器
|
||||
`-it` | 分别表示分配一个伪终端(pseudo-TTY)并保持 STDIN 打开
|
||||
`-p 5432:5432` | 将主机的端口映射到容器的端口,这里是将主机的 5432 端口映射到容器的 5432 端口,用于访问 Postgre 数据库
|
||||
`--name PostgreSQL` | 为容器指定一个名称,这里是 "PostgreSQL"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
<!--rehype:className=auto-wrap left-align-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v $HOME/Postgres_Data:/var/lib/postgresql/data` | 将到容器中的 "/var/lib/postgresql/data" 路径映射挂载到 宿主机中的 ”$HOME/Postgres_Data“目录下,这样做的目的是将 Postgre 数据库的数据存储在本地中,以便数据在容器重启时得以保留
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 环境变量解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`POSTGRES_PASSWORD` *【必填】* | PostgreSQL 映像所需的环境变量。设置 PostgreSQL 超级用户的密码。不能为空或未定义。
|
||||
`POSTGRES_USER` *【可选】* | 可选环境变量,用于创建用户及其密码。创建具有超级用户权限的指定用户和同名的数据库。默认用户是 "postgres"。
|
||||
`POSTGRES_DB` *【可选】* | 可选环境变量,用于定义首次启动映像时创建的默认数据库的名称。默认值是 `POSTGRES_USER` 的值,如果未设置,则默认为 "postgres"。
|
||||
`PGDATA` *【可选】* | 默认为 `/var/lib/postgresql/data`。如果使用的数据卷是文件系统挂载点或无法被用户 chowned 的远程文件夹,则需要设置此环境变量以包含数据。
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### 达梦
|
||||
|
||||
```bash
|
||||
docker run -d -p 5236:5236 --restart=always --name DaMengDB \
|
||||
--privileged=true \
|
||||
-e PAGE_SIZE=16 \
|
||||
-e LD_LIBRARY_PATH=/opt/dmdbms/bin \
|
||||
-e EXTENT_SIZE=32 \
|
||||
-e BLANK_PAD_MODE=1 \
|
||||
-e LOG_SIZE=1024 \
|
||||
-e UNICODE_FLAG=1 \
|
||||
-e LENGTH_IN_CHAR=1 \
|
||||
-e INSTANCE_NAME=dm8_test \
|
||||
-v $HOME/DaMeng_Data:/opt/dmdbms/data \
|
||||
if010/dameng
|
||||
```
|
||||
|
||||
注意:if010/dameng 是从官网下载上传至 Docker Hub 的镜像!
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-d` | 表示以后台运行的方式启动容器
|
||||
`-it` | 分别表示分配一个伪终端(pseudo-TTY)并保持 STDIN 打开
|
||||
`-p 5236:5236` | 将主机的端口映射到容器的端口,这里是将主机的 5236 端口映射到容器的 5236 端口,用于访问达梦数据库
|
||||
`--name DaMengDB` | 为容器指定一个名称,这里是 "DaMengDB"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
<!--rehype:className=auto-wrap left-align-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v $HOME/DaMeng_Data:/opt/dmdbms/data` | 将容器中的达梦数据库数据存储路径 "/opt/dmdbms/data" 映射到本地主机的 "$HOME/DaMeng_Data" 目录,以确保在容器重启时数据得以保留
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### 人大金仓
|
||||
|
||||
```bash
|
||||
docker run -idt -p 5432:54321 --restart=always \
|
||||
--name Kingbase --privileged=true \
|
||||
-e DB_MODE=oracle \
|
||||
-e NEED_START=yes \
|
||||
-e DB_USER=kingbase \
|
||||
-e DB_PASSWORD=abc123 \
|
||||
-e ENABLE_CI=yes \
|
||||
-v $HOME/Kingbase_Data:/home/kingbase/userdata \
|
||||
if010/kingbase:v009r001c001b0025 /usr/sbin/init
|
||||
```
|
||||
|
||||
注意:`if010/kingbase:v009r001c001b0025` 是从官网下载上传至 Docker Hub 的镜像,官网提供了两个下载版本,一个是 `v008r006c008b0014`,另一个是 `v009r001c001b0025`,可以拉取对应的 `tag` 镜像进行测试使用!
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-itd` | 以后台方式启动容器,保持 STDIN 打开
|
||||
`-p 5432:54321` | 将主机的 5432 端口映射到容器的 5432 端口,访问数据库
|
||||
`--name Kingbase` | 给容器指定名称为 "Kingbase"
|
||||
`--restart=always` | 容器退出时,总是重新启动容器
|
||||
<!--rehype:className=auto-wrap left-align-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v $HOME/Kingbase_Data:/home/kingbase/userdata` | 将容器中的人大金仓数据库数据存储路径 "/home/kingbase/userdata" 映射到本地主机的 "$HOME/Kingbase_Data" 目录,以确保在容器重启时数据得以保留
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 环境变量解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`DB_USER` *【可选】* | 设置用户及其密码,默认为 "system"
|
||||
`DB_PASSWORD` *【可选】* | 设置用户密码,默认为 "123456"
|
||||
`DB_MODE` *【可选】* | 设置数据库模式,支持的模式有 oracle、pg、mysql
|
||||
`NEED_START` *【可选】* | 设置进入容器后是否启动数据库,默认为 "yes"
|
||||
`ENABLE_CI` *【可选】* | 设置是否需要配置大小写敏感,默认为 "yes"
|
||||
<!--rehype:className=auto-wrap left-align-->
|
||||
|
||||
### Redis
|
||||
|
||||
```bash
|
||||
docker run -d -p 6379:6379 --restart=always --name Redis \
|
||||
-v $HOME/Redis_Data/conf:/usr/local/etc/redis \
|
||||
-v $HOME/Redis_Data/data:/data \
|
||||
redis redis-server /usr/local/etc/redis/redis.conf
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-d` | 表示以后台运行的方式启动容器
|
||||
`-it` | 分别表示分配一个伪终端(pseudo-TTY)并保持 STDIN 打开
|
||||
`-p 6379:6379` | 将主机的端口映射到容器的端口,这里是将主机的 6379 端口映射到容器的 6379 端口,用于访问 Redis 数据库
|
||||
`--name Redis` | 为容器指定一个名称,这里是 "Redis"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v $HOME/Redis_Data/conf:/usr/local/etc/redis` | *(需提前准备好文件,否则可能会启动失败)* 将到容器中的 "/usr/local/etc/redis" 路径映射挂载到 宿主机中的"$HOME/Redis_Data/conf"目录下,这样子做的目的是可以自定义Redis的配置文件
|
||||
`-v $HOME/Redis_Data/data:/data` | 将到容器中的 "/data" 路径映射挂载到 宿主机中的"$HOME/Redis_Data/data"目录下,这样做的目的是将 Redis 数据库的数据存储在本地中,以便数据在容器重启时得以保留
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 关于启动命令
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`redis-server /usr/local/etc/redis/redis.conf` | 容器内部执行该命令是为了按照我们自定义的配置文件启动,这个不是必须的!!!
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### Memcache
|
||||
|
||||
```bash
|
||||
docker run -d -p 11211:11211 --name Memcached \
|
||||
--restart=always memcached memcached -m 64
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
- `-d`: 以后台方式启动容器。
|
||||
- `-it`: 分配一个伪终端(pseudo-TTY)并保持 STDIN 打开。
|
||||
- `-p 11211:11211`: 将主机的 11211 端口映射到容器的 11211 端口,用于访问 Memcached 消息队列的 web 管理界面。
|
||||
- `--name Memcached`: 容器的名称为 "Memcached"。
|
||||
- `--restart=always`: 容器退出时,总是重新启动容器。
|
||||
|
||||
#### 命令执行解释
|
||||
|
||||
- `memcached -m 64` 这会将 Memcached 服务器设置为使用 64 MB 进行存储
|
||||
|
||||
### MongoDB
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
docker run -d -p 27017:27017 --restart=always --name MongoDB \
|
||||
-e MONGO_INITDB_ROOT_USERNAME=mongoadmin \
|
||||
-e MONGO_INITDB_ROOT_PASSWORD=abc123 \
|
||||
-v $HOME/MongoDB_Data/data:/data/db \
|
||||
-v $HOME/MongoDB_Data/conf:/etc/mongo \
|
||||
mongo --config /etc/mongo/mongod.conf --wiredTigerCacheSizeGB 1.5
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-d` | 表示以后台运行的方式启动容器
|
||||
`-it` | 分别表示分配一个伪终端(pseudo-TTY)并保持 STDIN 打开
|
||||
`-p 27017:27017` | 将主机的端口映射到容器的端口,这里是将主机的 27017 端口映射到容器的 27017 端口,用于访问 MongoDB 数据库
|
||||
`--name MongoDB` | 为容器指定一个名称,这里是 "MongoDB"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
`--config /etc/mongo/mongod.conf` | 指定配置文件路径 (这个不是必须的,设置此选项之前需准备好mongod.conf文件映射到Docker内部)
|
||||
`--wiredTigerCacheSizeGB 1.5` | 设置WiredTiger缓存大小限制为1.5G
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v $HOME/MongoDB_Data/conf:/etc/mongo` | 将到容器中的 "/etc/mongo" 路径映射挂载到 宿主机中的"$HOME/MongoDB_Data/conf"目录下,这样子做的目的是可以自定义MongoDB的配置文件 *(需提前准备好文件,否则可能会启动失败)*
|
||||
`-v $HOME/Redis_Data/data:/data` | 将到容器中的 "/data/db" 路径映射挂载到 宿主机中的"$HOME/MongoDB_Data/data"目录下,这样做的目的是将 MongoDB 数据库的数据存储在本地中,以便数据在容器重启时得以保留
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 环境变量解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`MONGO_INITDB_ROOT_USERNAME` *【可选】* | 该变量是创建管理员用户,该用户是在 admin 身份验证数据库中创建的,并被赋予角色 root,这是一个"超级用户"角色。
|
||||
`MONGO_INITDB_ROOT_PASSWORD` *【可选】* | 该变量是为创建管理员用户设置密码,需配合 `MONGO_INITDB_ROOT_USERNAME` 变量参数使用
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### RabbitMQ
|
||||
|
||||
```bash
|
||||
docker run -itd -p 15672:15672 --name RabbitMQ \
|
||||
--hostname rmq-test \
|
||||
-e RABBITMQ_DEFAULT_VHOST=rmq-test \
|
||||
-e RABBITMQ_DEFAULT_USER=admin \
|
||||
-e RABBITMQ_DEFAULT_PASS=abc123 \
|
||||
rabbitmq:3-management
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-itd` | 表示以后台运行的方式启动容器,并分配一个伪终端(pseudo-TTY)和保持 STDIN 打开
|
||||
`-p 15672:15672` | 将主机的端口映射到容器的端口,这里是将主机的 15672 端口映射到容器的 15672 端口,用于访问 RabbitMQ 控制台页面,内部除了该端口外,还开了4369/tcp、5671-5672/tcp、15671/tcp、15691-15692/tcp、25672/tcp
|
||||
`--name RabbitMQ` | 为容器指定一个名称,这里是 "RabbitMQ"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
`--hostname` | 设置容器主机名称
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 环境变量解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`RABBITMQ_DEFAULT_VHOST` *【可选】* | 该变量是可选的,是设置 RabbitMQ 的主机名称
|
||||
`RABBITMQ_DEFAULT_USER` *【可选】* | 该变量是可选的,是设置 RabbitMQ 的账户
|
||||
`RABBITMQ_DEFAULT_PASS` *【可选】* | 该变量是可选的,是设置 RabbitMQ 的密码
|
||||
<!--rehype:className=auto-wrap left-align-->
|
||||
|
||||
### 远程协助工具 Guacd
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
```bash
|
||||
docker run -d -p 4822:4822 --privileged=true \
|
||||
--restart=always --name Guacd \
|
||||
-e LANG=zh_CN.UTF-8 \
|
||||
-v /docker_data/Guacd/rdp-rec:/rdp-rec \
|
||||
-v /docker_data/Guacd/rdp-file:/rdp-file \
|
||||
guacamole/guacd
|
||||
```
|
||||
|
||||
#### 参数解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-d` | 表示以后台运行的方式启动容器
|
||||
`-it` | 分别表示分配一个伪终端(pseudo-TTY)并保持 STDIN 打开
|
||||
`-p 4822:4822` | 将主机的端口映射到容器的端口,这里是将主机的 4822 端口映射到容器的 4822 端口,用于访问 Guacd远程的API接口
|
||||
`--name Guacd` | 为容器指定一个名称,这里是 "Guacd"
|
||||
`--restart=always` | 表示当容器退出时,总是重新启动容器
|
||||
`--privileged=true` | 若不加字段--privileged=true可能会报权限错误
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 持久化解释
|
||||
|
||||
-- | --
|
||||
:-- | --
|
||||
`-v /docker_data/Guacd/rdp-rec:/rdp-rec` | 代码内固定配置,guacd服务rdp录屏文件存放路径
|
||||
`-v /docker_data/Guacd/rdp-file:/rdp-file` | 代码内固定配置,guacd服务rdp远程磁盘文件存放路
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
#### 环境变量解释
|
||||
|
||||
- `LANG` 设置字符编码格式
|
||||
|
||||
### 在线代码编辑器 Code Server
|
||||
|
||||
```bash
|
||||
@@ -602,47 +1132,6 @@ $ docker run -it --name code-server \
|
||||
codercom/code-server:latest
|
||||
```
|
||||
|
||||
### MySQL
|
||||
|
||||
```bash
|
||||
$ docker run --name mysql \
|
||||
-p 3306:3306 \
|
||||
-v $HOME/mysql/conf.d:/etc/mysql/conf.d \
|
||||
-v $HOME/mysql/data:/var/lib/mysql \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-e MYSQL_ROOT_PASSWORD=123456 \
|
||||
-d mysql:5.7.23
|
||||
```
|
||||
|
||||
### Redis
|
||||
|
||||
```bash
|
||||
$ docker run -d --name myredis \
|
||||
-v $HOME/redis/conf:/usr/local/etc/redis \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
redis redis-server /usr/local/etc/redis/redis.conf
|
||||
```
|
||||
|
||||
### Nginx
|
||||
|
||||
```bash
|
||||
$ docker run --name my-nginx \
|
||||
-v "$HOME/nginx/nginx.conf:/etc/nginx/nginx.conf:ro" \
|
||||
-v "$HOME/nginx/html:/usr/share/nginx/html:ro" \
|
||||
-p 8080:80 \
|
||||
-d nginx
|
||||
```
|
||||
|
||||
### PostgreSQL
|
||||
|
||||
```bash
|
||||
$ docker run --name my-postgres \
|
||||
-e POSTGRES_PASSWORD=mysecretpassword \
|
||||
-e PGDATA=/var/lib/postgresql/data/pgdata \
|
||||
-v $HOME/nginx/mount:/var/lib/postgresql/data \
|
||||
-d postgres
|
||||
```
|
||||
|
||||
### 媒体管理工具 Dim
|
||||
|
||||
```bash
|
||||
@@ -676,3 +1165,4 @@ $ docker run -d --name gitlab \
|
||||
- [Dockerfile 备忘清单](./dockerfile.md) *(github.io)*
|
||||
- [Docker 官方入门教程](https://docs.docker.com/get-started/) *(docker.com)*
|
||||
- [Docker入门学习笔记](https://jaywcjlove.github.io/docker-tutorial) *(github.io)*
|
||||
- [快速安装Docker及配置及Docker配置、Docker常用命令](https://www.loganjin.cn/article/docker-install/)
|
||||
|
||||
@@ -28,7 +28,7 @@ FROM [--platform=<platform>] <image> [AS <name>]
|
||||
示例
|
||||
|
||||
```dockerfile
|
||||
FROM ruby:3.2.2
|
||||
FROM ruby:3.3.0
|
||||
FROM golang:1.20-alpine3.16 AS build-env
|
||||
```
|
||||
|
||||
|
||||
606
docs/elasticsearch.md
Normal file
@@ -0,0 +1,606 @@
|
||||
Elasticsearch 备忘清单
|
||||
===
|
||||
|
||||
这是 [Elasticsearch](https://www.elastic.co/guide/index.html) 的官方文档。 你可以在这里找到 elasticsearch 的所有文档。
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 入门
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
Elasticsearch 是一个基于 Lucene 库的搜索引擎。它提供了一个分布式、支持多租户的全文搜索引擎,具有HTTP Web接口和无模式JSON文档。
|
||||
|
||||
#### 下载
|
||||
|
||||
注意: `${VERSION}` 需替换为指定版本,官方包有的功能只能试用,完整功能需要付费,请仔细阅读官网文档。
|
||||
|
||||
#### Windows
|
||||
|
||||
```
|
||||
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-windows-x86_64.zip
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
#### linux
|
||||
|
||||
```shell
|
||||
$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-linux-x86_64.tar.gz
|
||||
|
||||
$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-linux-x86_64.tar.gz.sha512
|
||||
|
||||
$ shasum -a 512 -c elasticsearch-${VERSION}-linux-x86_64.tar.gz.sha512
|
||||
|
||||
$ tar -xzf elasticsearch-${VERSION}-linux-x86_64.tar.gz
|
||||
|
||||
$ cd elasticsearch-${VERSION}/
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
#### macos
|
||||
|
||||
```shell
|
||||
$ curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-darwin-x86_64.tar.gz
|
||||
|
||||
$ curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${VERSION}-darwin-x86_64.tar.gz.sha512 | shasum -a 512 -c -
|
||||
|
||||
$ tar -xzf elasticsearch-${VERSION}-darwin-x86_64.tar.gz
|
||||
|
||||
$ cd elasticsearch-${VERSION}/
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 启动
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
- 启动 Elasticsearch
|
||||
|
||||
```shell
|
||||
$ ./bin/elasticsearch
|
||||
```
|
||||
|
||||
- 设置密码
|
||||
|
||||
```shell
|
||||
export ELASTIC_PASSWORD="your_password"
|
||||
```
|
||||
|
||||
- 测试是否启动成功
|
||||
|
||||
```shell
|
||||
curl --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
- 成功则返回样例如下:
|
||||
|
||||
```json
|
||||
{
|
||||
"name" : "Cp8oag6",
|
||||
"cluster_name" : "elasticsearch",
|
||||
"cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA",
|
||||
"version" : {
|
||||
"number" : "${VERSION}",
|
||||
"build_type" : "tar",
|
||||
"build_hash" : "f27399d",
|
||||
"build_flavor" : "default",
|
||||
"build_date" : "2016-03-30T09:51:41.449Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "9.10.0",
|
||||
"minimum_wire_compatibility_version" : "1.2.3",
|
||||
"minimum_index_compatibility_version" : "1.2.3"
|
||||
},
|
||||
"tagline" : "You Know, for Search"
|
||||
}
|
||||
```
|
||||
<!--rehype:className=style-timeline-->
|
||||
|
||||
### Elasticsearch 和 RDMS 的对比
|
||||
|
||||
| RDMS | elasticsearch |
|
||||
| ----------------------- | ----------------- |
|
||||
| 数据库(database) | 索引(index) |
|
||||
| 表(table) | 类型(type) |
|
||||
| 行(row) | 文档(document) |
|
||||
| 列(column) | 字段(field) |
|
||||
| 表结构 | 映射 |
|
||||
| 索引 | 全文索引 |
|
||||
| SQL | 查询DSL |
|
||||
| SELECT * FROM tablename | GET http://... |
|
||||
| UPDATE table SET | PUT http://... |
|
||||
| DELETE | DELETE http://... |
|
||||
<!--rehype:className=left-align show-header-->
|
||||
|
||||
操作
|
||||
---
|
||||
|
||||
### 基础语法规则
|
||||
|
||||
```shell
|
||||
$ curl -X<VERB> '<PROTOCOL>://<HOST>:<PORT>/<PATH>?<QUERY_STRING>' -d '<BODY>'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
- `VERB HTTP` 方法:GET, POST, PUT, HEAD, DELETE
|
||||
- `PROTOCOL`:http 或者 https 协议(只有在 Elasticsearch 前面有 https 代理的时候可用)
|
||||
- `HOST`:Elasticsearch 集群中的任何一个节点的主机名,如果是在本地的节点,那么就叫 localhost
|
||||
- `PORT`:Elasticsearch HTTP 服务所在的端口,默认为 9200
|
||||
- `PATH API 路径`(例如_count 将返回集群中文档的数量),PATH:可以包含多个组件,例如_cluster/stats 或者_nodes/stats/jvm
|
||||
- `QUERY_STRING`:一些可选的查询请求参数,例如?pretty 参数将使请求返回更加美观易读的 JSON 数据
|
||||
- `BODY`:一个 JSON 格式的请求主体(如果请求需要的话)
|
||||
|
||||
### 创建索引
|
||||
<!--rehype:wrap-class=col-span-2 row-span-3-->
|
||||
|
||||
#### 统一请求 api 前缀
|
||||
|
||||
```
|
||||
http://localhost:9200/
|
||||
```
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
PUT /user_info
|
||||
{
|
||||
"settings": { "number_of_replicas": 1, "number_of_shards": 1 },
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"id": { "type": "long", "index": true },
|
||||
"username": { "type": "keyword", "index": true },
|
||||
"nickname": { "type": "keyword", "index": true },
|
||||
"password": { "type": "keyword", "index": false },
|
||||
"age": { "type": "integer", "index": true },
|
||||
"info": { "type": "text", "index": true },
|
||||
"remark": { "type": "text", "index": true }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### curl
|
||||
|
||||
```shell
|
||||
curl -XPUT "http://localhost:9200/user_info" -H 'Content-Type: application/json' -d'{ "settings": { "number_of_replicas": 1, "number_of_shards": 1 }, "mappings": { "properties": { "id": { "type": "long", "index": true }, "username": { "type": "keyword", "index": true }, "nickname": { "type": "keyword", "index": true }, "password": { "type": "keyword", "index": false }, "age": { "type": "integer", "index": true }, "info": { "type": "text", "index": true }, "remark": { "type": "text", "index": true } } } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
#### 参数说明
|
||||
|
||||
- `settings`: 设置索引的信息
|
||||
- `number_of_shards`: 每个索引的主分片数,一旦索引创建后,无法修改此配置
|
||||
- `number_of_replicas`: 每个主分片的副本数,此配置可随时修改
|
||||
- `mappings`: 索引映射定义
|
||||
- `properties`: 字段定义。使用 JSON 配置,键为字段名称(自定义),值为嵌套 JSON,其中 `type` 指定字段的类型
|
||||
|
||||
其他参数很多,请参考官网资料
|
||||
|
||||
### 删除索引
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```http
|
||||
DELETE /user_info
|
||||
```
|
||||
|
||||
#### curl
|
||||
|
||||
```shell
|
||||
curl -XDELETE "http://localhost:9200/user_info"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 判断索引是否存在
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```http
|
||||
# 查看索引是否存在
|
||||
HEAD /user_info
|
||||
```
|
||||
|
||||
#### curl
|
||||
|
||||
```shell
|
||||
# 查看索引是否存在
|
||||
curl -XHEAD "http://localhost:9200/user_info"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 开启/关闭索引
|
||||
|
||||
#### 开启DSL语法
|
||||
|
||||
```shell
|
||||
POST /user_info/_open
|
||||
```
|
||||
|
||||
`curl`
|
||||
|
||||
```shell
|
||||
curl -XPOST "http://localhost:9200/user_info/_open"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
#### 关闭 DSL 语法
|
||||
|
||||
```shell
|
||||
POST /user_info/_close
|
||||
```
|
||||
|
||||
`curl`
|
||||
|
||||
```shell
|
||||
curl -XPOST "http://localhost:9200/user_info/_close"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 索引的别名
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
- 添加别名 DSL 语法
|
||||
|
||||
```shell
|
||||
POST /user_info/_alias/user1
|
||||
```
|
||||
|
||||
```shell
|
||||
curl -XPOST "http://localhost:9200/user_info/_alias/user1"
|
||||
```
|
||||
|
||||
- 删除别名DSL语法
|
||||
|
||||
```shell
|
||||
DELETE /user_info/_alias/user1
|
||||
```
|
||||
|
||||
```shell
|
||||
curl -XDELETE "http://localhost:9200/user_info/_alias/user1"
|
||||
```
|
||||
|
||||
- 查看别名DSL语法
|
||||
|
||||
```shell
|
||||
GET /_alias/user1
|
||||
```
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/_alias/useraa"
|
||||
```
|
||||
|
||||
Mapping 操作
|
||||
---
|
||||
|
||||
类似修改数据库中列的操作
|
||||
|
||||
### 查看 mapping
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```shell
|
||||
GET /user_info/_mapping
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_mapping"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 新增 mapping
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```shell
|
||||
PUT /user_info/_mapping
|
||||
{
|
||||
"properties":{
|
||||
"sex":{ "type":"keyword" }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XPUT "http://localhost:9200/user_info/_mapping" -H 'Content-Type: application/json' -d'{ "properties":{ "sex":{ "type":"keyword" } } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
`注意`: 需要注意的是字段映射只能增加,不能更改删除
|
||||
|
||||
文档的操作
|
||||
---
|
||||
|
||||
### 添加文档
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
#### 新增一条数据 - DSL语法
|
||||
|
||||
```shell
|
||||
POST /user_info/_doc/1
|
||||
{
|
||||
"id":1,
|
||||
"username":"username",
|
||||
"password":"123456",
|
||||
"nickname":"nickname",
|
||||
"age":18,
|
||||
"info":"一些个人相关的介绍",
|
||||
"remark":"备注信息",
|
||||
"sex":"男"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XPOST "http://localhost:9200/user_info/_doc/1" -H 'Content-Type: application/json' -d'{ "id":1, "username":"username", "password":"123456", "nickname":"nickname", "age":18, "info":"一些个人相关的介绍", "remark":"备注信息", "sex":"男" }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 查询指定索引的所有文档
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
类似数据库中的 `select * from user_info;`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
GET /user_info/_search
|
||||
{
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "match_all": {} } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 通过 id 查询文档
|
||||
|
||||
类似数据库中的 `select * from user_info where id = 1;`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```shell
|
||||
GET /user_info/_doc/1
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_doc/1"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 模糊查找
|
||||
|
||||
类似数据库中的模糊查询 `select * from user_info where info like '%人%';`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
GET /user_info/_search
|
||||
{
|
||||
"query": { "match": { "info": "人" } }
|
||||
}
|
||||
```
|
||||
|
||||
### 通过条件查询文档
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
类似数据库中的 `select * from user_info where username = 'username';`
|
||||
|
||||
#### 通过条件查询 - DSL语法
|
||||
|
||||
```json
|
||||
GET /user_info/_search
|
||||
{
|
||||
"query": {
|
||||
"bool": {
|
||||
"must": [ { "term": { "username": "username" } } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "bool": { "must": [ { "term": { "username": "username" } } ] } } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 范围查找
|
||||
|
||||
类似数据库中的范围查询 `select * from user_info where age between 18 and 30;`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
GET /user_info/_search
|
||||
{
|
||||
"query": {
|
||||
"range": {
|
||||
"age": {
|
||||
"gt": 18,
|
||||
"lt": 30
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "range": { "age": { "gt": 18, "lt": 30 } } } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### and 查询
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
类似数据库中的 and 查询 `select * from user_info where age > 18 and sex = '男';`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
GET /user_info/_search
|
||||
{
|
||||
"query": {
|
||||
"bool": {
|
||||
"must": [
|
||||
{ "range": { "age": { "gt": 18 } } },
|
||||
{ "term": { "sex": "男" } }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "bool": { "must": [ { "range": { "age": { "gt": 17 } } }, { "term": { "sex": "男" } } ] } } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### limit 查找
|
||||
|
||||
类似数据库中的 limit 查询 `select * from user_info limit 10;`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
GET /user_info/_search
|
||||
{
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "size": 1, "query": { "match_all": {} } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### limit offset 查找
|
||||
|
||||
类似数据库中的 limit 查询 `select * from user_info limit 0,10;`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```http
|
||||
GET /user_info/_search
|
||||
{
|
||||
"size": 2,
|
||||
"from": 1,
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "size": 2, "from": 1, "query": { "match_all": {} } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
#### 参数说明
|
||||
|
||||
- `size`: 10 表示我们想要返回的结果数量是10条
|
||||
- `from`: 20 表示我们想要从结果集中的第21条记录开始返回(因为偏移是从0开始的)
|
||||
- `query`: `{"match_all": {}}` 是一个匹配所有文档的查询,因为我们没有特定的查询条件,只是想要分页结果
|
||||
|
||||
### or 查询
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
类似数据库中的 or 查询 `select * from user_info where age > 18 or sex = '男';`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
GET /user_info/_search
|
||||
{
|
||||
"query": {
|
||||
"bool": {
|
||||
"should": [
|
||||
{
|
||||
"range": {
|
||||
"age": { "gt": 18 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"term": { "sex": "男" }
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XGET "http://localhost:9200/user_info/_search" -H 'Content-Type: application/json' -d'{ "query": { "bool": { "should": [ { "range": { "age": { "gt": 18 } } }, { "term": { "sex": "男" } } ] } } }'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
删除文档
|
||||
---
|
||||
|
||||
### 删除指定 id
|
||||
|
||||
类似数据库中的 delete 查询 `delete from user_info where id = 3;`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```shell
|
||||
# 删除文档
|
||||
DELETE /user_info/_doc/3
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
# 删除文档
|
||||
curl -XDELETE "http://localhost:9200/user_info/_doc/3"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 删除指定条件
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
类似数据库中的 delete 查询 `delete from user_info where age > 18;`
|
||||
|
||||
#### DSL语法
|
||||
|
||||
```json
|
||||
POST /user_info/_delete_by_query
|
||||
{
|
||||
"query": {
|
||||
"range": { "age": { "gt": 18 } }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```shell
|
||||
curl -XPOST "http://localhost:9200/user_info/_delete_by_query" -H 'Content-Type: application/json' -d'{"query":{"range":{"age":{"gt":18}}}}'
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
802
docs/elixir.md
Normal file
@@ -0,0 +1,802 @@
|
||||
Elixir 备忘清单
|
||||
===
|
||||
|
||||
提供基本语法和方法的 Elixir 快速参考备忘单。
|
||||
|
||||
入门
|
||||
------
|
||||
|
||||
### 安装 Elixir
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
Elixir 自带了 `iex` 这样一个交互 shell,可以随时计算 Elixir 表达式的值,运行`iex`命令,继续输入几个简单的表达式试试:
|
||||
|
||||
```shell
|
||||
iex 2+3
|
||||
5
|
||||
iex 2+3 == 5
|
||||
true
|
||||
iex String.length("快速的狐狸跳过了懒惰的狗")
|
||||
43
|
||||
```
|
||||
|
||||
每个操作系统的文档可以在[官网](https://elixir-lang.org)网站上 [Installing Elixir](http://elixir-lang.org/install.html) 部分找到
|
||||
|
||||
### hello.exs
|
||||
|
||||
```elixir
|
||||
IO.puts("Hello world from Elixir")
|
||||
```
|
||||
|
||||
Elixir 运行命令
|
||||
|
||||
```shell
|
||||
$ elixir hello.exs
|
||||
```
|
||||
|
||||
### 基本类型
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
Elixir 支持多种基本类型:整数、浮点、布尔值、原子和字符串。其他数据类型,如列表和元组
|
||||
|
||||
```elixir
|
||||
# integer 整数
|
||||
iex> 1
|
||||
# integer(支持2进制、8进制和16进制的整数)
|
||||
iex> 0x1F
|
||||
# float
|
||||
iex> 1.0
|
||||
# boolean
|
||||
iex> true
|
||||
# atom / symbol
|
||||
iex> :atom
|
||||
# string
|
||||
iex> "elixir"
|
||||
# list
|
||||
iex> [1, 2, 3]
|
||||
# tuple
|
||||
iex> {1, 2, 3}
|
||||
```
|
||||
|
||||
### 注释
|
||||
|
||||
```elixir
|
||||
# 这是一个单行注释
|
||||
```
|
||||
|
||||
### 字符串插值与拼接
|
||||
|
||||
```elixir
|
||||
iex> name = "Sean"
|
||||
iex> "Hello #{name}"
|
||||
"Hello Sean"
|
||||
|
||||
iex> "Hello " <> "world!"
|
||||
"Hello world!"
|
||||
```
|
||||
|
||||
### 变量和模式匹配
|
||||
|
||||
```elixir
|
||||
x = 1
|
||||
# => x 现在等于 1
|
||||
|
||||
{a, b} = {1, 2}
|
||||
# => a 等于 1,b 等于 2
|
||||
```
|
||||
|
||||
在 Elixir 中,使用 `=` 来进行赋值操作,但实际上是模式匹配。左边是模式,右边是值
|
||||
|
||||
### 原子(Atoms)
|
||||
|
||||
```elixir
|
||||
:ok
|
||||
```
|
||||
|
||||
原子是常量,它们的名称就是它们的值
|
||||
|
||||
### 列表(Lists)
|
||||
|
||||
```elixir
|
||||
list = [1, 2, 3]
|
||||
```
|
||||
|
||||
### 元组(Tuples)
|
||||
|
||||
```elixir
|
||||
tuple = {:ok, "value"}
|
||||
```
|
||||
|
||||
### 函数定义
|
||||
|
||||
```elixir
|
||||
defmodule MyModule do
|
||||
def my_function(parameter) do
|
||||
# 函数体
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
### 匿名函数
|
||||
|
||||
```elixir
|
||||
add = fn a, b -> a + b end
|
||||
```
|
||||
|
||||
### 控制结构
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
`if/else`
|
||||
|
||||
```elixir
|
||||
if x > 0 do
|
||||
"Positive"
|
||||
else
|
||||
"Non-positive"
|
||||
end
|
||||
```
|
||||
|
||||
`case`
|
||||
|
||||
```elixir
|
||||
case {1, 2} do
|
||||
{1, x} -> "Matched #{x}"
|
||||
_ -> "Not matched"
|
||||
end
|
||||
```
|
||||
|
||||
`cond`
|
||||
|
||||
```elixir
|
||||
cond do
|
||||
x > 2 -> "Greater than 2"
|
||||
x == 2 -> "Equal to 2"
|
||||
true -> "Less than 2"
|
||||
end
|
||||
```
|
||||
|
||||
### 基本算术
|
||||
<!--rehype:wrap-class=row-span-4-->
|
||||
|
||||
```elixir
|
||||
iex> 1 + 2
|
||||
3
|
||||
iex> 5 * 5
|
||||
25
|
||||
iex> 10 / 2
|
||||
5.0
|
||||
```
|
||||
|
||||
运算符`/`总是返回一个 float。如果你想做整数除法或得到除法余数,你可以调用 div 和 rem 函数:
|
||||
|
||||
```elixir
|
||||
iex> div(10, 2)
|
||||
5
|
||||
```
|
||||
|
||||
允许在调用需要一个或多个参数的函数时删除括号
|
||||
|
||||
```elixir
|
||||
iex> div 10, 2
|
||||
5
|
||||
iex> rem 10, 3
|
||||
1
|
||||
```
|
||||
|
||||
可以调用 round 函数来获取与给定浮点数最接近的整数,或者调用 trunc 函数来获取浮点数的整数部分
|
||||
|
||||
```elixir
|
||||
iex> round(3.58)
|
||||
4
|
||||
iex> trunc(3.58)
|
||||
3
|
||||
```
|
||||
|
||||
可以使用 is_integer、is_float 或 is_number 分别检查参数是否为 integer、float 或 number 类型
|
||||
|
||||
```elixir
|
||||
iex> is_integer(1)
|
||||
true
|
||||
iex> is_float(2.0)
|
||||
true
|
||||
iex> is_number(2.0)
|
||||
false
|
||||
```
|
||||
|
||||
### 布尔算术
|
||||
<!--rehype:wrap-class=row-span-4-->
|
||||
|
||||
Elixir 提供了 `||`、`&&` 和 `!` 布尔操作符,它们支持任何类型的操作:
|
||||
|
||||
```elixir
|
||||
iex> -20 || true
|
||||
-20
|
||||
iex> false || 42
|
||||
42
|
||||
|
||||
iex> 42 && true
|
||||
true
|
||||
iex> 42 && nil
|
||||
nil
|
||||
|
||||
iex> !42
|
||||
false
|
||||
iex> !false
|
||||
true
|
||||
```
|
||||
|
||||
还有三个操作符(and、or、not),它们的第一个参数**必须是布尔类型**(true 和 false):
|
||||
|
||||
```elixir
|
||||
iex> true and 42
|
||||
42
|
||||
iex> false or true
|
||||
true
|
||||
iex> not false
|
||||
true
|
||||
iex> 42 and true
|
||||
** (ArgumentError) argument error: 42
|
||||
iex> not 42
|
||||
** (ArgumentError) argument error
|
||||
```
|
||||
|
||||
### 模块和函数导入
|
||||
|
||||
```elixir
|
||||
import List, only: [duplicate: 2]
|
||||
```
|
||||
|
||||
### 管道操作符
|
||||
|
||||
```elixir
|
||||
result = data
|
||||
|> process1()
|
||||
|> process2()
|
||||
```
|
||||
|
||||
`|>` 用于链式调用函数,将前一个函数的结果作为下一个函数的第一个参数
|
||||
|
||||
### 比较运算符
|
||||
|
||||
比较运算符 :`==`, `!=`, `===`, `!==`, `<=`, `>=`, `<` 和 `>`
|
||||
|
||||
```elixir
|
||||
iex> 1 > 2
|
||||
false
|
||||
iex> 1 != 2
|
||||
true
|
||||
iex> 2 == 2
|
||||
true
|
||||
iex> 2 <= 3
|
||||
true
|
||||
```
|
||||
|
||||
集合
|
||||
------
|
||||
>
|
||||
> 列表(list)、元组(tuple)、关键字列表(keyword list)、映射(map)。
|
||||
>
|
||||
|
||||
### 列表(List)
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```elixir
|
||||
iex> [3.14, :pie, "Apple"]
|
||||
[3.14, :pie, "Apple"]
|
||||
|
||||
iex> list = [3.14, :pie, "Apple"]
|
||||
iex> [3.14, :pie, "Apple"]
|
||||
```
|
||||
|
||||
列表的开头添加元素
|
||||
|
||||
```elixir
|
||||
iex> ["π" | list]
|
||||
["π", 3.14, :pie, "Apple"]
|
||||
```
|
||||
|
||||
列表的尾部添加元素/列表拼接
|
||||
|
||||
```elixir
|
||||
iex> list ++ ["Cherry"]
|
||||
[3.14, :pie, "Apple", "Cherry"]
|
||||
|
||||
```
|
||||
|
||||
获取列表的头部元素
|
||||
|
||||
```elixir
|
||||
iex> hd [3.14, :pie, "Apple"]
|
||||
3.14
|
||||
```
|
||||
|
||||
获取列表的尾部元素
|
||||
|
||||
```elixir
|
||||
iex> tl [3.14, :pie, "Apple"]
|
||||
[:pie, "Apple"]
|
||||
```
|
||||
|
||||
### 元组(Tuple)
|
||||
|
||||
```elixir
|
||||
iex> {3.14, :pie, "Apple"}
|
||||
{3.14, :pie, "Apple"}
|
||||
```
|
||||
|
||||
### 关键字列表(Keyword List)
|
||||
|
||||
```elixir
|
||||
iex> [foo: "bar", hello: "world"]
|
||||
[foo: "bar", hello: "world"]
|
||||
iex> [{:foo, "bar"}, {:hello, "world"}]
|
||||
[foo: "bar", hello: "world"]
|
||||
```
|
||||
|
||||
关键字列表非常重要,它有以下的特性:
|
||||
|
||||
- 键(key)都是原子(atom)
|
||||
- 键(key)是有序的(定义后,顺序不会改变)
|
||||
- 键(key)不必是唯一的
|
||||
|
||||
因为这些原因,常见的用法是作为参数传递给函数
|
||||
|
||||
### 映射(Map)
|
||||
|
||||
Elixir 的映射(maps)是键值对结构的第一选择,和关键字列表(keywords)不同,映射允许任意类型的数据作为键,而且数据并不严格排序。 你可以使用 %{} 来定义映射:
|
||||
|
||||
```elixir
|
||||
iex> map = %{:foo => "bar", "hello" => :world}
|
||||
%{:foo => "bar", "hello" => :world}
|
||||
iex> map[:foo]
|
||||
"bar"
|
||||
iex> map["hello"]
|
||||
:world
|
||||
```
|
||||
|
||||
模式匹配
|
||||
------
|
||||
|
||||
>
|
||||
> 模式匹配是 Elixir 很强大的特性,它允许我们匹配简单值、数据结构、甚至函数。
|
||||
>
|
||||
|
||||
### 匹配元组
|
||||
|
||||
```elixir
|
||||
iex> {a, b, c} = {:hello, "world", 42}
|
||||
{:hello, "world", 42}
|
||||
iex> a
|
||||
:hello
|
||||
iex> b
|
||||
"world"
|
||||
```
|
||||
|
||||
### 匹配列表
|
||||
|
||||
```
|
||||
iex> [a, b, c] = [1, 2, 3]
|
||||
[1, 2, 3]
|
||||
iex> a
|
||||
1
|
||||
```
|
||||
|
||||
### 匹配列表的头部元素
|
||||
|
||||
```
|
||||
iex> [head | tail] = [1, 2, 3]
|
||||
[1, 2, 3]
|
||||
iex> head
|
||||
1
|
||||
iex> tail
|
||||
[2, 3]
|
||||
```
|
||||
|
||||
### Pin 操作符
|
||||
|
||||
pin 操作符,就是用已经绑定的值去匹配,而不是重新绑定一个新值。
|
||||
|
||||
```elixir
|
||||
iex> {x, ^x} = {2, 1}
|
||||
{2, 1}
|
||||
iex> x
|
||||
2
|
||||
```
|
||||
|
||||
### 使用下划线 `_` 忽略匹配的值
|
||||
|
||||
```elixir
|
||||
iex> [head | _] = [1, 2, 3]
|
||||
[1, 2, 3]
|
||||
iex> head
|
||||
1
|
||||
```
|
||||
|
||||
控制语句
|
||||
------
|
||||
|
||||
### if/else/end
|
||||
|
||||
```elixir
|
||||
if condition do
|
||||
# 条件成立时执行的代码
|
||||
else
|
||||
# 条件不成立时执行的代码
|
||||
end
|
||||
```
|
||||
|
||||
### case/end
|
||||
|
||||
```elixir
|
||||
case expression do
|
||||
pattern1 -> # 匹配 pattern1 时执行的代码
|
||||
pattern2 -> # 匹配 pattern2 时执行的代码
|
||||
_ -> # 其他情况执行的代码
|
||||
end
|
||||
```
|
||||
|
||||
### cond/end
|
||||
|
||||
```elixir
|
||||
cond do
|
||||
condition1 -> # 条件1成立时执行的代码
|
||||
condition2 -> # 条件2成立时执行的代码
|
||||
true -> # 如果没有任何条件成立,执行这里的代码
|
||||
end
|
||||
```
|
||||
|
||||
### unless/do/end
|
||||
|
||||
```elixir
|
||||
unless condition do
|
||||
# 条件为假时执行的代码
|
||||
end
|
||||
```
|
||||
|
||||
### try/rescue/end
|
||||
|
||||
```elixir
|
||||
try do
|
||||
# 可能会引发异常的代码
|
||||
rescue
|
||||
pattern1 -> # 匹配 pattern1 的异常处理代码
|
||||
pattern2 -> # 匹配 pattern2 的异常处理代码
|
||||
_ -> # 其他异常处理代码
|
||||
end
|
||||
```
|
||||
|
||||
### case
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
允许将一个值与许多模式进行比较,直到找到匹配的模式:
|
||||
|
||||
```elixir
|
||||
iex> case {1, 2, 3} do
|
||||
{4, 5, 6} ->
|
||||
"This clause won't match"
|
||||
{1, x, 3} ->
|
||||
"该子句将匹配并绑定 x 到该子句中的 2"
|
||||
_ ->
|
||||
"This clause would match any value"
|
||||
end
|
||||
"该子句将匹配并绑定 x 到该子句中的 2"
|
||||
```
|
||||
|
||||
还可以使用when指定额外的条件
|
||||
|
||||
```elixir
|
||||
iex> case {1, 2, 3} do
|
||||
{1, x, 3} when x > 0 ->
|
||||
"Will match"
|
||||
_ ->
|
||||
"如果不满足保护条件,将匹配"
|
||||
end
|
||||
"Will match"
|
||||
```
|
||||
|
||||
### cond
|
||||
|
||||
当我们需要根据条件进行匹配而不是值时,类似于其他语言的 `else if` 或 `elsif`,可以使用 `cond` 控制结构。
|
||||
|
||||
```elixir
|
||||
iex> cond do
|
||||
2 + 2 == 5 ->
|
||||
"This will not be true"
|
||||
2 * 2 == 3 ->
|
||||
"Nor this"
|
||||
1 + 1 == 2 ->
|
||||
"But this will"
|
||||
end
|
||||
"But this will"
|
||||
```
|
||||
|
||||
如果所有的条件都返回 `nil` 或 `false`,则会引发一个错误(CondClauseError)。因此,需要添加一个 `final` 条件,等于 `true`,它将始终匹配:
|
||||
|
||||
```elixir
|
||||
iex> cond do
|
||||
2 + 2 == 5 ->
|
||||
"This is never true"
|
||||
2 * 2 == 3 ->
|
||||
"Nor this"
|
||||
true ->
|
||||
"这始终为真(等同于 else)"
|
||||
end
|
||||
"这始终为真(等同于 else)"
|
||||
```
|
||||
|
||||
### 变量的作用域
|
||||
|
||||
如果在if、case和类似的构造中声明或更改了任何变量,则声明和更改将只在构造中可见。
|
||||
|
||||
```elixir
|
||||
iex> x = 1
|
||||
1
|
||||
if true do
|
||||
x = x + 1
|
||||
end
|
||||
2
|
||||
iex> x
|
||||
1
|
||||
```
|
||||
|
||||
如果要更改值,则必须从if返回值:
|
||||
|
||||
```elixir
|
||||
iex> x = 1
|
||||
1
|
||||
iex> x = if true do
|
||||
x + 1
|
||||
else
|
||||
x
|
||||
end
|
||||
2
|
||||
```
|
||||
|
||||
函数
|
||||
------
|
||||
|
||||
### 函数定义
|
||||
|
||||
```elixir
|
||||
def function_name(param1, param2) do
|
||||
# 函数体
|
||||
end
|
||||
```
|
||||
|
||||
示例:
|
||||
|
||||
```elixir
|
||||
def sum(a, b) do
|
||||
a + b
|
||||
end
|
||||
```
|
||||
|
||||
### 模式匹配的多个函数定义
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```elixir
|
||||
def fun_name(:atom) do
|
||||
# 对于 :atom 的处理
|
||||
end
|
||||
|
||||
def fun_name("string") do
|
||||
# 对于 "string" 的处理
|
||||
end
|
||||
|
||||
def fun_name(number) when is_integer(number) do
|
||||
# 对于整数的处理
|
||||
end
|
||||
```
|
||||
|
||||
示例:
|
||||
|
||||
```elixir
|
||||
def is_positive(number) when number > 0 do
|
||||
true
|
||||
end
|
||||
|
||||
def is_positive(_), do: false
|
||||
```
|
||||
|
||||
### 函数调用
|
||||
|
||||
```elixir
|
||||
module_name.function_name(arg1, arg2)
|
||||
```
|
||||
|
||||
示例:
|
||||
|
||||
```elixir
|
||||
Enum.map([1, 2, 3], &(&1 * 2))
|
||||
```
|
||||
|
||||
### 函数参数默认值
|
||||
|
||||
```elixir
|
||||
def function_name(parameter \\ 默认值) do
|
||||
# 函数体
|
||||
end
|
||||
```
|
||||
|
||||
示例:
|
||||
|
||||
```elixir
|
||||
def greet(name \\ "World") do
|
||||
"Hello, #{name}!"
|
||||
end
|
||||
```
|
||||
|
||||
### 可变参数数量
|
||||
|
||||
```elixir
|
||||
def function_name(param1, param2 \\ []) do
|
||||
# 函数体
|
||||
end
|
||||
```
|
||||
|
||||
示例:
|
||||
|
||||
```elixir
|
||||
def sum(numbers) do
|
||||
Enum.sum(numbers)
|
||||
end
|
||||
```
|
||||
|
||||
### 函数文档注释
|
||||
|
||||
```elixir
|
||||
@doc """
|
||||
这是函数的文档。
|
||||
"""
|
||||
```
|
||||
|
||||
示例:
|
||||
|
||||
```elixir
|
||||
@doc """
|
||||
Adds two numbers together.
|
||||
|
||||
## 示例
|
||||
|
||||
iex> MyModule.add(1, 2)
|
||||
3
|
||||
"""
|
||||
def add(a, b) do
|
||||
a + b
|
||||
end
|
||||
```
|
||||
|
||||
这些是 Elixir 函数语法的基本要点,可以帮助你开始编写函数。
|
||||
|
||||
### 匿名函数
|
||||
|
||||
```elixir
|
||||
iex> sum = fn (a, b) -> a + b end
|
||||
iex> sum.(2, 3)
|
||||
5
|
||||
```
|
||||
|
||||
可以使用 & 语法来简化匿名函数的定义:
|
||||
|
||||
```elixir
|
||||
iex> sum = &(&1 + &2)
|
||||
iex> sum.(2, 3)
|
||||
5
|
||||
```
|
||||
|
||||
### 闭包
|
||||
|
||||
匿名函数去引用外部的变量,这通常被称为闭包。
|
||||
|
||||
```elixir
|
||||
iex> double = fn a -> add.(a, a) end
|
||||
#Function<6.71889879/1 in :erl_eval.expr/5>
|
||||
double.(2)
|
||||
4
|
||||
```
|
||||
|
||||
闭包与守卫
|
||||
|
||||
```elixir
|
||||
iex> f = fn
|
||||
x, y when x > 0 -> x + y
|
||||
x, y -> x * y
|
||||
end
|
||||
|
||||
iex> f.(1, 3)
|
||||
4
|
||||
iex> f.(-1, 3)
|
||||
-3
|
||||
```
|
||||
|
||||
### 命名函数
|
||||
|
||||
命名函数是通过 def 关键字定义在某个模块中
|
||||
|
||||
```elixir
|
||||
defmodule Greeter do
|
||||
def hello(name) do
|
||||
"Hello, " <> name
|
||||
end
|
||||
end
|
||||
|
||||
iex> Greeter.hello("Sean")
|
||||
"Hello, Sean"
|
||||
```
|
||||
|
||||
简写为一行:
|
||||
|
||||
```elixir
|
||||
defmodule Greeter do
|
||||
def hello(name), do: "Hello, " <> name
|
||||
end
|
||||
```
|
||||
|
||||
私有函数
|
||||
|
||||
```elixir
|
||||
defmodule Greeter do
|
||||
def hello(name), do: phrase <> name
|
||||
# 使用defp来定义私有函数
|
||||
defp phrase, do: "Hello, "
|
||||
end
|
||||
```
|
||||
|
||||
函数的默认参数:使用 `\\` 来定义默认参数
|
||||
|
||||
```elixir
|
||||
defmodule Greeter do
|
||||
def hello(name, language_code \\ "en") do
|
||||
phrase(language_code) <> name
|
||||
end
|
||||
|
||||
defp phrase("en"), do: "Hello, "
|
||||
defp phrase("es"), do: "Hola, "
|
||||
end
|
||||
```
|
||||
|
||||
Enumerables 与 Streams
|
||||
------
|
||||
>
|
||||
> Elixir 提供了 Enum 和 Stream 两个模块,用于处理集合。
|
||||
>
|
||||
### Enum
|
||||
>
|
||||
> Enum 模块提供了对集合的常用操作,如 map、filter、reduce、sort、chunk、join、into 等。
|
||||
|
||||
```elixir
|
||||
iex> Enum.map([1, 2, 3], fn x -> x * 2 end)
|
||||
[2, 4, 6]
|
||||
iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
|
||||
[2, 12]
|
||||
```
|
||||
|
||||
### Stream
|
||||
>
|
||||
> 作为Enum的替代品,Elixir提供了支持懒惰操作的Stream模块
|
||||
|
||||
```elixir
|
||||
iex> 1..100_000 |> Stream.map(&(&1 * 3)) |> Stream.filter(odd?) |> Enum.sum()
|
||||
7500000000
|
||||
```
|
||||
|
||||
> 流文件操作
|
||||
|
||||
```elixir
|
||||
iex> stream = File.stream!("path/to/file")
|
||||
%File.Stream{
|
||||
line_or_bytes: :line,
|
||||
modes: [:raw, :read_ahead, :binary],
|
||||
path: "path/to/file",
|
||||
raw: true
|
||||
}
|
||||
Enum.take(stream, 10)
|
||||
|
||||
# 上面的例子将提取所选文件的前10行。这意味着流对于处理大型文件甚至是网络资源等慢速资源非常有用。
|
||||
```
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
- [Elixir 官方](https://elixir-lang.org/) _(elixir-lang.org)_
|
||||
- [Elixir School](https://elixirschool.com/) _(elixirschool.com)_
|
||||
@@ -78,9 +78,9 @@ $ emacs
|
||||
:- | :-
|
||||
:- | :-
|
||||
`C-g` | 中止部分键入或执行的命令
|
||||
`M-x` 恢复会话 | 恢复因系统崩溃而丢失的文件
|
||||
`M-x` recover-session | 恢复因系统崩溃而丢失的文件
|
||||
`C-x` `u` `C-_` `C-/` | 撤消不需要的更改
|
||||
`M-x` 恢复缓冲器 | 将缓冲区恢复到其原始内容
|
||||
`M-x` revert-buffer | 将缓冲区恢复到其原始内容
|
||||
`C-l` | 重绘垃圾屏幕
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
@@ -293,9 +293,9 @@ $ emacs
|
||||
:- | :-
|
||||
`M-.` | 查找标签(定义)
|
||||
`C-u` `M-.` | 查找标签的下一个出现
|
||||
`M-x` 访问标签表 | 指定一个新的标签文件
|
||||
`M-x` 标签搜索 | 正则表达式搜索标签表中的所有文件
|
||||
`M-x` 标签查询替换 | 对所有文件运行查询替换
|
||||
`M-x` visit-tags-table | 指定一个新的标签文件
|
||||
`M-x` tags-search | 正则表达式搜索标签表中的所有文件
|
||||
`M-x` tags-query-replace | 对所有文件运行查询替换
|
||||
`M-,` | 继续最后一个标签搜索或查询替换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
@@ -494,9 +494,9 @@ Emacs 搜索
|
||||
:- | :-
|
||||
:- | :-
|
||||
`M-$` | 检查当前单词的拼写
|
||||
`M-x` ispell 地区 | 检查区域内所有单词的拼写
|
||||
`M-x` ispell 缓冲区 | 检查整个缓冲区的拼写
|
||||
`M-x` flyspell 模式 | 切换即时拼写检查
|
||||
`M-x` ispell-region | 检查区域内所有单词的拼写
|
||||
`M-x` ispell-buffer | 检查整个缓冲区的拼写
|
||||
`M-x` flyspell-mode | 切换即时拼写检查
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 编写命令
|
||||
|
||||
352
docs/fastapi.md
@@ -1,11 +1,39 @@
|
||||
FastAPI 备忘清单
|
||||
===
|
||||
|
||||
FastAPI 是一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.6+ 并基于标准的 Python 类型提示。Python: `3.9.5` FastAPI: `0.103.1`
|
||||
一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.6+ 并基于标准的 Python 类型提示
|
||||
|
||||
入门
|
||||
---
|
||||
<!--rehype:body-class=cols-1-->
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 安装 FastAPI
|
||||
|
||||
```shell
|
||||
$ pip install "fastapi[all]"
|
||||
```
|
||||
|
||||
#### 可以分开来安装
|
||||
|
||||
假如你想将应用程序部署到生产环境,你可能要执行以下操作:
|
||||
|
||||
```shell
|
||||
$ pip install fastapi
|
||||
```
|
||||
|
||||
并且安装 `uvicorn` 来作为服务器:
|
||||
|
||||
```shell
|
||||
$ pip install "uvicorn[standard]"
|
||||
```
|
||||
|
||||
#### 运行代码
|
||||
|
||||
```shell
|
||||
$ uvicorn main:app --reload
|
||||
```
|
||||
|
||||
Python: `3.9.5` FastAPI: `0.103.1`
|
||||
|
||||
### 最小程序
|
||||
|
||||
@@ -16,7 +44,11 @@ from fastapi import FastAPI
|
||||
import uvicorn
|
||||
|
||||
app = FastAPI()
|
||||
```
|
||||
|
||||
添加一个 API 的示例
|
||||
|
||||
```python
|
||||
# http://127.0.0.1:8000/
|
||||
@app.get("/")
|
||||
async def root():
|
||||
@@ -65,12 +97,14 @@ async def read_item(file_path):
|
||||
```
|
||||
|
||||
### 查询参数
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
#### 带默认值的查询参数
|
||||
|
||||
```python
|
||||
# http://127.0.0.1:8000/items/?skip=0&limit=2
|
||||
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
|
||||
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}]
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_item(skip: int = 0, limit: int = 10):
|
||||
return fake_items_db[skip: skip + limit]
|
||||
@@ -81,6 +115,7 @@ async def read_item(skip: int = 0, limit: int = 10):
|
||||
```python
|
||||
# http://127.0.0.1:8000/items/1?q=admin
|
||||
from typing import Union
|
||||
|
||||
@app.get("/items/{item_id}")
|
||||
async def read_item(item_id: str, q: Union[str, None] = None):
|
||||
if q:
|
||||
@@ -96,14 +131,17 @@ async def read_item(item_id: str, q: Union[str, None] = None):
|
||||
# http://127.0.0.1:8000/users/1/items/2?q=query&short=true
|
||||
@app.get("/users/{user_id}/items/{item_id}")
|
||||
async def read_user_item(
|
||||
user_id: int, item_id: str, q: Union[str, None] = None, short: bool = False
|
||||
user_id: int,
|
||||
item_id: str,
|
||||
q: Union[str, None] = None,
|
||||
short: bool = False
|
||||
):
|
||||
item = {"item_id": item_id, "owner_id": user_id}
|
||||
if q:
|
||||
item.update({"q": q})
|
||||
if not short:
|
||||
item.update(
|
||||
{"description": "This is an amazing item that has a long description"}
|
||||
{"description": "这是一个令人惊叹的项目,有很长的描述"}
|
||||
)
|
||||
return item
|
||||
```
|
||||
@@ -123,11 +161,13 @@ async def read_user_item(item_id: str, needy: str):
|
||||
```python
|
||||
from pydantic import BaseModel
|
||||
from typing import Union
|
||||
|
||||
class Item(BaseModel):
|
||||
name: str = '小明'
|
||||
description: Union[str, None] = None
|
||||
price: float
|
||||
tax: Union[float, None] = None
|
||||
|
||||
@app.post("/items/")
|
||||
async def create_item(item: Item):
|
||||
print(item.name)
|
||||
@@ -153,8 +193,11 @@ curl -X 'POST' \
|
||||
|
||||
```python
|
||||
from fastapi import Query
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(q: Union[str, None] = Query(default=None, max_length=50)):
|
||||
async def read_items(
|
||||
q: Union[str, None] = Query(default=None, max_length=50)
|
||||
):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
results.update({"q": q})
|
||||
@@ -165,26 +208,28 @@ async def read_items(q: Union[str, None] = Query(default=None, max_length=50)):
|
||||
|
||||
| 参数 | 含义 | 类型 |
|
||||
| ---------- | ------------ | ------------- |
|
||||
| default | 默认值 | 任意类型或... |
|
||||
| max_length | 最大长度 | int |
|
||||
| min_length | 最小长度 | int |
|
||||
| pattern | 正则匹配 | string |
|
||||
| alias | 别名参数 | string |
|
||||
| deprecated | 准备弃用参数 | bool |
|
||||
| `default` | 默认值 | 任意类型或... |
|
||||
| `max_length` | 最大长度 | `int` |
|
||||
| `min_length` | 最小长度 | `int` |
|
||||
| `pattern` | 正则匹配 | `string` |
|
||||
| `alias` | 别名参数 | `string` |
|
||||
| `deprecated` | 准备弃用参数 | `bool` |
|
||||
|
||||
#### 多个相同的查询参数
|
||||
|
||||
```python
|
||||
# http://127.0.0.1:8000/items/?q=foo&q=bar
|
||||
@app.get("/items/")
|
||||
async def read_items(q: Union[List[str], None] = Query(default=None)):
|
||||
async def read_items(
|
||||
q: Union[List[str], None] = Query(default=None)
|
||||
):
|
||||
query_items = {"q": q}
|
||||
return query_items
|
||||
```
|
||||
|
||||
### 路径参数和数值校验
|
||||
|
||||
Path用法基本和Query相同,参考:[FastAPI官方文档](https://fastapi.tiangolo.com/zh/tutorial/path-params-numeric-validations/)
|
||||
Path 用法基本和 Query 相同,参考:[FastAPI官方文档](https://fastapi.tiangolo.com/zh/tutorial/path-params-numeric-validations/)
|
||||
|
||||
#### 导入 Path
|
||||
|
||||
@@ -198,8 +243,8 @@ from typing_extensions import Annotated
|
||||
```python
|
||||
@app.get("/items/{item_id}")
|
||||
async def read_items(
|
||||
item_id: Annotated[int, Path(title="The ID of the item to get")],
|
||||
q: Annotated[Union[str, None], Query(alias="item-query")] = None,
|
||||
item_id: Annotated[int, Path(title="要获取的项目的 ID")],
|
||||
q: Annotated[str | None, Query(alias="item-query")] = None,
|
||||
):
|
||||
results = {"item_id": item_id}
|
||||
if q:
|
||||
@@ -211,23 +256,26 @@ async def read_items(
|
||||
|
||||
| 参数 | 含义 | 类型 |
|
||||
| ----- | ------------------- | --------- |
|
||||
| ... | 和Query具有相同参数 | ... |
|
||||
| ge | 大于等于 | int float |
|
||||
| gt | 大于 | int float |
|
||||
| le | 小于等于 | int float |
|
||||
| le | 小于等于 | int float |
|
||||
| title | api文档的标题 | string |
|
||||
| `...` | 和 Query 具有相同参数 | ... |
|
||||
| `ge` | 大于等于 | `int float` |
|
||||
| `gt` | 大于 | `int float` |
|
||||
| `le` | 小于等于 | `int float` |
|
||||
| `le` | 小于等于 | `int float` |
|
||||
| `title` | api文档的标题 | `string` |
|
||||
|
||||
### 其他参数
|
||||
|
||||
都具有Query的参数,max_length、min_length等
|
||||
都具有 `Query` 的参数,`max_length`、`min_length` 等
|
||||
|
||||
#### Cookie参数
|
||||
|
||||
```python
|
||||
from fastapi import Cookie
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None):
|
||||
async def read_items(
|
||||
ads_id: Annotated[Union[str, None], Cookie()] = None
|
||||
):
|
||||
return {"ads_id": ads_id}
|
||||
```
|
||||
|
||||
@@ -235,8 +283,12 @@ async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None):
|
||||
|
||||
```python
|
||||
from fastapi import Header
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(user_agent: Annotated[Union[str, None], Header()] = None,items_id: Annotated[Union[int, None], Header(ge=1)] = None):
|
||||
async def read_items(
|
||||
user_agent: Annotated[Union[str, None], Header()] = None,
|
||||
items_id: Annotated[Union[int, None], Header(ge=1)] = None
|
||||
):
|
||||
return {"User-Agent": user_agent, "items_id": items_id}
|
||||
```
|
||||
|
||||
@@ -246,7 +298,9 @@ async def read_items(user_agent: Annotated[Union[str, None], Header()] = None,it
|
||||
|
||||
#### 安装
|
||||
|
||||
`pip install python-multipart`
|
||||
```shell
|
||||
$ pip install python-multipart
|
||||
```
|
||||
|
||||
#### HTML
|
||||
|
||||
@@ -282,14 +336,17 @@ if __name__ == '__main__':
|
||||
```
|
||||
|
||||
### 文件上传
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```python
|
||||
from fastapi import FastAPI, UploadFile
|
||||
from fastapi.responses import HTMLResponse
|
||||
|
||||
@app.post("/uploadfile/")
|
||||
async def create_upload_file(file: UploadFile):
|
||||
print(file.file.read().decode())
|
||||
return {"filenames": file.filename, "type": str(type(file.file))}
|
||||
|
||||
@app.get("/")
|
||||
async def main():
|
||||
content = """<body>
|
||||
@@ -301,27 +358,28 @@ async def main():
|
||||
return HTMLResponse(content=content)
|
||||
```
|
||||
|
||||
#### UploadFile属性
|
||||
#### UploadFile 属性
|
||||
|
||||
| 属性名 | 含义 | 返回 |
|
||||
| ------------ | -------- | --------------------------------------- |
|
||||
| filename | 文件名 | 上传的文件名 |
|
||||
| content_type | 内容类型 | MIME 类型 |
|
||||
| file | 文件 | SpooledTemporaryFile具有read,write方法 |
|
||||
| `filename` | 文件名 | 上传的文件名 |
|
||||
| `content_type` | 内容类型 | `MIME` 类型 |
|
||||
| `file` | 文件 | SpooledTemporaryFile 具有 `read`,`write` 方法 |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
#### UploadFile async方法
|
||||
#### UploadFile async 方法
|
||||
|
||||
| 方法名 | 含义 |
|
||||
| ------------ | ----------------------------------------- |
|
||||
| write(data) | 把 `data` 写入文件 |
|
||||
| read(size) | 按指定数量的字节读取文件内容 |
|
||||
| seek(offset) | 移动至文件 `offset` (`int`)字节处的位置 |
|
||||
| close() | 关闭文件 |
|
||||
| `write(data)` | 把 `data` 写入文件 |
|
||||
| `read(size)` | 按指定数量的字节读取文件内容 |
|
||||
| `seek(offset)` | 移动至文件 `offset` (`int`)字节处的位置 |
|
||||
| `close()` | 关闭文件 |
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
依赖项
|
||||
---
|
||||
|
||||
<!--rehype:body-class=cols-1-->
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 依赖项使用场景
|
||||
|
||||
@@ -331,6 +389,7 @@ async def main():
|
||||
- 等……
|
||||
|
||||
### 创建依赖项
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```python
|
||||
from typing import Union
|
||||
@@ -338,22 +397,31 @@ from typing import Union
|
||||
from fastapi import Depends, FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
```
|
||||
|
||||
# read_items和read_users方法依赖common_parameters
|
||||
# 白话就是read_items和read_users都需要q,skip,limit查询参数
|
||||
`read_items` 和 `read_users` 方法依赖 `common_parameters`
|
||||
白话就是 `read_items` 和 `read_users` 都需要 `q`,`skip`,`limit` 查询参数
|
||||
|
||||
```python
|
||||
async def common_parameters(
|
||||
q: Union[str, None] = None, skip: int = 0, limit: int = 100
|
||||
q: Union[str, None] = None,
|
||||
skip: int = 0,
|
||||
limit: int = 100
|
||||
):
|
||||
return {"q": q, "skip": skip, "limit": limit}
|
||||
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(commons: dict = Depends(common_parameters)):
|
||||
async def read_items(
|
||||
commons: dict = Depends(common_parameters)
|
||||
):
|
||||
return commons
|
||||
|
||||
|
||||
@app.get("/users/")
|
||||
async def read_users(commons: dict = Depends(common_parameters)):
|
||||
async def read_users(
|
||||
commons: dict = Depends(common_parameters)
|
||||
):
|
||||
return commons
|
||||
```
|
||||
|
||||
@@ -361,60 +429,66 @@ async def read_users(commons: dict = Depends(common_parameters)):
|
||||
|
||||
```python
|
||||
from typing import Union
|
||||
|
||||
from fastapi import Depends, FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
|
||||
|
||||
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}]
|
||||
|
||||
class CommonQueryParams:
|
||||
def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100):
|
||||
def __init__(
|
||||
self,
|
||||
q: Union[str, None] = None,
|
||||
skip: int = 0,
|
||||
limit: int = 100
|
||||
):
|
||||
self.q = q
|
||||
self.skip = skip
|
||||
self.limit = limit
|
||||
```
|
||||
|
||||
# read_itemsx接收一个commons参数,类型是CommonQueryParams
|
||||
# CommonQueryParams接收三个参数,这三个参数是调用api的时候传
|
||||
`read_itemsx` 接收一个 `commons` 参数,类型是 `CommonQueryParams`
|
||||
`CommonQueryParams` 接收三个参数,这三个参数是调用 api 的时候传
|
||||
|
||||
```python
|
||||
@app.get("/items/")
|
||||
async def read_items(commons: CommonQueryParams = Depends(CommonQueryParams)):
|
||||
response = {}
|
||||
if commons.q:
|
||||
response.update({"q": commons.q})
|
||||
items = fake_items_db[commons.skip : commons.skip + commons.limit]
|
||||
response.update({"items": items})
|
||||
return response
|
||||
async def read_items(
|
||||
commons: CommonQueryParams = Depends(CommonQueryParams)
|
||||
):
|
||||
response = {}
|
||||
if commons.q:
|
||||
response.update({"q": commons.q})
|
||||
items = fake_items_db[commons.skip : commons.skip + commons.limit]
|
||||
response.update({"items": items})
|
||||
return response
|
||||
```
|
||||
|
||||
#### 还可以简写
|
||||
|
||||
```python
|
||||
@app.get("/items/")
|
||||
async def read_items(commons: CommonQueryParams = Depends()): # 这里的Depends没有传参,FastAPI会自动使用CommonQueryParams
|
||||
response = {}
|
||||
if commons.q:
|
||||
response.update({"q": commons.q})
|
||||
items = fake_items_db[commons.skip : commons.skip + commons.limit]
|
||||
response.update({"items": items})
|
||||
return response
|
||||
async def read_items(
|
||||
# 这里的 Depends 没有传参,FastAPI 会自动使用 CommonQueryParams
|
||||
commons: CommonQueryParams = Depends()
|
||||
):
|
||||
response = {}
|
||||
if commons.q:
|
||||
response.update({"q": commons.q})
|
||||
items = fake_items_db[commons.skip : commons.skip + commons.limit]
|
||||
response.update({"items": items})
|
||||
return response
|
||||
```
|
||||
|
||||
### 子依赖项
|
||||
|
||||
```python
|
||||
from typing import Union
|
||||
|
||||
from fastapi import Cookie, Depends, FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
def query_extractor(q: Union[str, None] = None):
|
||||
return q
|
||||
|
||||
|
||||
def query_or_cookie_extractor(
|
||||
q: str = Depends(query_extractor),
|
||||
last_query: Union[str, None] = Cookie(default=None),
|
||||
@@ -427,20 +501,25 @@ def query_or_cookie_extractor(
|
||||
# query_or_cookie_extractor函数又依赖query_extractor函数
|
||||
# 就是说依赖项可以依赖其他依赖项,只要你不晕,可以无数次套娃
|
||||
@app.get("/items/")
|
||||
async def read_query(query_or_default: str = Depends(query_or_cookie_extractor)):
|
||||
async def read_query(
|
||||
query_or_default: str = Depends(query_or_cookie_extractor)
|
||||
):
|
||||
return {"q_or_cookie": query_or_default}
|
||||
```
|
||||
|
||||
#### 不使用缓存
|
||||
|
||||
使用 `use_cache = False` 参数不使用缓存数据,不使用 `use_cache = False`,`value` 和 `value1` 是一样的
|
||||
|
||||
```python
|
||||
# 使用use_cache = False参数不使用缓存数据
|
||||
# 不使用use_cache = False,value和value1是一样的
|
||||
def result_value():
|
||||
value = randint(1, 99)
|
||||
return value
|
||||
|
||||
def get_value(value: int = Depends(result_value, use_cache=False), value1: int = Depends(result_value, use_cache=False)):
|
||||
def get_value(
|
||||
value: int = Depends(result_value, use_cache=False),
|
||||
value1: int = Depends(result_value, use_cache=False)
|
||||
):
|
||||
return value, value1
|
||||
|
||||
@app.get('/value/')
|
||||
@@ -453,26 +532,27 @@ async def needy_dependency(value: tuple = Depends(get_value)):
|
||||
```python
|
||||
from fastapi import Depends, FastAPI, Header, HTTPException
|
||||
|
||||
|
||||
async def verify_token(x_token: str = Header()):
|
||||
if x_token != "fake-super-secret-token":
|
||||
raise HTTPException(status_code=400, detail="X-Token header invalid")
|
||||
|
||||
if x_token != "fake-super-secret-token":
|
||||
raise HTTPException(status_code=400, detail="X-Token 标头无效")
|
||||
|
||||
async def verify_key(x_key: str = Header()):
|
||||
if x_key != "fake-super-secret-key":
|
||||
raise HTTPException(status_code=400, detail="X-Key header invalid")
|
||||
return x_key
|
||||
if x_key != "fake-super-secret-key":
|
||||
raise HTTPException(status_code=400, detail="X-Key 标头无效")
|
||||
return x_key
|
||||
```
|
||||
|
||||
# 全局依赖项很有用,后面的安全性就可以使用全局依赖项
|
||||
app = FastAPI(dependencies=[Depends(verify_token), Depends(verify_key)])
|
||||
全局依赖项很有用,后面的安全性就可以使用全局依赖项
|
||||
|
||||
```python
|
||||
app = FastAPI(
|
||||
dependencies=[Depends(verify_token), Depends(verify_key)]
|
||||
)
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items():
|
||||
return [{"item": "Portal Gun"}, {"item": "Plumbus"}]
|
||||
|
||||
|
||||
@app.get("/users/")
|
||||
async def read_users():
|
||||
return [{"username": "Rick"}, {"username": "Morty"}]
|
||||
@@ -481,6 +561,116 @@ async def read_users():
|
||||
安全性
|
||||
---
|
||||
|
||||
### 基于 Token 的认证
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```python
|
||||
from fastapi import FastAPI, Depends, HTTPException
|
||||
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
|
||||
from pydantic import BaseModel
|
||||
|
||||
app = FastAPI()
|
||||
```
|
||||
|
||||
使用 OAuth2PasswordBearer 创建一个 token 依赖
|
||||
|
||||
```python
|
||||
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
|
||||
```
|
||||
|
||||
假设这是你的用户数据库
|
||||
|
||||
```python
|
||||
fake_users_db = {
|
||||
"johndoe": {
|
||||
"username": "johndoe",
|
||||
"full_name": "John Doe",
|
||||
"email": "johndoe@example.com",
|
||||
"hashed_password": "fakehashedsecret",
|
||||
"disabled": False,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
创建一个用户模型
|
||||
|
||||
```python
|
||||
class User(BaseModel):
|
||||
username: str
|
||||
email: str
|
||||
full_name: str
|
||||
disabled: bool
|
||||
```
|
||||
|
||||
创建一个简单的认证函数
|
||||
|
||||
```python
|
||||
def fake_hash_password(password: str):
|
||||
return "fakehashed" + password
|
||||
|
||||
def get_user(db, username: str):
|
||||
if username in db:
|
||||
user_dict = db[username]
|
||||
return User(**user_dict)
|
||||
|
||||
def fake_decode_token(token: str):
|
||||
# 这个函数应该验证 token 并返回用户信息
|
||||
# 这里我们只是简单地返回了用户名
|
||||
return get_user(fake_users_db, token)
|
||||
```
|
||||
|
||||
创建一个依赖,用于从请求中获取 token 并验证用户
|
||||
|
||||
```python
|
||||
async def get_current_user(token: str = Depends(oauth2_scheme)):
|
||||
user = fake_decode_token(token)
|
||||
if not user:
|
||||
raise HTTPException(
|
||||
status_code=401,
|
||||
detail="Invalid authentication credentials",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
return user
|
||||
|
||||
@app.post("/token")
|
||||
async def login(form_data: OAuth2PasswordRequestForm = Depends()):
|
||||
user = get_user(fake_users_db, form_data.username)
|
||||
if not user or user.hashed_password != fake_hash_password(form_data.password):
|
||||
raise HTTPException(status_code=400, detail="Incorrect username or password")
|
||||
return {"access_token": user.username, "token_type": "bearer"}
|
||||
|
||||
@app.get("/users/me")
|
||||
async def read_users_me(current_user: User = Depends(get_current_user)):
|
||||
return current_user
|
||||
|
||||
```
|
||||
|
||||
使用 OAuth2PasswordBearer 来创建一个简单的 token 认证流程。
|
||||
|
||||
### HTTPS 和证书
|
||||
|
||||
```python
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
```
|
||||
|
||||
在生产环境中,你应该使用一个真正的证书和私钥,你可以从像 Let's Encrypt 这样的证书颁发机构获得免费的证书,或者使用 OpenSSL 生成自签名证书
|
||||
|
||||
```python
|
||||
@app.get("/https")
|
||||
async def read_https():
|
||||
return {"message": "Hello, HTTPS!"}
|
||||
```
|
||||
|
||||
启动服务器时,使用以下命令来指定证书和私钥:
|
||||
|
||||
```bash
|
||||
uvicorn main:app --host 0.0.0.0 --port 443 --ssl-keyfile /path/to/your/key.pem --ssl-certfile /path/to/your/cert.pem
|
||||
```
|
||||
|
||||
FastAPI 默认支持 HTTPS,你只需要提供证书和私钥即可。
|
||||
|
||||
待更新
|
||||
|
||||
参考
|
||||
|
||||
120
docs/feds.md
@@ -9,14 +9,14 @@ FED 前端导航
|
||||
[CSDN](https://www.csdn.net/)<!--rehype:target=_blank&style=background: rgb(252 85 49/var(\-\-bg\-opacity));-->
|
||||
[GitHub](https://github.com/)<!--rehype:target=_blank&style=background: rgb(0 0 0/var(\-\-bg\-opacity));-->
|
||||
[InfoQ](http://www.infoq.com/cn)<!--rehype:target=_blank&style=background: rgb(66 133 244/var(\-\-bg\-opacity));-->
|
||||
[Medium](https://medium.com/topic/technology)<!--rehype:target=_blank-->
|
||||
[Medium](https://medium.com/topic/technology)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[SegmentFault](https://segmentfault.com/)<!--rehype:target=_blank&style=background: rgb(0 150 94/var(\-\-bg\-opacity));-->
|
||||
[Stack Overflow](https://stackoverflow.com/)<!--rehype:target=_blank&style=background: rgb(244 130 37/var(\-\-bg\-opacity));-->
|
||||
[V2EX](https://www.v2ex.com/?tab=tech)<!--rehype:target=_blank&style=background: rgb(0 0 0/var(\-\-bg\-opacity));-->
|
||||
[博客园](https://www.cnblogs.com/)<!--rehype:target=_blank&style=background: rgb(46 122 203/var(\-\-bg\-opacity));-->
|
||||
[开源中国](https://www.oschina.net/)<!--rehype:target=_blank&style=background: rgb(43 179 81/var(\-\-bg\-opacity));-->
|
||||
[稀土掘金](https://juejin.im/)<!--rehype:target=_blank&style=background: rgb(30 128 255/var(\-\-bg\-opacity));-->
|
||||
[W3cplus](https://www.w3cplus.com/)<!--rehype:target=_blank-->
|
||||
[W3cplus](https://www.w3cplus.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
构建工具
|
||||
@@ -34,31 +34,32 @@ FED 前端导航
|
||||
[Turbopack](https://turbo.build/)<!--rehype:target=_blank&style=background: rgb(248 30 87/var(\-\-bg\-opacity));-->
|
||||
[Create React App](https://create-react-app.dev/)<!--rehype:target=_blank&style=background: rgb(60 106 146/var(\-\-bg\-opacity));-->
|
||||
[Browserify](http://browserify.org/)<!--rehype:target=_blank&style=background: rgb(60 106 146/var(\-\-bg\-opacity));-->
|
||||
[Yeoman](http://yeoman.io/)<!--rehype:target=_blank-->
|
||||
[Grunt](https://gruntjs.com/)<!--rehype:target=_blank-->
|
||||
[Yeoman](http://yeoman.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Grunt](https://gruntjs.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Babel](https://babeljs.io/)<!--rehype:target=_blank&style=background: rgb(245 218 85/var(\-\-bg\-opacity));-->
|
||||
[FIS3](https://fex-team.github.io/fis3/)<!--rehype:target=_blank-->
|
||||
[FIS3](https://fex-team.github.io/fis3/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
教程文档
|
||||
---
|
||||
|
||||
[MDN Web Docs](https://developer.mozilla.org/zh-CN/)<!--rehype:target=_blank&style=background: rgb(140 181 255/var(\-\-bg\-opacity));-->
|
||||
[ECMAScript 6 入门](https://es6.ruanyifeng.com/)<!--rehype:target=_blank-->
|
||||
[ECMAScript 6 入门](https://es6.ruanyifeng.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
JavaScript 工具
|
||||
---
|
||||
|
||||
[Chrome Dev Tools](https://www.google.cn/chrome/)<!--rehype:target=_blank-->
|
||||
[CoffeeScript](https://coffeescript.org/)<!--rehype:target=_blank-->
|
||||
[Firefox Developer Tools](https://www.mozilla.org/zh-CN/firefox/new/)<!--rehype:target=_blank-->
|
||||
[Chrome Dev Tools](https://www.google.cn/chrome/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CoffeeScript](https://coffeescript.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Firefox Developer Tools](https://www.mozilla.org/zh-CN/firefox/new/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[flow](https://flow.org/)<!--rehype:target=_blank&style=background: rgb(232 189 54/var(\-\-bg\-opacity));-->
|
||||
[TypeScript](https://www.typescriptlang.org/)<!--rehype:target=_blank&style=background: rgb(49 120 197/var(\-\-bg\-opacity));-->
|
||||
[JS 压缩,格式化](https://www.css-js.com/)<!--rehype:target=_blank-->
|
||||
[JS 压缩,格式化](https://www.css-js.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JSDoc](https://jsdoc.app/)<!--rehype:target=_blank&style=background: rgb(197 149 199/var(\-\-bg\-opacity));-->
|
||||
[UglifyJS](http://lisperator.net/uglifyjs/transform)<!--rehype:target=_blank-->
|
||||
[UglifyJS](http://lisperator.net/uglifyjs/transform)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Prettier](https://prettier.io/)<!--rehype:target=_blank&style=background: rgb(197 149 199/var(\-\-bg\-opacity));-->
|
||||
[Biome - JS 语言格式化](https://prettier.io/)<!--rehype:target=_blank&style=background: rgb(96 165 250/var(\-\-bg\-opacity));&class=contributing tag&data-lang=格式化-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
JavaScript 测试工具
|
||||
@@ -66,38 +67,39 @@ JavaScript 测试工具
|
||||
|
||||
[Chai](http://chaijs.com/)<!--rehype:target=_blank&style=background: rgb(164 8 1/var(\-\-bg\-opacity));-->
|
||||
[ESLint](https://eslint.org/)<!--rehype:target=_blank&style=background: rgb(76 50 195/var(\-\-bg\-opacity));-->
|
||||
[JSHint](http://jshint.com/)<!--rehype:target=_blank-->
|
||||
[JSHint](http://jshint.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Jasmine](https://jasmine.github.io/)<!--rehype:target=_blank&style=background: rgb(138 65 130/var(\-\-bg\-opacity));-->
|
||||
[Jest](https://jestjs.io/)<!--rehype:target=_blank&style=background: rgb(158 79 101/var(\-\-bg\-opacity));-->
|
||||
[Mochajs](https://mochajs.org/)<!--rehype:target=_blank&style=background: rgb(141 103 72/var(\-\-bg\-opacity));-->
|
||||
[Oxc - 比 ESLint 快 100 倍](https://oxc-project.github.io)<!--rehype:target=_blank&style=background: rgb(57 172 167/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
CSS 工具
|
||||
---
|
||||
|
||||
[30秒CSS](https://www.30secondsofcode.org/css/)<!--rehype:target=_blank-->
|
||||
[Autoprefixer](https://github.com/postcss/autoprefixer)<!--rehype:target=_blank-->
|
||||
[ColorZilla](http://www.colorzilla.com/gradient-editor/)<!--rehype:target=_blank-->
|
||||
[CSS Protips](https://github.com/AllThingsSmitty/css-protips)<!--rehype:target=_blank-->
|
||||
[CSS3 Maker](http://www.css3maker.com/)<!--rehype:target=_blank-->
|
||||
[cssnano](http://cssnano.co/)<!--rehype:target=_blank-->
|
||||
[CSSPIN](https://webkul.github.io/csspin/)<!--rehype:target=_blank-->
|
||||
[CSSreference](https://cssreference.io/)<!--rehype:target=_blank-->
|
||||
[CSSTree](https://github.com/csstree/csstree)<!--rehype:target=_blank-->
|
||||
[CSS美化压缩](http://tool.css-js.com/)<!--rehype:target=_blank-->
|
||||
[Easing Functions Cheat Sheet](http://easings.net/zh-cn)<!--rehype:target=_blank-->
|
||||
[Emmet](https://www.emmet.io/)<!--rehype:target=_blank-->
|
||||
[est](http://ecomfe.github.io/est/)<!--rehype:target=_blank-->
|
||||
[Flex Layout Attribute](https://github.com/StefanKovac/flex-layout-attribute)<!--rehype:target=_blank-->
|
||||
[minireset.css](http://lesscss.org/)<!--rehype:target=_blank-->
|
||||
[Normalize.css](http://necolas.github.io/normalize.css/)<!--rehype:target=_blank-->
|
||||
[PostCSS](http://postcss.org/)<!--rehype:target=_blank-->
|
||||
[purifycss](https://github.com/purifycss/purifycss)<!--rehype:target=_blank-->
|
||||
[30秒CSS](https://www.30secondsofcode.org/css/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Autoprefixer](https://github.com/postcss/autoprefixer)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[ColorZilla](http://www.colorzilla.com/gradient-editor/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSS Protips](https://github.com/AllThingsSmitty/css-protips)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSS3 Maker](http://www.css3maker.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[cssnano](http://cssnano.co/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSSPIN](https://webkul.github.io/csspin/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSSreference](https://cssreference.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSSTree](https://github.com/csstree/csstree)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CSS美化压缩](http://tool.css-js.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Easing Functions Cheat Sheet](http://easings.net/zh-cn)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Emmet](https://www.emmet.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[est](http://ecomfe.github.io/est/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Flex Layout Attribute](https://github.com/StefanKovac/flex-layout-attribute)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[minireset.css](http://lesscss.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Normalize.css](http://necolas.github.io/normalize.css/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[PostCSS](http://postcss.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[purifycss](https://github.com/purifycss/purifycss)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Less](https://lesscss.org/)<!--rehype:target=_blank&style=background: rgb(36 74 121/var(\-\-bg\-opacity));-->
|
||||
[SASS](http://sass-lang.com/)<!--rehype:target=_blank&style=background: rgb(191 64 128/var(\-\-bg\-opacity));-->
|
||||
[Sprite Cow](http://www.spritecow.com/)<!--rehype:target=_blank-->
|
||||
[Sprite Cow](http://www.spritecow.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Stylus](http://stylus-lang.com/)<!--rehype:target=_blank&style=background: rgb(126 194 66/var(\-\-bg\-opacity));-->
|
||||
[Stylelint](https://stylelint.io/)<!--rehype:target=_blank-->
|
||||
[Stylelint](https://stylelint.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
框架类库
|
||||
@@ -106,49 +108,49 @@ CSS 工具
|
||||
[React](https://zh-hans.react.dev)<!--rehype:target=_blank&style=background: rgb(97 218 251/var(\-\-bg\-opacity));-->
|
||||
[Vue 中文](https://cn.vuejs.org/)<!--rehype:target=_blank&style=background: rgb(66 184 131/var(\-\-bg\-opacity));-->
|
||||
[Angular](https://angular.io/)<!--rehype:target=_blank&style=background: rgb(195 8 47/var(\-\-bg\-opacity));-->
|
||||
[jQuery](http://www.jquery123.com/)<!--rehype:target=_blank-->
|
||||
[jQuery](http://www.jquery123.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Bootstrap](https://getbootstrap.com/)<!--rehype:target=_blank&style=background: rgb(113 44 249/var(\-\-bg\-opacity));-->
|
||||
[React Native 中文](https://reactnative.cn/)<!--rehype:target=_blank&style=background: rgb(36 120 194/var(\-\-bg\-opacity));-->
|
||||
[Flutter](https://flutter.dev/)<!--rehype:target=_blank&style=background: rgb(35 104 215/var(\-\-bg\-opacity));-->
|
||||
[RxJs](http://reactivex.io/rxjs/)<!--rehype:target=_blank-->
|
||||
[RxJs](http://reactivex.io/rxjs/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[htmx](https://htmx.org/)<!--rehype:target=_blank&style=background: rgb(61 114 215/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
在线代码编辑器工具
|
||||
---
|
||||
|
||||
[CodePen](https://codepen.io/)<!--rehype:target=_blank-->
|
||||
[CodeSandbox](https://codesandbox.io/)<!--rehype:target=_blank-->
|
||||
[StackBlitz](https://stackblitz.com/)<!--rehype:target=_blank-->
|
||||
[esbuild](https://esbuild.github.io/)<!--rehype:target=_blank-->
|
||||
[JSFiddle](https://jsfiddle.net/)<!--rehype:target=_blank-->
|
||||
[Replit](https://replit.com/)<!--rehype:target=_blank-->
|
||||
[JSRUN.NET](https://jsrun.net/)<!--rehype:target=_blank-->
|
||||
[WebComponents.dev](https://webcomponents.dev/)<!--rehype:target=_blank-->
|
||||
[JS Bin](https://jsbin.com/)<!--rehype:target=_blank-->
|
||||
[RunKit](https://runkit.com/)<!--rehype:target=_blank-->
|
||||
[CodePen](https://codepen.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[CodeSandbox](https://codesandbox.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[StackBlitz](https://stackblitz.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[esbuild](https://esbuild.github.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JSFiddle](https://jsfiddle.net/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Replit](https://replit.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JSRUN.NET](https://jsrun.net/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[WebComponents.dev](https://webcomponents.dev/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[JS Bin](https://jsbin.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[RunKit](https://runkit.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
兼容、性能测试
|
||||
---
|
||||
|
||||
[Browser Sandbox](https://turbo.net/browsers)<!--rehype:target=_blank-->
|
||||
[Browserdiet](https://browserdiet.com/zh/)<!--rehype:target=_blank-->
|
||||
[browsershots](http://browsershots.org/)<!--rehype:target=_blank-->
|
||||
[BrowserStack](https://www.browserstack.com/)<!--rehype:target=_blank-->
|
||||
[Can I use](http://caniuse.com/)<!--rehype:target=_blank-->
|
||||
[httpstatus](https://httpstatus.io/)<!--rehype:target=_blank-->
|
||||
[Observatory](https://observatory.mozilla.org/)<!--rehype:target=_blank-->
|
||||
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/?hl=zh-CN)<!--rehype:target=_blank-->
|
||||
[Security Headers](https://securityheaders.com/)<!--rehype:target=_blank-->
|
||||
[Browser Sandbox](https://turbo.net/browsers)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Browserdiet](https://browserdiet.com/zh/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[browsershots](http://browsershots.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[BrowserStack](https://www.browserstack.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Can I use](http://caniuse.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[httpstatus](https://httpstatus.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Observatory](https://observatory.mozilla.org/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/?hl=zh-CN)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Security Headers](https://securityheaders.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
CDN
|
||||
---
|
||||
|
||||
[cdnjs](https://cdnjs.com/)<!--rehype:target=_blank-->
|
||||
[jsDelivr](https://www.jsdelivr.com/)<!--rehype:target=_blank-->
|
||||
[前端静态资源库](https://cdn.baomitu.com/)<!--rehype:target=_blank-->
|
||||
[UNPKG](https://unpkg.com/)<!--rehype:target=_blank-->
|
||||
[Statically](https://statically.io/)<!--rehype:target=_blank-->
|
||||
[raw.githack.com](http://raw.githack.com/)<!--rehype:target=_blank-->
|
||||
[cdnjs](https://cdnjs.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[jsDelivr](https://www.jsdelivr.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[UNPKG](https://unpkg.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[Statically](https://statically.io/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
[raw.githack.com](http://raw.githack.com/)<!--rehype:target=_blank&style=background: rgb(106 106 106/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
203
docs/figma.md
Normal file
@@ -0,0 +1,203 @@
|
||||
Figma 备忘清单
|
||||
===
|
||||
|
||||
Figma 中 119 个键盘快捷键的可视化备忘表
|
||||
|
||||
键盘快捷键
|
||||
---
|
||||
|
||||
### 基本操作
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `\` | 显示/隐藏界面
|
||||
`Ctrl` `C` | 选择颜色
|
||||
`Ctrl` `/` | 搜索菜单
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 工具
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`V` | 移动工具
|
||||
`F` | 框架工具
|
||||
`P` | 钢笔工具
|
||||
`Shift` `P` | 铅笔工具
|
||||
`T` | 文本工具
|
||||
`R` | 矩形工具
|
||||
`O` | 椭圆工具
|
||||
`L` | 线条工具
|
||||
`Shift` `L` | 箭头工具
|
||||
`C` | 添加/显示评论
|
||||
`Ctrl` `C` | 选择颜色
|
||||
`S` | 切片工具
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 视图
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Shift` `R` | 切换标尺
|
||||
`Ctrl` `Y` | 显示轮廓
|
||||
`Ctrl` `P` | 像素预览
|
||||
`Ctrl` `G` | 布局网格
|
||||
`Ctrl` `'` | 像素网格
|
||||
`Ctrl` `\` | 显示/隐藏界面
|
||||
`Ctrl` `Alt` `\` | 显示多人光标
|
||||
`Alt` `1` | 显示图层
|
||||
`Alt` `2` | 显示组件
|
||||
`Alt` `3` | 显示团队库
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 缩放
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Space` `(拖拽)` | 平移
|
||||
`+` | 放大
|
||||
`-` | 缩小
|
||||
`Shift` `0` | 缩放至100%
|
||||
`Shift` `1` | 缩放以适应
|
||||
`Shift` `2` | 缩放至选区
|
||||
`Shift` `N` | 缩放至上一帧
|
||||
`N` | 缩放至下一帧
|
||||
`PgUp` | 上一页
|
||||
`PgDown` | 下一页
|
||||
`Home` | 查找上一帧
|
||||
`End` | 查找下一帧
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 文本
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `B` | 加粗
|
||||
`Ctrl` `I` | 斜体
|
||||
`Ctrl` `U` | 下划线
|
||||
`Ctrl` `Shift` `V` | 粘贴并匹配样式
|
||||
`Ctrl` `Alt` `L` | 文本左对齐
|
||||
`Ctrl` `Alt` `T` | 文本居中对齐
|
||||
`Ctrl` `Alt` `R` | 文本右对齐
|
||||
`Ctrl` `Alt` `J` | 文本两端对齐
|
||||
`Ctrl` `Shift` `</>` | 调整字体大小
|
||||
`Alt` `,/.` | 调整字间距
|
||||
`Alt` `Shift` `</>` | 调整行高
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 形状
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`P` | 钢笔
|
||||
`Shift` `P` | 铅笔
|
||||
`B` | 填充桶(编辑形状时)
|
||||
`Ctrl` | 弯曲工具(编辑形状时)
|
||||
`Alt` `/` | 移除填充
|
||||
`/` | 移除描边
|
||||
`Shift` `X` | 交换填充和描边
|
||||
`Ctrl` `Shift` `O` | 描边轮廓
|
||||
`Ctrl` `E` | 扁平化选择
|
||||
`Ctrl` `J` | 连接选择(选择点后)
|
||||
`Ctrl` `Shift` `J` | 平滑连接选择(选择点后)
|
||||
`Shift` `Backspace` | 删除并修复选择(选择点后)
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 选择
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `A` | 全选
|
||||
`Ctrl` `Shift` `A` | 反向选择
|
||||
`Esc` | 取消选择
|
||||
`Ctrl` `(单击)` | 深度选择
|
||||
`Ctrl` `(右键单击)` | 选择图层菜单
|
||||
`Enter` | 选择子元素
|
||||
`Shift` `Enter` | 选择父元素
|
||||
`Tab` | 选择下一个同级元素
|
||||
`Shift` `Tab` | 选择上一个同级元素
|
||||
`Ctrl` `G` | 分组选择
|
||||
`Ctrl` `Shift` `G` | 取消分组选择
|
||||
`Ctrl` `Alt` `G` | 框架选择
|
||||
`Ctrl` `Shift` `H` | 显示/隐藏选择
|
||||
`Ctrl` `Shift` `L` | 锁定/解锁选择
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 光标
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Alt` | 测量到选择区域(指向时)
|
||||
`Alt` | 复制选择区域(移动时)
|
||||
`Ctrl` `(单击)` | 深度选择(点击时)
|
||||
`Ctrl` `(右键单击)` | 选择图层菜单(点击时)
|
||||
`Ctrl` `(拖动)` | 矩形内深度选择(拖动选择时)
|
||||
`Alt` | 从中心调整大小(调整大小时)
|
||||
`Shift` | 等比例调整大小(调整大小时)
|
||||
`Space` | 在调整大小时移动
|
||||
`Ctrl` | 忽略约束(仅限框架)
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 编辑
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `C` | 复制
|
||||
`Ctrl` `X` | 剪切
|
||||
`Ctrl` `V` | 粘贴
|
||||
`Ctrl` `Shift` `V` | 在选择上粘贴
|
||||
`Ctrl` `D` | 原地复制选择
|
||||
`Ctrl` `R` | 重命名选择
|
||||
`Ctrl` `Shift` `E` | 导出
|
||||
`Ctrl` `Alt` `C` | 复制属性
|
||||
`Ctrl` `Alt` `V` | 粘贴属性
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 变换
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Shift` `H` | 水平翻转
|
||||
`Shift` `V` | 垂直翻转
|
||||
`Ctrl` `M` | 用作蒙版
|
||||
`Enter` | 编辑形状或图像
|
||||
`Ctrl` `Shift` `K` | 放置图像
|
||||
`Alt` `(双击)` | 裁剪图像
|
||||
`1` | 将不透明度设置为 10%
|
||||
`5` | 将不透明度设置为 50%
|
||||
`0` | 将不透明度设置为 100%
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 排列
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `]` | 上移一层
|
||||
`Ctrl` `[` | 下移一层
|
||||
`Ctrl` `Alt` `]` | 移至顶层
|
||||
`Ctrl` `Alt` `[` | 移至底层
|
||||
`Alt` `A` | 左对齐
|
||||
`Alt` `D` | 右对齐
|
||||
`Alt` `W` | 顶部对齐
|
||||
`Alt` `S` | 底部对齐
|
||||
`Alt` `H` | 水平居中对齐
|
||||
`Alt` `V` | 垂直居中对齐
|
||||
`Ctrl` `Alt` `T` | 整理
|
||||
`Ctrl` `Alt` `H` | 分布水平间距
|
||||
`Ctrl` `Alt` `V` | 分布垂直间距
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 组件
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Alt` `2` | 显示组件
|
||||
`Ctrl` `Shift` `O` | 团队库
|
||||
`Ctrl` `Shift` `K` | 创建组件
|
||||
`Ctrl` `Shift` `B` | 分离实例
|
||||
`Alt` | 替换组件实例(从资源拖动时)
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
- [Figma 的键盘快捷键](https://help.figma.com/article/77-keyboard-shortcuts) _(help.figma.com)_
|
||||
93
docs/finder.md
Normal file
@@ -0,0 +1,93 @@
|
||||
Finder 备忘清单
|
||||
===
|
||||
|
||||
Finder 中 55 个键盘快捷键的可视化小抄。此应用程序是 macOS 的一部分。
|
||||
|
||||
键盘快捷键
|
||||
----
|
||||
<!--rehype:body-class=cols-4-->
|
||||
|
||||
### 修饰键符号
|
||||
<!--rehype:wrap-class=col-span-4-->
|
||||
|
||||
- `Command` (或 `Cmd`) ⌘
|
||||
- `Option` (或 `Alt`) ⌥
|
||||
- `Caps Lock` ⇪
|
||||
- `Shift` ⇧
|
||||
- `Control` (或 `Ctrl`) ⌃
|
||||
- `Fn` 🌐
|
||||
<!--rehype:className=cols-3-->
|
||||
|
||||
### Finder 快捷键
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `D` | 复制选定的文件
|
||||
`Cmd` `E` | 弹出选定的磁盘或卷
|
||||
`Cmd` `F` | 在Finder窗口中启动Spotlight搜索
|
||||
`Cmd` `I` | 显示选定文件的详细信息窗口
|
||||
`Cmd` `R` | 当在Finder中选择别名时,显示所选别名的原始文件
|
||||
`Cmd` `Shift` `C` | 打开计算机窗口
|
||||
`Cmd` `Shift` `D` | 打开桌面文件夹
|
||||
`Cmd` `Shift` `F` | 打开最近窗口,显示您最近查看或更改的所有文件
|
||||
`Cmd` `Shift` `G` | 打开前往文件夹窗口
|
||||
`Cmd` `Shift` `H` | 打开当前MacOS用户账户的主文件夹
|
||||
`Cmd` `Shift` `I` | 打开iCloud驱动器
|
||||
`Cmd` `Shift` `K` | 打开网络窗口
|
||||
`Cmd` `Opt` `L` | 打开下载文件夹
|
||||
`Cmd` `Shift` `N` | 创建新文件夹
|
||||
`Cmd` `Shift` `O` | 打开文档文件夹
|
||||
`Cmd` `Shift` `P` | 在Finder窗口中显示或隐藏预览窗格
|
||||
`Cmd` `Shift` `R` | 打开AirDrop窗口
|
||||
`Cmd` `Shift` `T` | 在Finder窗口中显示或隐藏选项卡栏
|
||||
`Ctrl` `Cmd` `Shift` `T` | 将选定的Finder项目添加到Dock
|
||||
`Cmd` `Shift` `U` | 打开实用工具文件夹
|
||||
`Cmd` `Opt` `D` | 显示或隐藏Dock
|
||||
`Cmd` `Ctrl` `T` | 将选定项目添加到侧边栏
|
||||
`Cmd` `Opt` `P` | 在Finder窗口中隐藏或显示路径栏
|
||||
`Cmd` `Opt` `S` | 在Finder窗口中隐藏或显示侧边栏
|
||||
`Cmd` `/` | 在Finder窗口中隐藏或显示状态栏
|
||||
`Cmd` `J` | 显示视图选项
|
||||
`Cmd` `K` | 打开连接到服务器窗口
|
||||
<!--rehype:className=shortcuts left-align-->
|
||||
|
||||
### Finder 快捷键
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `Ctrl` `A` | 制作所选项目的别名
|
||||
`Cmd` `N` | 打开新的Finder窗口
|
||||
`Cmd` `Opt` `N` | 创建新的智能文件夹
|
||||
`Cmd` `T` | 在当前Finder窗口中打开或隐藏选项卡栏
|
||||
`Cmd` `Opt` `T` | 在当前Finder窗口中打开或隐藏工具栏
|
||||
`Cmd` `Opt` `V` | 将剪贴板中文件从其原始位置移动到当前位置
|
||||
`Cmd` `Y` | 使用快速查看预览所选文件
|
||||
`Cmd` `Opt` `Y` | 查看所选文件的快速查看幻灯片
|
||||
`Cmd` `1` | 将Finder窗口中的项目以图标形式查看
|
||||
`Cmd` `2` | 将Finder窗口中的项目以列表形式查看
|
||||
`Cmd` `3` | 将Finder窗口中的项目以列形式查看
|
||||
`Cmd` `4` | 将Finder窗口中的项目以画廊形式查看
|
||||
`Cmd` `[` | 转到上一个文件夹
|
||||
`Cmd` `]` | 转到下一个文件夹
|
||||
`Cmd` `Up` | 打开包含当前文件夹的文件夹
|
||||
`Cmd` `Ctrl` `Up` | 在新窗口中打开包含当前文件夹的文件夹
|
||||
`Cmd` `Left` | 打开所选项目
|
||||
`Right` | 打开所选文件夹(仅在列表视图中有效)
|
||||
`Left` | 关闭所选文件夹(仅在列表视图中有效)
|
||||
`Cmd` `Del` | 将所选项目移至废纸篓
|
||||
`Cmd` `Shift` `Del` | 清空废纸篓
|
||||
`Cmd` `Opt` `Shift` `Del` | 无需确认对话框即可清空废纸篓
|
||||
`Cmd` `Bright-Down` | 在Mac连接到多个显示器时打开或关闭视频镜像
|
||||
`Cmd` `Bright-Up` | 打开显示首选项
|
||||
`Ctrl` `Bright` | 更改外部显示器的亮度(如果支持)
|
||||
`Opt` `Shift` `Bright` | 以较小步长调整显示亮度
|
||||
`Ctrl` `Down` | 显示前台应用程序的所有窗口
|
||||
`Opt` `Vol` | 打开声音首选项
|
||||
<!--rehype:className=shortcuts left-align-->
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
- [macOS Finder 的键盘快捷键](https://support.apple.com/en-us/HT201236) _(support.apple.com)_
|
||||
134
docs/ftp.md
Normal file
@@ -0,0 +1,134 @@
|
||||
ftp 备忘清单
|
||||
===
|
||||
|
||||
此 ftp 备忘清单包含命令和使用 ftp 脚本实现自动化的技巧示例。
|
||||
|
||||
入门
|
||||
----
|
||||
|
||||
### 介绍
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
- FTP 命令允许用户通过FTP(File Transfer Protocol)协议在本地计算机和远程服务器之间传输文件。
|
||||
- FTP 是一种在网络上交换文件的标准协议,是 ARPANet 的标准文件传输协议,ARPANet 网络就是现今 Internet 的前身。
|
||||
- 使用 FTP 协议时,一方充当客户端,另一方充当服务器,客户端可以上传、下载、删除、重命名文件和目录,以及执行其他文件传输相关的操作。
|
||||
|
||||
### 选项
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
```bash
|
||||
ftp -v ftp.example.com
|
||||
```
|
||||
|
||||
`-v`:启用或禁用详细模式。在详细模式下,`ftp`命令会显示所有来自服务器的响应消息。默认情况下,该选项为开启状态。
|
||||
|
||||
```bash
|
||||
ftp -d ftp.example.com
|
||||
```
|
||||
|
||||
`-d`:启用调试模式。该选项会显示所有FTP传输过程中发送和接收到的命令,有助于调试连接问题。
|
||||
|
||||
```bash
|
||||
ftp -n ftp.example.com
|
||||
```
|
||||
|
||||
`-n`:禁止自动登录。默认情况下,`ftp`命令会在连接到远程服务器后尝试自动登录。使用该选项可以禁止该行为,通常与`.netrc`文件联合使用。
|
||||
|
||||
```bash
|
||||
ftp -g ftp.example.com
|
||||
```
|
||||
|
||||
禁用文件名通配符扩展。`ftp`命令默认会展开文件名中的通配符。使用该选项可以关闭这一行为。
|
||||
|
||||
```bash
|
||||
ftp -p ftp.example.com
|
||||
```
|
||||
|
||||
`-p`:使用被动模式(PASV)进行数据连接。被动模式在客户端位于防火墙或NAT后面时非常有用。
|
||||
|
||||
```bash
|
||||
ftp -s:script.txt ftp.example.com # Windows
|
||||
ftp -n ftp.example.com < script # Linux
|
||||
```
|
||||
|
||||
:warning: Windows 上使用`-s`选项指定`script.txt`脚本执行 ftp 命令。Linux 上可以使用重定向实现。
|
||||
|
||||
### 目录操作
|
||||
|
||||
| 命令 | 描述 |
|
||||
| -------------------- | -------------------------- |
|
||||
| `cd` | 更改当前工作目录到指定目录 |
|
||||
| `ls`或`dir` | 列出当前目录下的内容 |
|
||||
| `pwd` | 显示当前目录的绝对路径 |
|
||||
| `mkdir` | 创建目录 |
|
||||
| `rmdir` | 删除一个目录 |
|
||||
| `rename <old> <new>` | 重命名一个目录 |
|
||||
|
||||
### 快速开始
|
||||
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
使用匿名模式访问远程 FTP 服务器
|
||||
|
||||
```bash
|
||||
ftp ftp.example.com
|
||||
```
|
||||
|
||||
ftp 会启动交互式命令行
|
||||
|
||||
```bash
|
||||
Connected to <host> (<ip address>).
|
||||
220 (vsFTPd 3.*)
|
||||
# 需要手动输入 anonymous
|
||||
Name (192.168.10.10:root): anonymous
|
||||
331 Please specify the password.
|
||||
Password: # 匿名模式下直接回车
|
||||
230 Login successful.
|
||||
Remote system type is UNIX.
|
||||
Using binary mode to transfer files.
|
||||
```
|
||||
|
||||
连接成功后进入交互式会话.
|
||||
|
||||
查看所有命令,使用 `helm` 或 `?`
|
||||
|
||||
```bash
|
||||
ftp> help
|
||||
# 或者
|
||||
ftp> ?
|
||||
```
|
||||
|
||||
### 文件操作
|
||||
|
||||
| 命令 | 描述 |
|
||||
| ---------------------- | -------------------- |
|
||||
| `get <remote> <local>` | 下载一个文件到本地 |
|
||||
| `mget` | 下载多个文件到本地 |
|
||||
| `put <local> <remote>` | 上传一个文件到服务器 |
|
||||
| `mput` | 上传多个文件到服务器 |
|
||||
| `delete <remote>` | 删除一个文件 |
|
||||
| `rename <old> <new>` | 重命名一个文件 |
|
||||
|
||||
脚本
|
||||
----
|
||||
|
||||
### 样例
|
||||
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
以匿名登录为例,将下列脚本代码放入文件 `script` 中:
|
||||
|
||||
```bash
|
||||
user anonymous "\n" # 匿名用户
|
||||
binary # 将文件传输模式设置为二进制模式,这对于非文本文件(如图片、压缩文件等)来说是必要的,以确保文件在传输过程中不会被更改。
|
||||
ls <dir> # 进入某个目录
|
||||
pwd # 输出当前路径
|
||||
quit # 退出 ftp 连接
|
||||
```
|
||||
|
||||
使用 `ftp` 命令执行脚本文件:
|
||||
|
||||
```bash
|
||||
ftp -n ftp.example.com < script # 使用 -n 选项禁止自动登录,这样会继续执行 user 指令,而不是启动交互式命令行。
|
||||
```
|
||||
28
docs/git.md
@@ -563,6 +563,34 @@ $ git fetch --all && git reset --hard origin/master
|
||||
$ git log Branch1 ^Branch2
|
||||
```
|
||||
|
||||
### git 迁移
|
||||
|
||||
- 从原地址克隆一份裸版本库
|
||||
|
||||
```bash
|
||||
$ git clone --bare https://github.com/username/project.git
|
||||
```
|
||||
|
||||
- 然后新建一个地址,比如一下
|
||||
|
||||
```bash
|
||||
$ https://gitee.com/username/newproject.git
|
||||
```
|
||||
|
||||
- 进入project.git这个全裸版本库,以镜像推送的方式上传代码到newproject上。
|
||||
|
||||
```
|
||||
$ cd project.git
|
||||
|
||||
$ git push --mirror https://gitee.com/username/newproject.git
|
||||
```
|
||||
|
||||
- 使用新地址,直接 Clone 到本地就可以了。
|
||||
|
||||
```
|
||||
$ git clone https://gitee.com/username/newproject.git
|
||||
```
|
||||
|
||||
Git Submodule 子模块
|
||||
------
|
||||
|
||||
|
||||
@@ -155,6 +155,27 @@ jobs:
|
||||
- run: echo ${{needs.job1.outputs.output1}} ${{needs.job1.outputs.output2}}
|
||||
```
|
||||
|
||||
### 定时触发
|
||||
|
||||
可以使用 cron 表达式配置周期性任务,定时执行
|
||||
|
||||
```yaml
|
||||
name: schedule task
|
||||
|
||||
# 要注意时差,最好手动指定时区
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
on:
|
||||
# push 到 main 分支时执行任务
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
# 每隔两小时自动执行任务
|
||||
schedule:
|
||||
- cron: '0 0/2 * * *'
|
||||
```
|
||||
|
||||
### 指定每项任务的虚拟机环境
|
||||
|
||||
```yml
|
||||
@@ -274,7 +295,7 @@ env:
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### Github 上下文
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
<!--rehype:wrap-class=col-span-2 row-span-3-->
|
||||
|
||||
属性名称 | 类型 | 描述
|
||||
---- | ---- | ----
|
||||
@@ -300,7 +321,49 @@ env:
|
||||
|
||||
[Github 上下文](https://help.github.com/cn/actions/reference/context-and-expression-syntax-for-github-actions)是访问有关工作流运行、运行器环境、作业和步骤的信息的一种方式
|
||||
|
||||
### 直接常量
|
||||
|
||||
作为表达式的一部分,可以使用 `boolean`, `null`, `number` 或 `string`数据类型
|
||||
|
||||
```yml
|
||||
env:
|
||||
myNull: ${{ null }}
|
||||
myBoolean: ${{ false }}
|
||||
myIntegerNumber: ${{ 711 }}
|
||||
myFloatNumber: ${{ -9.2 }}
|
||||
myHexNumber: ${{ 0xff }}
|
||||
myExponentialNumber: ${{ -2.99e-2 }}
|
||||
myString: Mona the Octocat
|
||||
myStringInBraces: ${{ 'It''s source!' }}
|
||||
```
|
||||
|
||||
### 函数 contains
|
||||
|
||||
使用字符串的示例
|
||||
|
||||
```js
|
||||
contains('Hello world', 'llo') // 返回 true
|
||||
```
|
||||
|
||||
使用对象过滤器的示例返回 true
|
||||
|
||||
```js
|
||||
contains(github.event.issue.labels.*.name, 'bug')
|
||||
```
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
另见: [函数 contains](https://docs.github.com/cn/actions/learn-github-actions/expressions#contains)
|
||||
|
||||
### 函数 startsWith
|
||||
|
||||
```js
|
||||
startsWith('Hello world', 'He') // 返回 true
|
||||
```
|
||||
|
||||
另见: [函数 startsWith](https://docs.github.com/cn/actions/learn-github-actions/expressions#startswith),此函数不区分大小写
|
||||
|
||||
### 默认环境变量
|
||||
<!--rehype:wrap-class=row-span-8 col-span-2-->
|
||||
|
||||
环境变量 | 描述
|
||||
---- | ----
|
||||
@@ -326,49 +389,6 @@ env:
|
||||
|
||||
另见: [默认环境变量](https://docs.github.com/cn/actions/learn-github-actions/environment-variables#default-environment-variables)
|
||||
|
||||
### 直接常量
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
作为表达式的一部分,可以使用 `boolean`, `null`, `number` 或 `string`数据类型
|
||||
|
||||
```yml
|
||||
env:
|
||||
myNull: ${{ null }}
|
||||
myBoolean: ${{ false }}
|
||||
myIntegerNumber: ${{ 711 }}
|
||||
myFloatNumber: ${{ -9.2 }}
|
||||
myHexNumber: ${{ 0xff }}
|
||||
myExponentialNumber: ${{ -2.99e-2 }}
|
||||
myString: Mona the Octocat
|
||||
myStringInBraces: ${{ 'It''s source!' }}
|
||||
```
|
||||
|
||||
### 函数 contains
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
使用字符串的示例
|
||||
|
||||
```js
|
||||
contains('Hello world', 'llo') // 返回 true
|
||||
```
|
||||
|
||||
使用对象过滤器的示例返回 true
|
||||
|
||||
```js
|
||||
contains(github.event.issue.labels.*.name, 'bug')
|
||||
```
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
另见: [函数 contains](https://docs.github.com/cn/actions/learn-github-actions/expressions#contains)
|
||||
|
||||
### 函数 startsWith
|
||||
|
||||
```js
|
||||
startsWith('Hello world', 'He') // 返回 true
|
||||
```
|
||||
|
||||
另见: [函数 startsWith](https://docs.github.com/cn/actions/learn-github-actions/expressions#startswith),此函数不区分大小写
|
||||
|
||||
### 函数 format
|
||||
|
||||
```js
|
||||
@@ -382,7 +402,7 @@ format('{{Hello {0} {1} {2}!}}', 'Mona', 'the', 'Octocat')
|
||||
### 函数 join
|
||||
|
||||
```js
|
||||
join(github.event.issue.labels.*.name, ', ')
|
||||
join(github.event.issue.labels.*.name,', ')
|
||||
// 也许返回 'bug, help wanted'.
|
||||
```
|
||||
|
||||
@@ -583,14 +603,15 @@ npm token revoke <id|token> # 撤销
|
||||
|
||||
Artifacts 是 GitHub Actions 为您提供持久文件并在运行完成后使用它们或在作业(文档)之间共享的一种方式。
|
||||
|
||||
要创建工件并使用它,您将需要不同的操作:上传和下载。
|
||||
- 要创建工件并使用它,您将需要不同的操作:上传和下载
|
||||
|
||||
要上传文件或目录,您只需像这样使用它:
|
||||
|
||||
```yml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: mkdir -p path/to/artifact
|
||||
- run: echo hello > path/to/artifact/a.txt
|
||||
- run: echo hello > path/to/file/a.txt
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: my-artifact
|
||||
|
||||
594
docs/github-copilot.md
Normal file
@@ -0,0 +1,594 @@
|
||||
Github Copilot 备忘清单
|
||||
===
|
||||
|
||||
这是开始使用 [Github Copilot](https://code.visualstudio.com/docs/editor/github-copilot) 的快速参考指南
|
||||
|
||||
一、准备工作
|
||||
----
|
||||
|
||||
### 1、账号注册
|
||||
|
||||
> 需要先拥有一个Github账号,并订阅Copilot。
|
||||
|
||||
事项 | 说明
|
||||
:-|-
|
||||
Github 账号 | [注册地址](https://github.com/signup)
|
||||
订阅 Github Copilot | [订阅地址](https://github.com/features/copilot)
|
||||
|
||||
### 2、安装Vscode插件
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
> 在扩展商店中搜索安装下面插件
|
||||
|
||||
插件名称 | 功能
|
||||
:-|-
|
||||
`GitHub Copilot`|编辑器中进行代码补全提示
|
||||
`GitHub Copilot Chat`|插件栏可以与copilot对话
|
||||
|
||||
### 3、Vscode 中登陆 Github 账号
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
- 安装后,点击右下角的 `GitHub Copilot` 插件图标,然后点击 `Sign in to GitHub` 登陆。
|
||||
- 或者,点击工具栏中的 `Accounts` 图标,然后点击 `使用 Github 登陆以使用Github Copilot` 进行登陆。
|
||||
|
||||
### 4、Copilot 订阅方案
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
方案 | 价格 | 特性
|
||||
:-|-|-
|
||||
Copilot Individual | 10美元/人/月 <br> (学生, 教师, 开源项目贡献者 免费) | 代码补全, 聊天机器人
|
||||
Copilot Business| 19美元/人/月 |代码补全, 聊天机器人, 命令行工具, 安全漏洞筛查, 代码参考, 公共代码筛查, 知识产权, 企业安全与隐私保障
|
||||
Copilot Enterprise| 39美元/人/月 | Business 特性 + 私有代码库的个性化聊天 + 文档搜索总结 + Git Pull Request 摘要 + 代码审查 + 模型微调
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### 5、Copilot 使用入口
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|名称 | 描述 |
|
||||
|-|-|
|
||||
Inline Suggestions| 在编辑器中紧邻光标所在位置显示建议
|
||||
Completions Panel| 在编辑器中展示完整的建议列表
|
||||
Inline Chat| 在编辑器中紧邻光标所在位置发起对话
|
||||
Editor Chat| 在编辑器中打开完整的对话界面
|
||||
Silde Chat| 在编辑器的侧边栏打开对话界面
|
||||
Quick Chat| 在顶部唤起对话界面
|
||||
|
||||
二、提示技巧
|
||||
----
|
||||
|
||||
### 提示之禅
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
> 你与 `copilot` 之间的关系,就是作家和插画师的关系。
|
||||
> 你只有尽可能的全面、干练、清晰的描述你的故事(即 `上下文`)。
|
||||
> `copilot` 才能根据你的故事画出精美的插画 (即 `代码` )。
|
||||
|
||||
### 提示技巧
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
- 1⃣️ 提供上下文信息
|
||||
- 2⃣️ 上下文可被预测
|
||||
|
||||
### 实战教程
|
||||
|
||||
- [Youtube GitHub Copilot Series](https://www.youtube.com/playlist?list=PLj6YeMhvp2S5_hvBl2SE-7YCHYlLQ0bPt)
|
||||
- [Pragmatic techniques to get the most out of GitHub Copilot](https://www.youtube.com/watch?v=CwAzIpc4AnA)
|
||||
- [How I used GitHub Copilot to build a browser extension](https://github.blog/2023-05-12-how-i-used-github-copilot-to-build-a-browser-extension/)
|
||||
|
||||
### 上下文信息的种类
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
|
||||
类型|说明
|
||||
-|-
|
||||
文件|Copilot会查看编辑器中当前和紧邻打开的文件。
|
||||
注释|Copilot会根据紧邻的注释,为你的代码提供帮助和建议。如 docstring, 块注释, 行注释之类。
|
||||
命名|良好的命名能帮助Copilot更好地理解你的代码,如函数名, 变量名, 文件名等
|
||||
代码|Copilot会查看你的代码和它附近的代码,以生成帮助你的建议。
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### 上下文:文件
|
||||
|
||||
> Copilot会查看编辑器中当前和紧邻打开的文件,以分析上下文并提供适当的建议。
|
||||
|
||||
---
|
||||
|
||||
> - 1、避免打开过多的文件,以便Copilot能够更好地理解你的代码。
|
||||
> - 2、打开的文件尽量相关且有共性。
|
||||
> - 3、如果是新项目,可以打开一些模版代码、数据文件以及参考文档等相关示例文件。以便Copilot能够更好地理解你的期望。等已经开发了一些代码后,这些示例文件就可以删除了。
|
||||
|
||||
### 上下文: 注释: 顶部注释
|
||||
|
||||
创建一个新文件时,在文件顶部添加注释,描述你的需求。这对 Copilot 很有帮助。
|
||||
|
||||
\* 下面说明将使用`...`表示copilot开始生成的位置
|
||||
|
||||
```python
|
||||
# Download file from an URL and analyze its content
|
||||
# Details:
|
||||
# * Download the file from an URL
|
||||
# * Save the downloaded files into `./download` folder
|
||||
# * Use `filetype` of the file to specify how to parse
|
||||
# * Filetype can be `.pdf`, `.html`, `.epub`, `.md` and `.txt`
|
||||
# * Use NLP or OCR to get the file content
|
||||
# * Tokenize the file content and get the statistics result
|
||||
|
||||
import ...
|
||||
```
|
||||
|
||||
### 上下文: 注释: 行内注释
|
||||
|
||||
在每个函数上面或重要代码块的上面添加注释,以帮助 Copilot 了解你代码中的一些意图或问题。
|
||||
|
||||
\* 下面说明将使用`...`表示copilot开始生成的位置
|
||||
|
||||
函数上方添加注释说明
|
||||
|
||||
```python
|
||||
# parse the JSON string into User object
|
||||
def ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
代码添加注释说明
|
||||
|
||||
```python
|
||||
# ...
|
||||
api_sever = FastApi(...)
|
||||
|
||||
# starting the API Sever, enable ssl, bind to 8443 port
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 注释: Docstring
|
||||
<!--rehype:wrap-class=col-span-1 row-span-2-->
|
||||
有时候当你已经拥有详细设计文档,但未编写功能代码时,可以直接使用 docstring 中的描述来让 copilot 生成代码。
|
||||
|
||||
```python
|
||||
def send_email(to_address: Email, subject: str, content: HTML): -> StatusCode:
|
||||
"""
|
||||
Send email to specified address
|
||||
|
||||
Parameters
|
||||
----------
|
||||
to_address : Email
|
||||
The email address to send to
|
||||
subject : str
|
||||
The email subject
|
||||
content : HTML
|
||||
The email content
|
||||
|
||||
Returns
|
||||
-------
|
||||
StatusCode
|
||||
The sending result
|
||||
"""
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 注释: 提问
|
||||
|
||||
> 如果你不想切换到 copilot chat 时,注释也可以用于提问。
|
||||
|
||||
```python
|
||||
# Q: What is the difference between `os.path.join` and `pathlib.PurePath`?
|
||||
# A: ...
|
||||
```
|
||||
|
||||
### 上下文: 注释: Todo
|
||||
|
||||
> 你也可以让 copilot 为你生成 `todo` 列表来评估工作量。
|
||||
|
||||
```python
|
||||
# Parse the json file into a Talks object
|
||||
# TODO:
|
||||
# -[ ] 1. ...
|
||||
```
|
||||
|
||||
### 上下文: 命名
|
||||
|
||||
> 你的命名应该足够明确以便于 Copilot 理解你的意图
|
||||
|
||||
#### bad case
|
||||
|
||||
```python
|
||||
a = 60
|
||||
|
||||
def send(dict):
|
||||
...
|
||||
|
||||
class data:
|
||||
...
|
||||
```
|
||||
|
||||
#### good case
|
||||
|
||||
```python
|
||||
timeout = 60
|
||||
|
||||
def send_email(to_address: Email, subject: str, content: HTML): -> StatusCode:
|
||||
...
|
||||
|
||||
class Email:
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 代码: 代码示例
|
||||
|
||||
> 提供片段代码示例,以帮助 Copilot 更好地开始新的开发任务。
|
||||
>
|
||||
> - 使用的框架与库
|
||||
> - 代码风格
|
||||
> - 算法逻辑
|
||||
|
||||
```python
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy import String
|
||||
from sqlalchemy.orm import DeclarativeBase
|
||||
from sqlalchemy.orm import Mapped
|
||||
from sqlalchemy.orm import mapped_column
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
class Base(DeclarativeBase):
|
||||
pass
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "user_account"
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
name: Mapped[str] = mapped_column(String(30))
|
||||
fullname: Mapped[Optional[str]]
|
||||
addresses: Mapped[List["Address"]] = relationship(
|
||||
back_populates="user", cascade="all, delete-orphan"
|
||||
)
|
||||
def __repr__(self) -> str:
|
||||
return f"User(id={self.id!r}, name={self.name!r}, fullname={self.fullname!r})"
|
||||
|
||||
# Email Address
|
||||
...
|
||||
```
|
||||
|
||||
### 上下文: 代码: 数据示例
|
||||
|
||||
> 提供片段数据示例,以帮助 Copilot 更好地开始新的开发任务。
|
||||
>
|
||||
> - 数据结构与类型
|
||||
> - 命名
|
||||
> - 值处理逻辑
|
||||
|
||||
```python
|
||||
|
||||
dailogs = [
|
||||
{
|
||||
"timestamp": "May 1, 2023 11:00:00",
|
||||
"text": "Hello, World!",
|
||||
"speaker": "Jack",
|
||||
},
|
||||
{
|
||||
"timestamp": "May 1, 2023 11:01:00",
|
||||
"text": "Hello, Copilot!",
|
||||
"speaker": "Copilot",
|
||||
},
|
||||
]
|
||||
|
||||
# Parse the json object into `Dialog` object
|
||||
...
|
||||
```
|
||||
|
||||
三、快捷键
|
||||
----
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
对于mac用户建议修改alt相关的快捷键,因为mac上的alt+字母键有可能被输入法使用了。若有自定义过输入法`keylayout`,则忽略这句话。
|
||||
|
||||
另外没有快捷键的命令,可以唤起`命令面板`后输入查询关键字筛选后执行。
|
||||
|
||||
### Github Copilot
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
|
||||
#### Copilot 中 Inline Suggestions 相关命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`editor.action.inlineSuggest.trigger`| 触发内联建议 | `alt+\` | `alt+\`
|
||||
`editor.action.inlineSuggest.showPrevious`| 显示上一个内联建议 | `alt+[`| `alt+[`
|
||||
`editor.action.inlineSuggest.showNext`| 显示下一个内联建议 | `alt+]`| `alt+]`
|
||||
`editor.action.inlineSuggest.acceptNextWord`| 接受内联建议的下一个字 | `ctl+right`| `cmd+right`
|
||||
`editor.action.inlineSuggest.commit`| 接受内联建议 | `Tab`| `Tab`
|
||||
`editor.action.inlineSuggest.hide`| 隐藏内联建议 | `Esc`| `Esc`
|
||||
`editor.action.inlineSuggest.acceptNextLine`| 接受内联建议的下一行 | - | -
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot 中 Completions Panel 相关命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.generate`| 打开 `Completions Panel` | `ctrl+enter`| `ctrl+enter`
|
||||
`github.copilot.acceptCursorPanelSolution`| 接受`Completions Panel`光标所在的建议 | `ctrl+/` | `ctrl+/`
|
||||
`github.copilot.previousPanelSolution`| 查看上一个建议 | `alt+[`| `alt+[`
|
||||
`github.copilot.nextPanelSolution`| 查看下一个建议 | `alt+]`| `alt+]`
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot 中 其他命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.toggleCopilot`| 启用/禁用 Copilot 补全提示 | -| -
|
||||
`github.copilot.collectDiagnostics`| 收集诊断信息 | -| -
|
||||
`github.copilot.openLogs`| 打开日志窗口 | -| -
|
||||
`github.copilot.sendFeedback`| 打开社区网站 | -| -
|
||||
`github.copilot.signIn`| 登陆 | -| -
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
### Github Copilot Chat
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
|
||||
#### Copilot Chat 中 Chat 相关命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.interactiveEditor.explain`|进行解释(选中内容或光标所在的文件)|-|-
|
||||
`github.copilot.terminal.explainTerminalSelection`|对此进行解释(需要在终端中使用)|-|-
|
||||
`github.copilot.terminal.explainTerminalSelectionContextMenu`|Copilot: 对此进行解释(需要在终端中使用)|鼠标右键菜单|鼠标右键菜单
|
||||
`github.copilot.terminal.explainTerminalLastCommand`|对终端中最后一个命令进行解释(需要在终端中使用)|-|-
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 中 Inline Chat 相关命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`inlineChat.start`|代码内聊天| - | -
|
||||
`github.copilot.interactiveEditor.generate`|在此生成(在光标所在位置唤起inline chat的`/generate`功能)| - | -
|
||||
`github.copilot.interactiveEditor.generateDocs`|生成文档| - | -
|
||||
`github.copilot.interactiveEditor.generateTests`|生成测试| - | -
|
||||
`github.copilot.interactiveEditor.fix`|修复此| - | -
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 中 Quick Chat 相关命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`workbench.action.quickchat.toggle`|开启/关闭 Quick Chat|`shift+cmd+i`|`shift+cmd+i`
|
||||
`github.copilot.terminal.suggestCommand`|建议终端命令|`ctrl+i`(仅在终端起作用)|`cmd+i`
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 中 Editor Chat 相关命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`workbench.action.openChat.copilot`|打开编辑器聊天|-|-
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
#### Copilot Chat 其他命令
|
||||
|
||||
| 命令 |说明 | 快捷键 | Mac 快捷键 |
|
||||
|-|:-|:-|:-|
|
||||
`github.copilot.interactiveSession.feedback`|打开github Issues|-|-
|
||||
`github.copilot.debug.workbenchState`|日志工作台状态|-|-
|
||||
`github.copilot.ghpr.applySuggestion`|为Github Pull Request提供代码建议|-|-
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
四、Copilot Chat 的 Slash Commands 使用技巧
|
||||
----
|
||||
|
||||
> 在聊天对话框中可以通过`/`开头的命令来与Copilot Chat进行交互。
|
||||
|
||||
### Slash Commands 示例
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
#### Slash Commands 由四部分构成
|
||||
|
||||
|元素|说明|
|
||||
|-|-|
|
||||
|- Agent | 指定Agent, 符号为 `@`, 可选
|
||||
|- Commands | 指定命令, 符号为 `/`, 可选
|
||||
|- 变量 | 引用内容, 符号为 `#`, 可选
|
||||
|- 用户输入的指令 | 可选
|
||||
|
||||
#### 例子
|
||||
|
||||
```
|
||||
/explain def helloworld():...
|
||||
|
||||
@vscode /api 请解释 inlineChat.start 的作用
|
||||
|
||||
@workspace /explain def helloworld():...
|
||||
|
||||
在每一行代码末尾添加注释进行解释
|
||||
```
|
||||
|
||||
#### Agent
|
||||
|
||||
| Agent |说明 |
|
||||
|- |:-|
|
||||
@vscode |vscode命令与插件的问题
|
||||
@workspace|项目workspace相关的问题
|
||||
|
||||
### Inline Chat 的 Slash Commands
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
---
|
||||
|
||||
> 通过命令 `inlineChat.start` 触发 `inline chat` 后使用
|
||||
|
||||
|命令 |说明 |
|
||||
|- |:-|
|
||||
/doc |在此添加文档注释
|
||||
/explain |对选中的代码进行解释
|
||||
/fix |修复此选中的代码
|
||||
/tests |为选中的代码生成单元测试
|
||||
|
||||
---
|
||||
|
||||
> 通过命令 `github.copilot.interactiveEditor.generate` 触发
|
||||
|
||||
|命令 |说明 |
|
||||
|- |:-|
|
||||
/generate |在此生成, 该命令无法由用户输入
|
||||
|
||||
---
|
||||
|
||||
> 当然也可以直接选中区域,然后在inline chat中输入指令执行 copilot会对选中区域进行指令操作
|
||||
|
||||
|常用指令|
|
||||
| - |
|
||||
|在每一行代码末尾添加注释进行解释|
|
||||
|使代码满足PEP484要求|
|
||||
<!--rehype:className=show-header wrap-text left-align-->
|
||||
|
||||
### Silde Chat 的 Slash Commands
|
||||
<!--rehype:wrap-class=col-span-1 row-span-2-->
|
||||
|
||||
> 通过命令 `workbench.action.chat.openInSidebar` 触发 `chat` 后使用
|
||||
> 或点击侧边栏上的Copilot聊天按钮
|
||||
> 在Chat输入框中还允许指定Agent(即环境)
|
||||
|
||||
#### Slash Commands
|
||||
|
||||
|命令 |说明 |
|
||||
|- |:-|
|
||||
/api |回答vscode扩展插件开发的问题
|
||||
/explain |对选中的代码进行解释
|
||||
/fix |修复此选中的代码
|
||||
/new |创建新项目workspace
|
||||
/newNotebook |创建新的Jupyter Notebook
|
||||
/terminal |解释命令行里的命令
|
||||
/tests |为选中的代码生成单元测试
|
||||
/help |帮助说明
|
||||
/clear |清除会话
|
||||
|
||||
### `/terminal`特有的变量, 以`#`号开头
|
||||
|
||||
> 仅在`/terminal`命令中可用
|
||||
|
||||
| 变量 |说明 |
|
||||
|-|:-|
|
||||
`#terminalLastCommand`|最后一次执行的终端命令
|
||||
`#terminalSelection`|选中的终端命令
|
||||
|
||||
### 的 Slash Commands
|
||||
<!--rehype:wrap-class=col-span-1 row-span-1-->
|
||||
|
||||
- Quick Chat 与 Chat 的 Slash Commands相同
|
||||
- Editor Chat 与 Chat 的 Slash Commands相同
|
||||
|
||||
五、参数设置
|
||||
----
|
||||
|
||||
打开vscode 命令面板, 输入`Preferences:Open Settings` 打开配置文件,在文件模式下配置相关参数.
|
||||
|
||||
完整参数说明可以查看 `copilot` 与 `copilot chat` 两个[插件目录](https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed)下的 `package.json` 文件获知。
|
||||
|
||||
### 完整配置参考
|
||||
|
||||
```json
|
||||
// settings.json
|
||||
{
|
||||
// ...
|
||||
"github.copilot.chat.welcomeMessage": "always",
|
||||
"github.copilot.chat.localeOverride": "zh-CN",
|
||||
"github.copilot.editor.enableCodeActions": true,
|
||||
"github.copilot.editor.iterativeFixing": true,
|
||||
"github.copilot.editor.enableAutoCompletions": true,
|
||||
"github.copilot.enable": {
|
||||
"plaintext": false,
|
||||
"ini": false,
|
||||
"markdown": true,
|
||||
"*": true
|
||||
},
|
||||
"github.copilot.advanced": {
|
||||
"length": 4000,
|
||||
"inlineSuggestCount": 5,
|
||||
"top_p": 1,
|
||||
"temperature": "0.8",
|
||||
"listCount": 10,
|
||||
"stops": {
|
||||
"*": [
|
||||
"\n\n\n"
|
||||
],
|
||||
"python": [
|
||||
"\ndef ",
|
||||
"\nclass ",
|
||||
"\nif ",
|
||||
"\n\n#"
|
||||
]
|
||||
},
|
||||
"debug.showScores": true,
|
||||
"indentationMode": {
|
||||
"python": false,
|
||||
"javascript": false,
|
||||
"javascriptreact": false,
|
||||
"jsx": false,
|
||||
"typescript": false,
|
||||
"typescriptreact": false,
|
||||
"go": false,
|
||||
"ruby": false,
|
||||
"*": true
|
||||
}
|
||||
}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### 参数说明
|
||||
<!--rehype:wrap-class=col-span-2 row-span-1-->
|
||||
#### 代理参数
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"http.proxy"`| string |配置网络代理地址
|
||||
|
||||
#### Copilot Chat 参数
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"github.copilot.chat.localeOverride"`| string | 设置Copilot本地语言
|
||||
`"github.copilot.chat.welcomeMessage"`| string |Copilot Chat 是否显示欢迎语<br>`first`: 仅第一次启动时, `always`: 总是, `never`: 从不
|
||||
|
||||
#### Copilot 基本参数
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"editor.inlineSuggest.enabled"`| boolean |启用内联建议
|
||||
`"github.copilot.editor.iterativeFixing"`| boolean| 允许 Copilot 提供迭代修复建议
|
||||
`"github.copilot.editor.enableAutoCompletions"`| boolean |允许 Copilot 提供自动补全
|
||||
`"github.copilot.editor.enableCodeActions"`| boolean|允许 Copilot 代码操作建议,这些操作可能包括重构代码、优化代码结构、修复可错误等
|
||||
|
||||
#### 设置 Copilot 生效的文件类型
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"github.copilot.enable"`| json |请将 `"*": true` 放到末尾 <br>[语言](https://code.visualstudio.com/docs/languages/identifiers)后设置 `false` 表示禁用copilot, 设置 `true` 表示启用
|
||||
|
||||
#### Copilot 高级参数
|
||||
|
||||
> github.copilot.advanced 可以控制模型参数,最终影响到代码生成. 其值为json
|
||||
|
||||
|设置参数 |值类型|说明 |
|
||||
|:--|:--|:--|
|
||||
`"length"`| integer | 生成的代码字数, 默认为 `500`
|
||||
`"top_p"`| number | 控制模型候选范围,默认值为 `1`,值范围为`0.0~1.0`
|
||||
`"temperature"`| string | 控制模型的创造性,默认值为 `""`,值越大越不可预测,值范围为`0.0~1.0`
|
||||
`"inlineSuggestCount"`| integer | 内联提示的个数, 默认为`3`
|
||||
`"listCount"`| integer | 控制`Completions Panel`中建议个数,默认为 `10`
|
||||
`"stops"`| json | 控制模型代码生成时停止的标志,可以按[语言](https://code.visualstudio.com/docs/languages/identifiers)来控制
|
||||
`"indentationMode"`| json | 指定[语言](https://code.visualstudio.com/docs/languages/identifiers)是否采用该语言的缩近模式,由此可能会与stops冲突,比如采用`\{\}`缩近时,设置该参数时需要综合考虑
|
||||
`"debug.showScores"`| boolean | 在代码建议列表中显示每个建议的分数
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
END... ENJOY YOURSELF
|
||||
----
|
||||
|
||||
> 欢迎大家添加新内容,校对、错误请指正。📮邮箱: <a href="mailto:jussker@outlook.com">jussker@outlook.com</a>
|
||||
|
||||
参考来源
|
||||
----
|
||||
|
||||
\[1\]: [GitHub Copilot in VS Code](https://code.visualstudio.com/docs/editor/github-copilot)
|
||||
\[2\]: [How to use GitHub Copilot: Prompts, tips, and use cases](https://github.blog/2023-06-20-how-to-write-better-prompts-for-github-copilot/)
|
||||
\[3\]: [GitHub Copilot Official Website](https://github.com/features/copilot)
|
||||
\[4\]: [GitHub Copilot Series (Youtube)](https://www.youtube.com/playlist?list=PLj6YeMhvp2S5_hvBl2SE-7YCHYlLQ0bPt)
|
||||
\[5\]: [Pragmatic techniques to get the most out of GitHub Copilot (Youtube)](https://www.youtube.com/watch?v=CwAzIpc4AnA)
|
||||
\[6\]: [How I used GitHub Copilot to build a browser extension](https://github.blog/2023-05-12-how-i-used-github-copilot-to-build-a-browser-extension)
|
||||
\[7\]: [Visual Studio Code, Where are extensions installed?](https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed)
|
||||
\[8\]: [Visual Studio Code, Language Identifiers](https://code.visualstudio.com/docs/languages/identifiers)
|
||||
153
docs/github.md
@@ -27,6 +27,18 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
`G` `W` | 转到 `Wiki` 选项卡
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 源码浏览
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`T` | 激活文件查找器
|
||||
`L` | 跳转到代码中的一行
|
||||
`W` | 切换到新的分支或标签
|
||||
`Y` | 将 URL 扩展为其规范形式
|
||||
`I` | 显示或隐藏对差异的评论
|
||||
`B` | 打开责备视图
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 源代码编辑
|
||||
|
||||
快捷键 | 说明
|
||||
@@ -41,18 +53,6 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
`Ctrl` `Y` | 重做
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 源码浏览
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`T` | 激活文件查找器
|
||||
`L` | 跳转到代码中的一行
|
||||
`W` | 切换到新的分支或标签
|
||||
`Y` | 将 URL 扩展为其规范形式
|
||||
`I` | 显示或隐藏对差异的评论
|
||||
`B` | 打开责备视图
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 注释
|
||||
|
||||
快捷键 | 说明
|
||||
@@ -67,43 +67,8 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
`R` | 在回复中引用所选文字
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 问题和拉取请求列表
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`C` | 创建问题
|
||||
`Ctrl` `/` | 将光标聚焦在问题或拉取请求搜索栏上
|
||||
`U` | 按作者过滤
|
||||
`L` | 按标签过滤或编辑标签
|
||||
`M` | 按里程碑过滤或编辑里程碑
|
||||
`A` | 按受让人过滤或编辑受让人
|
||||
`O` | 打开问题
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 问题和拉取请求
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Q` | 请求审稿人
|
||||
`M` | 设定一个里程碑
|
||||
`L` | 应用标签
|
||||
`A` | 设置受让人
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 拉取请求的变化
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`C` | 打开拉取请求中的提交列表
|
||||
`T` | 打开拉取请求中已更改文件的列表
|
||||
`J` | 在列表中向下移动选择
|
||||
`K` | 在列表中向上移动选择
|
||||
`Ctrl` `Shift` `Enter` | 在拉取请求差异上添加单个评论
|
||||
`Alt` `(click)` | 在拉取请求中折叠和展开所有过时的审阅评论之间切换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 项目板
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
<!--rehype:wrap-class=row-span-4-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
@@ -131,6 +96,30 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
`Ctrl` `Shift` `Right/L` | 将卡片移至最右侧列的顶部
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 问题和拉取请求列表
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`C` | 创建问题
|
||||
`Ctrl` `/` | 将光标聚焦在问题或拉取请求搜索栏上
|
||||
`U` | 按作者过滤
|
||||
`L` | 按标签过滤或编辑标签
|
||||
`M` | 按里程碑过滤或编辑里程碑
|
||||
`A` | 按受让人过滤或编辑受让人
|
||||
`O` | 打开问题
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 问题和拉取请求
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Q` | 请求审稿人
|
||||
`M` | 设定一个里程碑
|
||||
`L` | 应用标签
|
||||
`A` | 设置受让人
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 通知
|
||||
|
||||
快捷键 | 说明
|
||||
@@ -139,6 +128,18 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
`Shift` `M` | 静音线程
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 拉取请求的变化
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`C` | 打开拉取请求中的提交列表
|
||||
`T` | 打开拉取请求中已更改文件的列表
|
||||
`J` | 在列表中向下移动选择
|
||||
`K` | 在列表中向上移动选择
|
||||
`Ctrl` `Shift` `Enter` | 在拉取请求差异上添加单个评论
|
||||
`Alt` `(click)` | 在拉取请求中折叠和展开所有过时的审阅评论之间切换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 网络图
|
||||
|
||||
快捷键 | 说明
|
||||
@@ -175,6 +176,7 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
`path:__init__.py` | 文件为 <pur>`__init__.py`</pur> 里面的内容搜索
|
||||
`path:/.*shrc$/` | 文件路径包含 <pur>`.*shrc`</pur> 结尾的文件中搜索内容
|
||||
`path:/src/*.js` | <pur>`src`</pur> 目录中的 <pur>`.js`</pur> 后缀的文件中搜索内容
|
||||
`path:/(^\|\/)README\.md$/` | 使用正则,仅匹配特定文件名(而不是路径的一部分)
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 完全符合
|
||||
@@ -192,6 +194,7 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 基于仓库的条件
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
@@ -204,6 +207,7 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 基于 issue 的条件
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
@@ -226,6 +230,59 @@ Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
`repos:0 repos:<40 repos:>5` | 仓库数量
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### Symbol 限定符
|
||||
|
||||
搜索 `go` 语言中的 `WithContext` 符号
|
||||
|
||||
```
|
||||
language:go symbol:WithContext
|
||||
```
|
||||
|
||||
查询将查找在 `Rust` 中实现的 `String` 类型转换:
|
||||
|
||||
```
|
||||
language:rust symbol:/^String::to_.*/
|
||||
```
|
||||
|
||||
### 使用布尔运算
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
查询将匹配包含 `sparse` 或 `index` 的文档
|
||||
|
||||
```js
|
||||
sparse OR index
|
||||
```
|
||||
|
||||
排除 `__testing__` 目录中的文件,您可以搜索:
|
||||
|
||||
```js
|
||||
"fatal error" NOT path:__testing__
|
||||
```
|
||||
|
||||
您可以使用括号来表达更复杂的布尔表达式
|
||||
|
||||
```js
|
||||
(language:ruby OR language:python) AND NOT path:"/tests/"
|
||||
```
|
||||
|
||||
使用运算符 `AND`、`OR` 和 `NOT` 来组合搜索词
|
||||
|
||||
### is 限定符
|
||||
|
||||
- `archived`: 限制搜索`已存档`的版本库
|
||||
- `fork`: 限制搜索已`分叉`的版本库
|
||||
- `vendored`: 限制搜索被检测为 vendored 的内容
|
||||
- `generated`: 限制搜索检测为`已生成`的内容
|
||||
|
||||
示例
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`path:/^MIT.txt$/ is:archived` | 已归档存储库,中包含名为 <pur>MIT.txt</pur> 的文件
|
||||
`log4j NOT is:archived` | 限定符 <pur>is:</pur> 可以与 <pur>NOT</pur> 运算符反转
|
||||
`log4j NOT is:fork` | 从结果中排除<pur>分叉</pur>
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
另见
|
||||
-----
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ Google Chrome 键盘快捷键备忘清单
|
||||
:- | -
|
||||
`(type)` `Enter` | 使用您的默认搜索引擎进行搜索
|
||||
`(type)` `Tab` | 使用不同的搜索引擎搜索
|
||||
`Ctrl` `Enter` | 添加 www. 和 .com 到站点名称,并在当前选项卡中打开
|
||||
`Ctrl` `Enter` | 添加 <www>. 和 .com 到站点名称,并在当前选项卡中打开
|
||||
`Alt` `Enter` | 打开新标签页并执行 Google 搜索
|
||||
`Ctrl` `L` | 跳转到地址栏
|
||||
`Ctrl` `K` | 从页面上的任何位置搜索
|
||||
|
||||
154
docs/homebrew.md
@@ -33,110 +33,170 @@ export HOMEBREW_INSTALL_FROM_API=1
|
||||
```
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
### 命令
|
||||
### 安装卸载
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
命令 | 说明
|
||||
:--- :---
|
||||
:--- | :---
|
||||
`brew install git` | `安装`一个软件包
|
||||
`brew reinstall git` | 重新`安装`一个软件包
|
||||
`brew uninstall git` | `删除`/`卸载`软件包
|
||||
`brew upgrade git` | 升级一个软件包
|
||||
`brew upgrade` | 升级所有可升级的包
|
||||
:--- :---
|
||||
`brew switch git 2.5.0` | 切换软件包的版本
|
||||
`brew unlink git` | 取消软件包的链接
|
||||
`brew link git` | 链接已有的软件包
|
||||
`brew switch git 2.5.0` | 切换软件包的版本
|
||||
:--- :---
|
||||
`brew list --versions git` | 查看安装的软件包及其版本信息
|
||||
`brew cleanup git` | 删除旧版本的软件包及依赖
|
||||
|
||||
### 更多包命令
|
||||
### 升级
|
||||
|
||||
命令 | 说明
|
||||
:--- :---
|
||||
`brew info git` | 显示软件包的版本、依赖、注意事项等信息
|
||||
`brew cleanup git` | 删除旧版本的软件包及其依赖
|
||||
`brew edit git` | 编辑此软件包的安装脚本
|
||||
`brew cat git` | 打印此软件包的安装脚本
|
||||
`brew home git` | 打开此软件包的主页
|
||||
`brew search git` | 搜索软件包公式并显示相关信息
|
||||
:--- | :---
|
||||
`brew upgrade git` | 升级一个软件包
|
||||
`brew upgrade` | 升级所有可升级的软件包
|
||||
`brew update` | 更新 `Homebrew` 和 `Cask`
|
||||
|
||||
### Brew Cask 命令
|
||||
|
||||
命令 | 说明
|
||||
:--- :---
|
||||
:--- | :---
|
||||
`brew install --cask firefox` | 安装火狐浏览器
|
||||
`brew list --cask` | 列出已安装应用
|
||||
|
||||
Cask 命令用于与图形界面应用程序交互,可以安装和管理 macOS 上的图形界面应用程序
|
||||
|
||||
### 更多包命令
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
命令 | 说明
|
||||
:--- | :---
|
||||
`brew info git` | 显示软件包的版本、依赖、注意事项等信息
|
||||
`brew edit git` | 编辑此软件包的安装脚本
|
||||
`brew cat git` | 打印此软件包的安装脚本
|
||||
`brew home git` | 打开此软件包的主页
|
||||
`brew search git` | 搜索软件包公式并显示相关信息
|
||||
`brew list --versions git` | 查看安装的软件包及其版本信息
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 全局命令
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
命令 | 说明
|
||||
:--- :---
|
||||
`brew update` | 更新 `Homebrew` 和 `Cask`
|
||||
`brew upgrade` | 升级所有可升级的软件包
|
||||
:--- | :---
|
||||
`brew list` | 列出已安装的软件包
|
||||
`brew outdated` | 列出需要升级的软件包
|
||||
`brew doctor` | 诊断 Homebrew 是否存在问题
|
||||
`brew pin <formula>` | 防止指定软件包被升级
|
||||
`brew unpin <formula>` | 允许指定软件包被升级
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 帮助命令
|
||||
|
||||
命令 | 说明
|
||||
:--- | :---
|
||||
`brew help` | 打印帮助信息
|
||||
`brew help <sub-command>` | 打印子命令的帮助信息
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### Brew 清理
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
删除旧版本的已安装软件包
|
||||
|
||||
```bash
|
||||
$ brew cleanup
|
||||
```
|
||||
|
||||
删除旧版本指定软件包
|
||||
|
||||
```bash
|
||||
$ brew cleanup <formula>
|
||||
```
|
||||
|
||||
删除未安装的软件包
|
||||
|
||||
```bash
|
||||
$ brew cleanup -s
|
||||
```
|
||||
|
||||
删除所有 Homebrew 缓存
|
||||
|
||||
```bash
|
||||
$ brew cleanup --prune=all
|
||||
```
|
||||
|
||||
直接删除 Homebrew 的缓存目录
|
||||
|
||||
```bash
|
||||
$ rm -rf $(brew --cache)
|
||||
```
|
||||
|
||||
显示所有将被删除的软件包(试运行)
|
||||
|
||||
```bash
|
||||
$ brew cleanup # 删除旧版本的已安装软件包
|
||||
$ brew cleanup <formula> # 删除旧版本指定软件包
|
||||
$ brew cleanup -s # 删除未安装的软件包
|
||||
$ brew cleanup --prune=all # 删除所有 Homebrew 缓存
|
||||
$ rm -rf $(brew --cache) # 直接删除 Homebrew 的缓存目录
|
||||
# 显示所有将被删除的软件包(试运行)
|
||||
$ brew cleanup -n
|
||||
```
|
||||
|
||||
### Brew 源码仓库
|
||||
|
||||
列出所有当前点击的源码仓库(点击)
|
||||
|
||||
```bash
|
||||
# 列出所有当前点击的源码仓库(点击)
|
||||
$ brew tap
|
||||
# 使用 https 从 Github 中点击软件包源码仓库以点击
|
||||
```
|
||||
|
||||
使用 https 从 Github 中点击软件包源码仓库以点击
|
||||
|
||||
```bash
|
||||
# https://github.com/user/homebrew-repo
|
||||
$ brew tap <user/repo>
|
||||
# 点击指定 URL 中的软件源码仓库
|
||||
```
|
||||
|
||||
点击指定 URL 中的软件源码仓库
|
||||
|
||||
```bash
|
||||
$ brew tap <user/repo> <URL>
|
||||
# 从存储库中删除给定的源码仓库
|
||||
```
|
||||
|
||||
从存储库中删除给定的源码仓库
|
||||
|
||||
```bash
|
||||
$ brew untap <user/repo>
|
||||
```
|
||||
|
||||
### 搜索查看
|
||||
|
||||
列出所有已安装的软件包
|
||||
|
||||
```bash
|
||||
# 列出所有已安装的软件包
|
||||
$ brew list
|
||||
# 显示所有本地可用的 brew 配方
|
||||
```
|
||||
|
||||
显示所有本地可用的 brew 配方
|
||||
|
||||
```bash
|
||||
$ brew search
|
||||
# 搜索包含指定字符的 brew 配方
|
||||
```
|
||||
|
||||
搜索包含指定字符的 brew 配方
|
||||
|
||||
```bash
|
||||
$ brew search <text>
|
||||
# 显示有关软件包的信息
|
||||
```
|
||||
|
||||
显示有关软件包的信息
|
||||
|
||||
```bash
|
||||
$ brew info <formula>
|
||||
```
|
||||
|
||||
### 帮助命令
|
||||
|
||||
命令 | 说明
|
||||
:--- :---
|
||||
`brew help` | 打印帮助信息
|
||||
`brew help <sub-command>` | 打印子命令的帮助信息
|
||||
|
||||
### 依赖
|
||||
|
||||
显示`包`的依赖关系。 特定于`包`的其他选项可能是附加到命令
|
||||
命令 | 说明
|
||||
:--- | :---
|
||||
`brew deps --tree --installed` | 查看包和依赖关系图
|
||||
`brew deps git` | 显示 git 依赖
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
```bash
|
||||
# 您还可以看到包和依赖关系图
|
||||
$ brew deps --tree --installed
|
||||
$ brew deps git # 显示 git 依赖
|
||||
```
|
||||
显示`包`的依赖关系。 特定于`包`的其他选项可能是附加到命令
|
||||
|
||||
### 卸载 Homebrew
|
||||
|
||||
|
||||
267
docs/iso-3166-1.md
Normal file
@@ -0,0 +1,267 @@
|
||||
ISO 3166-1 国家代码 备忘清单
|
||||
===
|
||||
|
||||
这是一个符合 ISO 3166-1 标准的 ISO 国家代码列表,它为多语言网站提供参考。
|
||||
|
||||
ISO 3166-1 代码列表
|
||||
----
|
||||
|
||||
### 完整代码
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
英文短名称 | 二位代码 | 三位代码 | 数字代码 | 中文名称(简体) | 中文名称(繁体)
|
||||
:-|:-|:-|:-|:-|:-
|
||||
Afghanistan | AF | AFG | 004 | 阿富汗 | 阿富汗
|
||||
Åland Islands | AX | ALA | 248 | 奥兰 | 奧蘭
|
||||
Albania | AL | ALB | 008 | 阿尔巴尼亚 | 阿爾巴尼亞
|
||||
Algeria | DZ | DZA | 012 | 阿尔及利亚 | 阿爾及利亞
|
||||
American Samoa | AS | ASM | 016 | 美属萨摩亚 | 美屬薩摩亞
|
||||
Andorra | AD | AND | 020 | 安道尔 | 安道爾
|
||||
Angola | AO | AGO | 024 | 安哥拉 | 安哥拉
|
||||
Anguilla | AI | AIA | 660 | 安圭拉 | 安圭拉
|
||||
Antarctica | AQ | ATA | 010 | 南极洲 | 南極洲
|
||||
Antigua and Barbuda | AG | ATG | 028 | 安提瓜和巴布达 | 安提瓜和巴布達
|
||||
Argentina | AR | ARG | 032 | 阿根廷 | 阿根廷
|
||||
Armenia | AM | ARM | 051 | 亚美尼亚 | 亞美尼亞
|
||||
Aruba | AW | ABW | 533 | 阿鲁巴 | 阿魯巴
|
||||
Australia | AU | AUS | 036 | 澳大利亚 | 澳大利亞
|
||||
Austria | AT | AUT | 040 | 奥地利 | 奧地利
|
||||
Azerbaijan | AZ | AZE | 031 | 阿塞拜疆 | 阿塞拜疆
|
||||
Bahamas | BS | BHS | 044 | 巴哈马 | 巴哈馬
|
||||
Bahrain | BH | BHR | 048 | 巴林 | 巴林
|
||||
Bangladesh | BD | BGD | 050 | 孟加拉国 | 孟加拉國
|
||||
Barbados | BB | BRB | 052 | 巴巴多斯 | 巴巴多斯
|
||||
Belarus | BY | BLR | 112 | 白俄罗斯 | 白俄羅斯
|
||||
Belgium | BE | BEL | 056 | 比利时 | 比利時
|
||||
Belize | BZ | BLZ | 084 | 伯利兹 | 伯利茲
|
||||
Benin | BJ | BEN | 204 | 贝宁 | 貝寧
|
||||
Bermuda | BM | BMU | 060 | 百慕大 | 百慕大
|
||||
Bhutan | BT | BTN | 064 | 不丹 | 不丹
|
||||
Bolivia (Plurinational State of) | BO | BOL | 068 | 玻利维亚 | 玻利維亞
|
||||
Bonaire, Sint Eustatius and Saba | BQ | BES | 535 | 荷兰加勒比区 | 荷蘭加勒比區
|
||||
Bosnia and Herzegovina | BA | BIH | 070 | 波斯尼亚和黑塞哥维那 | 波斯尼亞和黑塞哥維那
|
||||
Botswana | BW | BWA | 072 | 波札那 | 波札那
|
||||
Bouvet Island | BV | BVT | 074 | 布韦岛 | 布韋島
|
||||
Brazil | BR | BRA | 076 | 巴西 | 巴西
|
||||
British Indian Ocean Territory | IO | IOT | 086 | 英属印度洋领地 | 英屬印度洋領地
|
||||
Brunei Darussalam | BN | BRN | 096 | 汶莱 | 汶萊
|
||||
Bulgaria | BG | BGR | 100 | 保加利亚 | 保加利亞
|
||||
Burkina Faso | BF | BFA | 854 | 布基纳法索 | 布吉納法索
|
||||
Burundi | BI | BDI | 108 | 布隆迪 | 蒲隆地
|
||||
Cabo Verde | CV | CPV | 132 | 佛得角 | 佛得角
|
||||
Cambodia | KH | KHM | 116 | 柬埔寨 | 柬埔寨
|
||||
Cameroon | CM | CMR | 120 | 喀麦隆 | 喀麦隆
|
||||
Canada | CA | CAN | 124 | 加拿大 | 加拿大
|
||||
Cayman Islands | KY | CYM | 136 | 开曼群岛 | 開曼群島
|
||||
Central African Republic | CF | CAF | 140 | 中非共和国 | 中非共和國
|
||||
Chad | TD | TCD | 148 | 乍得 | 乍得
|
||||
Chile | CL | CHL | 152 | 智利 | 智利
|
||||
China | CN | CHN | 156 | 中华人民共和国 | 中華人民共和國
|
||||
Christmas Island | CX | CXR | 162 | 圣诞岛 | 聖诞島
|
||||
Cocos (Keeling) Islands | CC | CCK | 166 | 科科斯(基林)群岛 | 科科斯(基林)群島
|
||||
Colombia | CO | COL | 170 | 哥伦比亚 | 哥倫比亞
|
||||
Comoros | KM | COM | 174 | 葛摩 | 葛摩
|
||||
Congo | CG | COG | 178 | 刚果 | 剛果共和國
|
||||
Congo (Democratic Republic of the) | CD | COD | 180 | 刚果(金) | 剛果民主共和國
|
||||
Cook Islands | CK | COK | 184 | 库克群岛 | 庫克群島
|
||||
Costa Rica | CR | CRI | 188 | 哥斯达黎加 | 哥斯達黎加
|
||||
Côte d'Ivoire | CI | CIV | 384 | 科特迪瓦 | 科特迪瓦
|
||||
Croatia | HR | HRV | 191 | 克罗地亚 | 克羅地亞
|
||||
Cuba | CU | CUB | 192 | 古巴 | 古巴
|
||||
Curaçao | CW | CUW | 531 | 库拉索 | 庫拉索
|
||||
Cyprus | CY | CYP | 196 | 塞浦路斯 | 賽普勒斯
|
||||
Czechia | CZ | CZE | 203 | 捷克 | 捷克
|
||||
Denmark | DK | DNK | 208 | 丹麦 | 丹麥
|
||||
Djibouti | DJ | DJI | 262 | 吉布提 | 吉布提
|
||||
Dominica | DM | DMA | 212 | 多米尼克 | 多米尼克
|
||||
Dominican Republic | DO | DOM | 214 | 多米尼加 | 多明尼加
|
||||
Ecuador | EC | ECU | 218 | 厄瓜多尔 | 厄瓜多爾
|
||||
Egypt | EG | EGY | 818 | 埃及 | 埃及
|
||||
El Salvador | SV | SLV | 222 | 萨尔瓦多 | 薩爾瓦多
|
||||
Equatorial Guinea | GQ | GNQ | 226 | 赤道几内亚 | 赤道幾內亞
|
||||
Eritrea | ER | ERI | 232 | 厄立特里亚 | 厄立特里亚
|
||||
Estonia | EE | EST | 233 | 爱沙尼亚 | 愛沙尼亞
|
||||
Eswatini | SZ | SWZ | 748 | 斯威士兰 | 斯威士蘭
|
||||
Ethiopia | ET | ETH | 231 | 埃塞俄比亚 | 埃塞俄比亞
|
||||
Falkland Islands (Malvinas) | FK | FLK | 238 | 福克兰群岛 | 福克蘭群島
|
||||
Faroe Islands | FO | FRO | 234 | 法罗群岛 | 法羅群島
|
||||
Fiji | FJ | FJI | 242 | 斐济 | 斐濟
|
||||
Finland | FI | FIN | 246 | 芬兰 | 芬蘭
|
||||
France | FR | FRA | 250 | 法国 | 法國
|
||||
French Guiana | GF | GUF | 254 | 法属圭亚那 | 法屬圭亞那
|
||||
French Polynesia | PF | PYF | 258 | 法属波利尼西亚 | 法屬玻里尼西亞
|
||||
French Southern Territories | TF | ATF | 260 | 法属南部领地 | 法屬南部和南极領地
|
||||
Gabon | GA | GAB | 266 | 加蓬 | 加蓬
|
||||
Gambia | GM | GMB | 270 | 冈比亚 | 岡比亞
|
||||
Georgia | GE | GEO | 268 | 格鲁吉亚 | 喬治亞
|
||||
Germany | DE | DEU | 276 | 德国 | 德國
|
||||
Ghana | GH | GHA | 288 | 加纳 | 加納
|
||||
Gibraltar | GI | GIB | 292 | 直布罗陀 | 直布羅陀
|
||||
Greece | GR | GRC | 300 | 希腊 | 希臘
|
||||
Greenland | GL | GRL | 304 | 格陵兰 | 格陵蘭
|
||||
Grenada | GD | GRD | 308 | 格林纳达 | 格林納達
|
||||
Guadeloupe | GP | GLP | 312 | 瓜德罗普 | 瓜德羅普
|
||||
Guam | GU | GUM | 316 | 关岛 | 關島
|
||||
Guatemala | GT | GTM | 320 | 危地马拉 | 危地馬拉
|
||||
Guernsey | GG | GGY | 831 | 根西 | 根西
|
||||
Guinea | GN | GIN | 324 | 几内亚 | 幾內亞
|
||||
Guinea-Bissau | GW | GNB | 624 | 几内亚比绍 | 幾內亞比索
|
||||
Guyana | GY | GUY | 328 | 圭亚那 | 圭亞那
|
||||
Haiti | HT | HTI | 332 | 海地 | 海地
|
||||
Heard Island and McDonald Islands | HM | HMD | 334 | 赫德岛和麦克唐纳群岛 | 赫德島和麥克唐納群島
|
||||
Holy See | VA | VAT | 336 | 梵蒂冈 | 梵蒂岡
|
||||
Honduras | HN | HND | 340 | 洪都拉斯 | 洪都拉斯
|
||||
Hong Kong | HK | HKG | 344 | 香港 | 香港
|
||||
Hungary | HU | HUN | 348 | 匈牙利 | 匈牙利
|
||||
Iceland | IS | ISL | 352 | 冰岛 | 冰島
|
||||
India | IN | IND | 356 | 印度 | 印度
|
||||
Indonesia | ID | IDN | 360 | 印度尼西亚 | 印度尼西亞
|
||||
Iran (Islamic Republic of) | IR | IRN | 364 | 伊朗 | 伊朗
|
||||
Iraq | IQ | IRQ | 368 | 伊拉克 | 伊拉克
|
||||
Ireland | IE | IRL | 372 | 爱尔兰 | 愛爾蘭
|
||||
Isle of Man | IM | IMN | 833 | 曼岛 | 曼島
|
||||
Israel | IL | ISR | 376 | 以色列 | 以色列
|
||||
Italy | IT | ITA | 380 | 意大利 | 義大利
|
||||
Jamaica | JM | JAM | 388 | 牙买加 | 牙買加
|
||||
Japan | JP | JPN | 392 | 日本 | 日本
|
||||
Jersey | JE | JEY | 832 | 泽西 | 澤西
|
||||
Jordan | JO | JOR | 400 | 约旦 | 約旦
|
||||
Kazakhstan | KZ | KAZ | 398 | 哈萨克斯坦 | 哈薩克斯坦
|
||||
Kenya | KE | KEN | 404 | 肯尼亚 | 肯尼亞
|
||||
Kiribati | KI | KIR | 296 | 基里巴斯 | 基里巴斯
|
||||
Korea (Democratic People's Republic of) | KP | PRK | 408 | 朝鲜 | 朝鮮民主主義人民共和國
|
||||
Korea (Republic of) | KR | KOR | 410 | 韩国 | 大韓民國
|
||||
Kuwait | KW | KWT | 414 | 科威特 | 科威特
|
||||
Kyrgyzstan | KG | KGZ | 417 | 吉尔吉斯斯坦 | 吉爾吉斯斯坦
|
||||
Lao People's Democratic Republic | LA | LAO | 418 | 老挝 | 老挝
|
||||
Latvia | LV | LVA | 428 | 拉脱维亚 | 拉脫維亞
|
||||
Lebanon | LB | LBN | 422 | 黎巴嫩 | 黎巴嫩
|
||||
Lesotho | LS | LSO | 426 | 莱索托 | 賴索托
|
||||
Liberia | LR | LBR | 430 | 利比里亚 | 利比里亚
|
||||
Libya | LY | LBY | 434 | 利比亚 | 利比亞
|
||||
Liechtenstein | LI | LIE | 438 | 列支敦士登 | 列支敦士登
|
||||
Lithuania | LT | LTU | 440 | 立陶宛 | 立陶宛
|
||||
Luxembourg | LU | LUX | 442 | 卢森堡 | 盧森堡
|
||||
Macao | MO | MAC | 446 | 澳门 | 澳門
|
||||
Madagascar | MG | MDG | 450 | 马达加斯加 | 馬達加斯加
|
||||
Malawi | MW | MWI | 454 | 马拉维 | 馬拉維
|
||||
Malaysia | MY | MYS | 458 | 马来西亚 | 馬來西亞
|
||||
Maldives | MV | MDV | 462 | 马尔代夫 | 馬爾代夫
|
||||
Mali | ML | MLI | 466 | 马里 | 馬里
|
||||
Malta | MT | MLT | 470 | 马耳他 | 馬耳他
|
||||
Marshall Islands | MH | MHL | 584 | 马绍尔群岛 | 馬紹爾群島
|
||||
Martinique | MQ | MTQ | 474 | 马提尼克 | 馬提尼克
|
||||
Mauritania | MR | MRT | 478 | 毛里塔尼亚 | 毛里塔尼亞
|
||||
Mauritius | MU | MUS | 480 | 毛里求斯 | 毛里求斯
|
||||
Mayotte | YT | MYT | 175 | 马约特 | 馬約特
|
||||
Mexico | MX | MEX | 484 | 墨西哥 | 墨西哥
|
||||
Micronesia (Federated States of) | FM | FSM | 583 | 密克罗尼西亚联邦 | 密克罗尼西亞聯邦
|
||||
Moldova (Republic of) | MD | MDA | 498 | 摩尔多瓦 | 摩爾多瓦
|
||||
Monaco | MC | MCO | 492 | 摩纳哥 | 摩納哥
|
||||
Mongolia | MN | MNG | 496 | 蒙古 | 蒙古
|
||||
Montenegro | ME | MNE | 499 | 黑山 | 蒙特內哥羅
|
||||
Montserrat | MS | MSR | 500 | 蒙特塞拉特 | 蒙特塞拉特
|
||||
Morocco | MA | MAR | 504 | 摩洛哥 | 摩洛哥
|
||||
Mozambique | MZ | MOZ | 508 | 莫桑比克 | 莫桑比克
|
||||
Myanmar | MM | MMR | 104 | 缅甸 | 緬甸
|
||||
Namibia | NA | NAM | 516 | 纳米比亚 | 納米比亞
|
||||
Nauru | NR | NRU | 520 | 诺鲁 | 諾魯
|
||||
Nepal | NP | NPL | 524 | 荷兰 | 荷蘭
|
||||
New Caledonia | NC | NCL | 540 | 新喀里多尼亚 | 新喀里多尼亞
|
||||
New Zealand | NZ | NZL | 554 | 新西兰 | 新西蘭
|
||||
Nicaragua | NI | NIC | 558 | 尼加拉瓜 | 尼加拉瓜
|
||||
Niger | NE | NER | 562 | 尼日尔 | 尼日爾
|
||||
Nigeria | NG | NGA | 566 | 尼日利亚 | 奈及利亞
|
||||
Niue | NU | NIU | 570 | 纽埃 | 紐埃
|
||||
Norfolk Island | NF | NFK | 574 | 诺福克岛 | 諾福克島
|
||||
North Macedonia | MK | MKD | 807 | 北马其顿 | 北馬其頓
|
||||
Northern Mariana Islands | MP | MNP | 580 | 北马里亚纳群岛 | 北馬里亞納群島
|
||||
Norway | NO | NOR | 578 | 挪威 | 挪威
|
||||
Oman | OM | OMN | 512 | 阿曼 | 阿曼
|
||||
Pakistan | PK | PAK | 586 | 巴基斯坦 | 巴基斯坦
|
||||
Palau | PW | PLW | 585 | 帛琉 | 帛琉
|
||||
Palestine, State of | PS | PSE | 275 | 巴勒斯坦 | 巴勒斯坦國
|
||||
Panama | PA | PAN | 591 | 巴拿马 | 巴拿馬
|
||||
Papua New Guinea | PG | PNG | 598 | 巴布亚新几内亚 | 巴布亞新幾內亞
|
||||
Paraguay | PY | PRY | 600 | 巴拉圭 | 巴拉圭
|
||||
Peru | PE | PER | 604 | 秘鲁 | 秘魯
|
||||
Philippines | PH | PHL | 608 | 菲律宾 | 菲律賓
|
||||
Pitcairn | PN | PCN | 612 | 皮特凯恩群岛 | 皮特凱恩群島
|
||||
Poland | PL | POL | 616 | 波兰 | 波蘭
|
||||
Portugal | PT | PRT | 620 | 葡萄牙 | 葡萄牙
|
||||
Puerto Rico | PR | PRI | 630 | 波多黎各 | 波多黎各
|
||||
Qatar | QA | QAT | 634 | 卡塔尔 | 卡塔爾
|
||||
Réunion | RE | REU | 638 | 留尼汪 | 留尼汪
|
||||
Romania | RO | ROU | 642 | 罗马尼亚 | 羅馬尼亞
|
||||
Russian Federation | RU | RUS | 643 | 俄罗斯 | 俄羅斯
|
||||
Rwanda | RW | RWA | 646 | 卢旺达 | 盧旺达
|
||||
Saint Barthélemy | BL | BLM | 652 | 圣巴泰勒米 | 聖巴泰勒米
|
||||
Saint Helena, Ascension and Tristan da Cunha | SH | SHN | 654 | 圣赫勒拿 | 聖赫勒拿
|
||||
Saint Kitts and Nevis | KN | KNA | 659 | 圣克里斯多福及尼维斯 | 聖克里斯多福及尼維斯
|
||||
Saint Lucia | LC | LCA | 662 | 圣卢西亚 | 聖盧西亞
|
||||
Saint Martin (French part) | MF | MAF | 663 | 法属圣马丁 | 法屬聖馬丁
|
||||
Saint Pierre and Miquelon | PM | SPM | 666 | 圣皮埃尔和密克隆 | 聖皮埃爾和密克隆
|
||||
Saint Vincent and the Grenadines | VC | VCT | 670 | 圣文森特和格林纳丁斯 | 聖文森特和格林納丁斯
|
||||
Samoa | WS | WSM | 882 | 萨摩亚 | 薩摩亞
|
||||
San Marino | SM | SMR | 674 | 圣马力诺 | 聖馬力諾
|
||||
Sao Tome and Principe | ST | STP | 678 | 圣多美和普林西比 | 聖多美和普林西比
|
||||
Saudi Arabia | SA | SAU | 682 | 沙特阿拉伯 | 沙特阿拉伯
|
||||
Senegal | SN | SEN | 686 | 塞内加尔 | 塞內加爾
|
||||
Serbia | RS | SRB | 688 | 塞尔维亚 | 塞爾維亞
|
||||
Seychelles | SC | SYC | 690 | 塞舌尔 | 塞舌爾
|
||||
Sierra Leone | SL | SLE | 694 | 塞拉利昂 | 塞拉利昂
|
||||
Singapore | SG | SGP | 702 | 新加坡 | 新加坡
|
||||
Sint Maarten (Dutch part) | SX | SXM | 534 | 荷属圣马丁 | 荷屬聖馬丁
|
||||
Slovakia | SK | SVK | 703 | 斯洛伐克 | 斯洛伐克
|
||||
Slovenia | SI | SVN | 705 | 斯洛文尼亚 | 斯洛文尼亞
|
||||
Solomon Islands | SB | SLB | 090 | 所罗门群岛 | 所羅門群島
|
||||
Somalia | SO | SOM | 706 | 索马里 | 索馬里
|
||||
South Africa | ZA | ZAF | 710 | 南非 | 南非
|
||||
South Georgia and the South Sandwich Islands | GS | SGS | 239 | 南乔治亚岛和南桑威奇群岛 | 南喬治亞島和南桑威奇群島
|
||||
South Sudan | SS | SSD | 728 | 南苏丹 | 南蘇丹
|
||||
Spain | ES | ESP | 724 | 西班牙 | 西班牙
|
||||
Sri Lanka | LK | LKA | 144 | 斯里兰卡 | 斯里蘭卡
|
||||
Sudan | SD | SDN | 729 | 苏丹 | 蘇丹
|
||||
Suriname | SR | SUR | 740 | 苏里南 | 蘇利南
|
||||
Svalbard and Jan Mayen | SJ | SJM | 744 | 斯瓦尔巴德群岛 | 斯瓦巴和揚馬延
|
||||
Sweden | SE | SWE | 752 | 瑞典 | 瑞典
|
||||
Switzerland | CH | CHE | 756 | 瑞士 | 瑞士
|
||||
Syrian Arab Republic | SY | SYR | 760 | 叙利亚 | 敘利亞
|
||||
Taiwan, Province of China | TW | TWN | 158 | 台湾 | 中國台灣省
|
||||
Tanzania, United Republic of | TZ | TZA | 834 | 坦桑尼亚 | 坦桑尼亞
|
||||
Thailand | TH | THA | 764 | 泰国 | 泰國
|
||||
Timor-Leste | TL | TLS | 626 | 东帝汶 | 東帝汶
|
||||
Togo | TG | TGO | 768 | 多哥 | 多哥
|
||||
Tokelau | TK | TKL | 772 | 托克劳 | 托克勞
|
||||
Tonga | TO | TON | 776 | 汤加 | 東加
|
||||
Trinidad and Tobago | TT | TTO | 780 | 特立尼达和多巴哥 | 千里達及托巴哥
|
||||
Tunisia | TN | TUN | 788 | 突尼斯 | 突尼西亞
|
||||
Türkiye | TR | TUR | 792 | 土耳其 | 土耳其
|
||||
Turkmenistan | TM | TKM | 795 | 土库曼斯坦 | 土庫曼斯坦
|
||||
Turks and Caicos Islands | TC | TCA | 796 | 特克斯和凯科斯群岛 | 特克斯和凱科斯群島
|
||||
Tuvalu | TV | TUV | 798 | 图瓦卢 | 圖瓦盧
|
||||
Uganda | UG | UGA | 800 | 乌干达 | 烏干達
|
||||
Ukraine | UA | UKR | 804 | 乌克兰 | 烏克蘭
|
||||
United Arab Emirates | AE | ARE | 784 | 阿拉伯联合酋长国 | 阿拉伯聯合大公國
|
||||
United Kingdom of Great Britain and Northern Ireland | GB | GBR | 826 | 英国 | 英國
|
||||
United States of America | US | USA | 840 | 美国 | 美國
|
||||
United States Minor Outlying Islands | UM | UMI | 581 | 美属小离岛 | 美國本土外小島嶼
|
||||
Uruguay | UY | URY | 858 | 乌拉圭 | 烏拉圭
|
||||
Uzbekistan | UZ | UZB | 860 | 乌兹别克斯坦 | 烏茲別克斯坦
|
||||
Vanuatu | VU | VUT | 548 | 瓦努阿图 | 瓦努阿圖
|
||||
Venezuela (Bolivarian Republic of) | VE | VEN | 862 | 委内瑞拉 | 委內瑞拉
|
||||
Viet Nam | VN | VNM | 704 | 越南 | 越南
|
||||
Virgin Islands (British) | VG | VGB | 92 | 英属维尔京群岛 | 英屬維爾京群島
|
||||
Virgin Islands (U.S.) | VI | VIR | 850 | 美属维尔京群岛 | 美屬維爾京群島
|
||||
Wallis and Futuna | WF | WLF | 876 | 瓦利斯群岛和富图纳群岛 | 瓦利斯群島和富圖納群島
|
||||
Western Sahara | EH | ESH | 732 | 西撒哈拉 | 西撒哈拉
|
||||
Yemen | YE | YEM | 887 | 也门 | 也門
|
||||
Zambia | ZM | ZMB | 894 | 赞比亚 | 賛比亞
|
||||
Zimbabwe | ZW | ZWE | 716 | 津巴布韦 | 津巴布韋
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
另见
|
||||
---
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
- [ISO_3166-1](https://zh.wikipedia.org/wiki/ISO_3166-1) _(wikipedia.org)_
|
||||
@@ -3,7 +3,7 @@ ISO 639-1 Language Code 备忘清单
|
||||
|
||||
这是一个符合 ISO 639-1 标准的 ISO 语言代码列表,它为多语言网站提供参考。
|
||||
|
||||
入门
|
||||
说明
|
||||
----
|
||||
|
||||
### 介绍
|
||||
|
||||
798
docs/java.md
@@ -108,7 +108,7 @@ System.out.println(a + " " + b); // 2 1
|
||||
// byte<short<int<long<float<double
|
||||
int i = 10;
|
||||
long l = i; // 10
|
||||
// Narrowing
|
||||
// Narrowing
|
||||
double d = 10.02;
|
||||
long l = (long)d; // 10
|
||||
String.valueOf(10); // "10"
|
||||
@@ -147,7 +147,7 @@ Java 字符串
|
||||
### 基本的
|
||||
|
||||
```java
|
||||
String str1 = "value";
|
||||
String str1 = "value";
|
||||
String str2 = new String("value");
|
||||
String str3 = String.valueOf(123);
|
||||
```
|
||||
@@ -242,8 +242,8 @@ sb.append("!");
|
||||
### 比较
|
||||
|
||||
```java
|
||||
String s1 = new String("QuickRef");
|
||||
String s2 = new String("QuickRef");
|
||||
String s1 = new String("QuickRef");
|
||||
String s2 = new String("QuickRef");
|
||||
s1 == s2 // false
|
||||
s1.equals(s2) // true
|
||||
"AB".equalsIgnoreCase("ab") // true
|
||||
@@ -341,7 +341,7 @@ String[] arr = {"a", "b", "c"};
|
||||
for (int a: arr) {
|
||||
System.out.print(a + " ");
|
||||
}
|
||||
// 输出: a b c
|
||||
// 输出: a b c
|
||||
```
|
||||
|
||||
### 二维数组 Multidimensional Arrays
|
||||
@@ -356,7 +356,7 @@ for (int i = 0; i < a.length; ++i) {
|
||||
System.out.println(a[i][j]);
|
||||
}
|
||||
}
|
||||
// 输出: 1 2 3 4 5 6 7
|
||||
// 输出: 1 2 3 4 5 6 7
|
||||
```
|
||||
|
||||
### 排序 Sort
|
||||
@@ -465,6 +465,47 @@ int max = (a > b) ? a : b;
|
||||
System.out.println(max);
|
||||
```
|
||||
|
||||
### 逻辑运算符
|
||||
|
||||
```java
|
||||
// 与运算
|
||||
if (condition1 && condition2) {
|
||||
// 如果 condition1 和 condition2 都成立
|
||||
// 则执行此处的代码
|
||||
}
|
||||
|
||||
// 或运算
|
||||
if (condition1 || condition2) {
|
||||
// 如果condition1或condition2任意一个成立
|
||||
// 则执行此处的代码
|
||||
}
|
||||
|
||||
// 非运算
|
||||
if (!condition) {
|
||||
// 如果条件不成立,则执行此处的代码
|
||||
}
|
||||
```
|
||||
|
||||
### 比较运算
|
||||
|
||||
```java
|
||||
// 等于
|
||||
if (a == b) {
|
||||
// 如果a等于b,则执行此处的代码
|
||||
}
|
||||
|
||||
// 不等于
|
||||
if (a != b) {
|
||||
// 如果a不等于b,则执行此处的代码
|
||||
}
|
||||
|
||||
// 大于、大于等于、小于、小于等于
|
||||
if (a > b) {}
|
||||
if (a >= b) {}
|
||||
if (a < b) {}
|
||||
if (a <= b) {}
|
||||
```
|
||||
|
||||
Java 循环
|
||||
----
|
||||
|
||||
@@ -545,9 +586,10 @@ for (int i = 0; i < 5; i++) {
|
||||
```
|
||||
|
||||
Java 多线程
|
||||
--------------------
|
||||
---
|
||||
|
||||
### 创建线程
|
||||
<!--rehype:wrap-class=row-span-2 col-span-2-->
|
||||
|
||||
```java
|
||||
// 实现Runnable接口
|
||||
@@ -557,8 +599,11 @@ public class RunnableThread implements Runnable {
|
||||
// todo something
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
// 实现Callable接口,T 替换成实际类型
|
||||
实现Callable接口,T 替换成实际类型
|
||||
|
||||
```java
|
||||
public class CallableTask implements Callable<T> {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
@@ -566,43 +611,50 @@ public class CallableTask implements Callable<T> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
// 继承Thrad类
|
||||
继承Thrad类
|
||||
|
||||
```java
|
||||
public class ExtendsThread extends Thread {
|
||||
@Override
|
||||
public void run() {
|
||||
// todo something
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
// 运行线程
|
||||
运行线程
|
||||
|
||||
```java
|
||||
public static void main(String[] args) throws ExecutionException, InterruptedException {
|
||||
new Thread(new RunnableThread()).start();
|
||||
new ExtendsThread2().start();
|
||||
FutureTask<Integer> integerFutureTask = new FutureTask<>(new CallableTask());
|
||||
integerFutureTask.run();
|
||||
}
|
||||
new Thread(new RunnableThread()).start();
|
||||
new ExtendsThread2().start();
|
||||
FutureTask<Integer> integerFutureTask = new FutureTask<>(new CallableTask());
|
||||
integerFutureTask.run();
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### 线程池
|
||||
|
||||
- corePoolSize: 核心线程数
|
||||
- maximumPoolSize: 最大线程数
|
||||
- keepAliveTime: 线程空闲时间
|
||||
- timeUni: 线程空闲时间单位
|
||||
- workQueue: 线程等待队列
|
||||
- threadFactory: 线程创建工厂
|
||||
- handler: 拒绝策略
|
||||
|
||||
```java
|
||||
/**
|
||||
* corePoolSize: 核心线程数
|
||||
* maximumPoolSize: 最大线程数
|
||||
* keepAliveTime: 线程空闲时间
|
||||
* timeUni: 线程空闲时间单位
|
||||
* workQueue: 线程等待队列
|
||||
* threadFactory: 线程创建工厂
|
||||
* handler: 拒绝策略
|
||||
*/
|
||||
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
|
||||
2, 5,
|
||||
5, TimeUnit.SECONDS,
|
||||
new ArrayBlockingQueue<>(10),
|
||||
new DefaultThreadFactory("pollName"),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
ThreadPoolExecutor threadPoolExecutor
|
||||
= new ThreadPoolExecutor(
|
||||
2, 5,
|
||||
5, TimeUnit.SECONDS,
|
||||
new ArrayBlockingQueue<>(10),
|
||||
new DefaultThreadFactory("pollName"),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy()
|
||||
);
|
||||
|
||||
// 内置的线程池, 不推荐生产使用
|
||||
Executors.newCachedThreadPool();
|
||||
@@ -613,8 +665,6 @@ Executors.newSingleThreadExecutor();
|
||||
|
||||
### synchronized
|
||||
|
||||
<!--rehype:wrap-class=row-span-1-->
|
||||
|
||||
```java
|
||||
// 代码块
|
||||
synchronized(obj) {
|
||||
@@ -622,16 +672,58 @@ synchronized(obj) {
|
||||
}
|
||||
|
||||
// (静态)方法
|
||||
public synchronized (static) void methodName() {
|
||||
public synchronized
|
||||
(static) void methodName() {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### 线程编排
|
||||
<!--rehype:wrap-class=row-span-2 col-span-2-->
|
||||
|
||||
```java
|
||||
// CountDownLatch
|
||||
CountDownLatch countDownLatch = new CountDownLatch(2);
|
||||
new Thread(() -> {
|
||||
try {
|
||||
...
|
||||
}finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
}).start();
|
||||
countDownLatch.await();
|
||||
```
|
||||
|
||||
CompletableFuture
|
||||
|
||||
```java
|
||||
CompletableFuture<Void> task1 = CompletableFuture.runAsync(() -> {});
|
||||
CompletableFuture<Void> task2 = CompletableFuture.runAsync(() -> {});
|
||||
CompletableFuture<Void> task3 = CompletableFuture.runAsync(() -> {});
|
||||
CompletableFuture.allOf(task1, task2, task3).get();
|
||||
```
|
||||
|
||||
Semaphore
|
||||
|
||||
```java
|
||||
Semaphore semaphore = new Semaphore(5);
|
||||
try {
|
||||
semaphore.acquire();
|
||||
} finally {
|
||||
semaphore.release();
|
||||
}
|
||||
```
|
||||
|
||||
### ThreadLocal
|
||||
|
||||
```java
|
||||
// 使用完之后一定要记得remove, 否则会内存泄露
|
||||
ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
|
||||
ThreadLocal<Integer> threadLocal
|
||||
= new ThreadLocal<>();
|
||||
```
|
||||
|
||||
使用完之后一定要记得 `remove`, 否则会内存泄露
|
||||
|
||||
```java
|
||||
threadLocal.set(1);
|
||||
threadLocal.get();
|
||||
threadLocal.remove();
|
||||
@@ -641,7 +733,7 @@ threadLocal.remove();
|
||||
|
||||
```java
|
||||
// 需要synchronized修饰的代码块才能使用
|
||||
wait();
|
||||
wait();
|
||||
notify();
|
||||
notifyAll();
|
||||
|
||||
@@ -663,37 +755,8 @@ LockSupport.park(obj);
|
||||
LockSupport.unpark(thread);
|
||||
```
|
||||
|
||||
### 线程编排
|
||||
|
||||
```java
|
||||
// CountDownLatch
|
||||
CountDownLatch countDownLatch = new CountDownLatch(2);
|
||||
new Thread(() -> {
|
||||
try {
|
||||
...
|
||||
}finally {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
}).start();
|
||||
countDownLatch.await();
|
||||
|
||||
// CompletableFuture
|
||||
CompletableFuture<Void> task1 = CompletableFuture.runAsync(() -> {});
|
||||
CompletableFuture<Void> task2 = CompletableFuture.runAsync(() -> {});
|
||||
CompletableFuture<Void> task3 = CompletableFuture.runAsync(() -> {});
|
||||
CompletableFuture.allOf(task1, task2, task3).get();
|
||||
|
||||
// Semaphore
|
||||
Semaphore semaphore = new Semaphore(5);
|
||||
try {
|
||||
semaphore.acquire();
|
||||
} finally {
|
||||
semaphore.release();
|
||||
}
|
||||
```
|
||||
|
||||
Java 框架搜集
|
||||
--------------------
|
||||
---
|
||||
|
||||
### Java 集合
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
@@ -744,7 +807,9 @@ for (Integer value : nums) {
|
||||
System.out.println(value);
|
||||
}
|
||||
// lambda 打印元素
|
||||
nums.forEach(e -> System.out.println(e.toString()));
|
||||
nums.forEach(
|
||||
e -> System.out.println(e.toString())
|
||||
);
|
||||
```
|
||||
|
||||
### HashMap
|
||||
@@ -778,7 +843,7 @@ m.remove(101, "Geeks");
|
||||
|
||||
// 如果不存在,就添加,存在就不变更
|
||||
m.putIfAbsent(103, "Hello");
|
||||
|
||||
|
||||
// 替换
|
||||
m.replace(101, "Hello", "For");
|
||||
System.out.println(m);
|
||||
@@ -803,7 +868,9 @@ set.remove("cat");
|
||||
for (String element : set) {
|
||||
System.out.println(element);
|
||||
}
|
||||
set.forEach(e -> System.out.println(e.toString()));
|
||||
set.forEach(
|
||||
e -> System.out.println(e.toString())
|
||||
);
|
||||
```
|
||||
|
||||
### ArrayDeque
|
||||
@@ -824,6 +891,510 @@ System.out.println(a.peek());
|
||||
System.out.println(a.pop());
|
||||
```
|
||||
|
||||
Java I/O流
|
||||
---
|
||||
|
||||
### 常见的类和操作
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
字节流
|
||||
|
||||
- `InputStream` 字节输入流的抽象基类
|
||||
- `FileInputStream` 从文件中读取字节的输入流
|
||||
- `ByteArrayInputStream` 从字节数组中读取字节的输入流
|
||||
- `OutputStream` 字节输出流的抽象基类
|
||||
- `FileOutputStream` 向文件中写入字节的输出流
|
||||
- `ByteArrayOutputStream` 将字节写入到字节数组的输出流
|
||||
|
||||
字符流
|
||||
|
||||
- `Reader` 字符输入流的抽象基类
|
||||
- `FileReader` 从文件中读取字符的输入流
|
||||
- `BufferedReader` 带缓冲区的字符输入流
|
||||
- `InputStreamReader` 字节流到字符流的桥接器
|
||||
- `Writer` 字符输出流的抽象基类
|
||||
- `FileWriter` 向文件中写入字符的输出流
|
||||
- `BufferedWriter` 带缓冲区的字符输出流
|
||||
- `OutputStreamWriter` 字符流到字节流的桥接器
|
||||
|
||||
对象流
|
||||
|
||||
- `ObjectInputStream` 从输入流中读取Java对象的流
|
||||
- `ObjectOutputStream` 将Java对象写入输出流的流
|
||||
|
||||
缓冲流
|
||||
|
||||
- `BufferedInputStream` 带缓冲区的字节输入流
|
||||
- `BufferedOutputStream` 带缓冲区的字节输出流
|
||||
- `BufferedReader` 带缓冲区的字符输入流
|
||||
- `BufferedWriter` 带缓冲区的字符输出流
|
||||
|
||||
数据流
|
||||
|
||||
- `DataInputStream` 从输入流中读取基本数据类型的数据
|
||||
- `DataOutputStream` 将基本数据类型数据写入输出流
|
||||
|
||||
文件类
|
||||
|
||||
- `File` 文件和目录路径名的抽象表示
|
||||
- `FileReader` 从文件中读取字符的输入流
|
||||
- `FileWriter` 向文件中写入字符的输出流
|
||||
|
||||
输入输出异常处理
|
||||
|
||||
- `IOException` Java I/O操作中的通用异常
|
||||
- `FileNotFoundException` 当试图打开指定文件失败时抛出
|
||||
- `EOFException` 在尝试读取流的末尾时抛出
|
||||
|
||||
其他流
|
||||
|
||||
- `PrintStream` 打印格式化表示的对象的输出流
|
||||
- `PrintWriter` 格式化的文本输出流
|
||||
- `RandomAccessFile` 随机访问文件的类,支持读取和写入操作
|
||||
|
||||
### 字节流
|
||||
|
||||
```java
|
||||
// 文件输入流
|
||||
InputStream inputStream
|
||||
= new FileInputStream("input.txt");
|
||||
|
||||
// 文件输出流
|
||||
OutputStream outputStream
|
||||
= new FileOutputStream("output.txt");
|
||||
|
||||
// 缓冲字节输入流
|
||||
InputStream bufferedInputStream
|
||||
= new BufferedInputStream(inputStream);
|
||||
|
||||
// 缓冲字节输出流
|
||||
OutputStream bufferedOutputStream
|
||||
= new BufferedOutputStream(outputStream);
|
||||
```
|
||||
|
||||
### 字符流
|
||||
|
||||
```java
|
||||
// 文件字符输入流
|
||||
Reader fileReader
|
||||
= new FileReader("input.txt");
|
||||
|
||||
// 文件字符输出流
|
||||
Writer fileWriter
|
||||
= new FileWriter("output.txt");
|
||||
|
||||
// 缓冲字符输入流
|
||||
Reader bufferedFileReader
|
||||
= new BufferedReader(
|
||||
new FileReader("input.txt")
|
||||
);
|
||||
|
||||
// 缓冲字符输出流
|
||||
Writer bufferedFileWriter
|
||||
= new BufferedWriter(
|
||||
new FileWriter("output.txt")
|
||||
);
|
||||
```
|
||||
|
||||
### 数据流
|
||||
|
||||
```java
|
||||
// 数据输入流
|
||||
DataInputStream dataInputStream
|
||||
= new DataInputStream(inputStream);
|
||||
|
||||
// 数据输出流
|
||||
DataOutputStream dataOutputStream
|
||||
= new DataOutputStream(outputStream);
|
||||
```
|
||||
|
||||
### 对象流
|
||||
|
||||
```java
|
||||
// 对象输入流
|
||||
ObjectInputStream objectInputStream
|
||||
= new ObjectInputStream(inputStream);
|
||||
|
||||
// 对象输出流
|
||||
ObjectOutputStream objectOutputStream
|
||||
= new ObjectOutputStream(outputStream);
|
||||
```
|
||||
|
||||
### 序列化与反序列化
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
序列化对象到文件
|
||||
|
||||
```java
|
||||
try (
|
||||
ObjectOutputStream objectOutputStream
|
||||
= new ObjectOutputStream(new FileOutputStream("object.dat"))
|
||||
) {
|
||||
objectOutputStream.writeObject(object);
|
||||
}
|
||||
```
|
||||
|
||||
从文件反序列化对象
|
||||
|
||||
```java
|
||||
try (
|
||||
ObjectInputStream objectInputStream
|
||||
= new ObjectInputStream(new FileInputStream("object.dat"))
|
||||
) {
|
||||
Object object = objectInputStream.readObject();
|
||||
}
|
||||
```
|
||||
|
||||
### 标准输入输出流
|
||||
|
||||
标准输入流
|
||||
|
||||
```java
|
||||
InputStream standardInputStream
|
||||
= System.in;
|
||||
```
|
||||
|
||||
标准输出流
|
||||
|
||||
```java
|
||||
PrintStream standardOutputStream
|
||||
= System.out;
|
||||
```
|
||||
|
||||
### 基本操作
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```java
|
||||
// 读取字节数据
|
||||
int byteData = inputStream.read();
|
||||
|
||||
// 写入字节数据
|
||||
outputStream.write(byteData);
|
||||
|
||||
// 读取字符数据
|
||||
int charData = reader.read();
|
||||
|
||||
// 写入字符数据
|
||||
writer.write(charData);
|
||||
```
|
||||
|
||||
### 关闭流
|
||||
|
||||
```java
|
||||
// 关闭输入流
|
||||
inputStream.close();
|
||||
|
||||
// 关闭输出流
|
||||
outputStream.close();
|
||||
```
|
||||
|
||||
Java Stream 流
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 创建流
|
||||
|
||||
从集合创建流
|
||||
|
||||
```java
|
||||
List<String> list = Arrays.asList("a", "b", "c");
|
||||
Stream<String> streamFromList = list.stream();
|
||||
```
|
||||
|
||||
从数组创建流
|
||||
|
||||
```java
|
||||
String[] array = {"d", "e", "f"};
|
||||
Stream<String> streamFromArray = Arrays.stream(array);
|
||||
```
|
||||
|
||||
创建空流
|
||||
|
||||
```java
|
||||
Stream<String> emptyStream = Stream.empty();
|
||||
```
|
||||
|
||||
创建无限流
|
||||
|
||||
```java
|
||||
Stream<Integer> infiniteStream = Stream.iterate(0, n -> n + 2);
|
||||
```
|
||||
|
||||
### 中间操作
|
||||
|
||||
```java
|
||||
// 过滤
|
||||
Stream<String> filteredStream = list.stream().filter(
|
||||
s -> s.startsWith("a")
|
||||
);
|
||||
|
||||
// 映射
|
||||
Stream<Integer> mappedStream = list.stream().map(String::length);
|
||||
|
||||
// 排序
|
||||
Stream<String> sortedStream = list.stream().sorted();
|
||||
|
||||
// 去重
|
||||
Stream<String> distinctStream = list.stream().distinct();
|
||||
|
||||
// 截断
|
||||
Stream<String> limitedStream = list.stream().limit(2);
|
||||
|
||||
// 跳过
|
||||
Stream<String> skippedStream = list.stream().skip(1);
|
||||
```
|
||||
|
||||
### 终端操作
|
||||
|
||||
```java
|
||||
// 聚合操作
|
||||
Optional<String> anyElement = list.stream().findAny();
|
||||
Optional<String> firstElement = list.stream().findFirst();
|
||||
long count = list.stream().count();
|
||||
Optional<String> maxElement = list.stream()
|
||||
.max(Comparator.naturalOrder());
|
||||
Optional<String> minElement = list.stream()
|
||||
.min(Comparator.naturalOrder());
|
||||
|
||||
// 检查匹配
|
||||
boolean anyMatch = list.stream().anyMatch(s -> s.contains("a"));
|
||||
boolean allMatch = list.stream().allMatch(s -> s.length() == 1);
|
||||
boolean noneMatch = list.stream().noneMatch(s -> s.contains("z"));
|
||||
|
||||
// 归约
|
||||
Optional<String> reducedString = list.stream()
|
||||
.reduce((s1, s2) -> s1 + s2);
|
||||
String reducedStringWithIdentity = list.stream()
|
||||
.reduce("Start:", (s1, s2) -> s1 + s2);
|
||||
|
||||
// 收集
|
||||
List<String> collectedList = list.stream()
|
||||
.collect(Collectors.toList());
|
||||
Set<String> collectedSet = list.stream()
|
||||
.collect(Collectors.toSet());
|
||||
Map<Integer, String> collectedMap = list.stream()
|
||||
.collect(
|
||||
Collectors.toMap(String::length, Function.identity())
|
||||
);
|
||||
```
|
||||
|
||||
### 并行流
|
||||
|
||||
```java
|
||||
List<String> list = Arrays.asList("a", "b", "c", "d", "e");
|
||||
List<String> upperCaseList = list.parallelStream()
|
||||
.map(String::toUpperCase)
|
||||
.collect(Collectors.toList());
|
||||
```
|
||||
|
||||
反射
|
||||
---
|
||||
|
||||
这些是使用 Java 反射时常见的操作。使用反射需要注意性能和安全性问题,尽量避免在性能要求高的地方过度使用。
|
||||
|
||||
### 获取 Class 对象
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```java
|
||||
// 通过类名获取Class对象
|
||||
Class<?> clazz1 = MyClass.class;
|
||||
|
||||
// 通过对象获取Class对象
|
||||
MyClass obj = new MyClass();
|
||||
Class<?> clazz2 = obj.getClass();
|
||||
|
||||
// 通过完整类名字符串获取Class对象
|
||||
Class<?> clazz3 = Class.forName("com.example.MyClass");
|
||||
```
|
||||
|
||||
### 获取类的信息
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
获取类的名称
|
||||
|
||||
```java
|
||||
String className = clazz.getName();
|
||||
```
|
||||
|
||||
获取类的修饰符
|
||||
|
||||
```java
|
||||
int modifiers = clazz.getModifiers();
|
||||
```
|
||||
|
||||
获取类的包信息
|
||||
|
||||
```java
|
||||
Package pkg = clazz.getPackage();
|
||||
```
|
||||
|
||||
获取类的父类
|
||||
|
||||
```java
|
||||
Class<?> superClass = clazz.getSuperclass();
|
||||
```
|
||||
|
||||
获取类实现的接口
|
||||
|
||||
```java
|
||||
Class<?>[] interfaces = clazz.getInterfaces();
|
||||
```
|
||||
|
||||
### 创建对象实例
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```java
|
||||
// 使用默认构造函数创建对象
|
||||
MyClass instance = (MyClass) clazz.newInstance();
|
||||
|
||||
// 使用带参数的构造函数创建对象
|
||||
Constructor<?> constructor = clazz.getConstructor(String.class, int.class);
|
||||
MyClass instanceWithArgs = (MyClass) constructor.newInstance("example", 123);
|
||||
```
|
||||
|
||||
### 获取和设置字段值
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```java
|
||||
// 获取字段值
|
||||
Field field = clazz.getDeclaredField("fieldName");
|
||||
field.setAccessible(true); // 如果字段是私有的,需要设置可访问
|
||||
Object value = field.get(instance);
|
||||
|
||||
// 设置字段值
|
||||
field.set(instance, newValue);
|
||||
```
|
||||
|
||||
### 处理泛型
|
||||
|
||||
```java
|
||||
// 获取泛型信息
|
||||
Type genericType = field.getGenericType();
|
||||
```
|
||||
|
||||
### 调用方法
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```java
|
||||
// 获取方法
|
||||
Method method = clazz.getDeclaredMethod("methodName", parameterTypes);
|
||||
method.setAccessible(true); // 如果方法是私有的,需要设置可访问
|
||||
|
||||
// 调用方法
|
||||
Object result = method.invoke(instance, args);
|
||||
```
|
||||
|
||||
### 其他常用操作
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```java
|
||||
// 判断是否是数组、枚举、注解等
|
||||
boolean isArray = clazz.isArray();
|
||||
boolean isEnum = clazz.isEnum();
|
||||
boolean isAnnotation = clazz.isAnnotation();
|
||||
|
||||
// 获取构造函数、字段、方法等
|
||||
Constructor<?>[] constructors = clazz.getConstructors();
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
Method[] methods = clazz.getDeclaredMethods();
|
||||
```
|
||||
|
||||
### 处理注解
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```java
|
||||
// 获取注解信息
|
||||
Annotation annotation = field.getAnnotation(MyAnnotation.class);
|
||||
```
|
||||
|
||||
方法引用
|
||||
---
|
||||
|
||||
### 方法引用
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
Java 的 `Consumer` 接口里的 `accept` 方法接受参数但不返回值。要让它打印传入的参数,可以这样做:
|
||||
|
||||
```java
|
||||
Consumer<String> test = new Consumer<String>() {
|
||||
@Override
|
||||
public void accept(String s) {
|
||||
System.out.println(s);
|
||||
}
|
||||
};
|
||||
test.accept("test");
|
||||
```
|
||||
|
||||
更简单的,我们可以直接传入Lambda表达式
|
||||
|
||||
```java
|
||||
Consumer<String> test = System.out::println;
|
||||
```
|
||||
|
||||
方法引用通过方法的名字指向一个方法,使语言构造更简洁,减少冗余代码。
|
||||
|
||||
#### 使用方式
|
||||
|
||||
- 引用方法
|
||||
- 引用构造方法
|
||||
- 引用数组
|
||||
|
||||
### 静态方法引用
|
||||
|
||||
```java
|
||||
Comparator<Integer> comparator = Math::max;
|
||||
|
||||
int result = comparator.compare(1, 2);
|
||||
// 返回 2
|
||||
```
|
||||
|
||||
### 实例方法引用
|
||||
|
||||
```java
|
||||
String str = "HELLO";
|
||||
|
||||
String lowerCase = str::toLowerCase;
|
||||
// 返回 "hello"
|
||||
```
|
||||
|
||||
### 构造方法引用
|
||||
|
||||
```java
|
||||
Supplier<String> supplier = String::new;
|
||||
|
||||
String str = supplier.get();
|
||||
// 返回一个空字符串
|
||||
```
|
||||
|
||||
### 数组构造方法引用
|
||||
|
||||
```java
|
||||
Function<Integer, String[]> function = String[]::new;
|
||||
|
||||
|
||||
String[] array = function.apply(5);
|
||||
// 返回 5 个空字符串的数组
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 对象中的方法引用
|
||||
|
||||
```java
|
||||
String someStr = "HELLO";
|
||||
|
||||
String lowerCase = someStr::toLowerCase;
|
||||
// 返回 "hello"
|
||||
```
|
||||
|
||||
### 对象中的静态方法引用
|
||||
|
||||
```java
|
||||
SomeClass someObject = new SomeClass();
|
||||
|
||||
int result = someObject::staticMethod;
|
||||
// 调用静态方法
|
||||
```
|
||||
|
||||
杂项 Misc
|
||||
----
|
||||
|
||||
@@ -855,7 +1426,7 @@ text.split(Pattern.quote("|"));
|
||||
|
||||
```java
|
||||
// 我是单行注释!
|
||||
|
||||
|
||||
/*
|
||||
而我是一个
|
||||
多行注释!
|
||||
@@ -924,6 +1495,7 @@ text.split(Pattern.quote("|"));
|
||||
<!--rehype:className=cols-7 style-none-->
|
||||
|
||||
### 数学方法
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
方法 | 说明
|
||||
:-|:-
|
||||
@@ -953,59 +1525,23 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
### 反射
|
||||
|
||||
```java
|
||||
/**
|
||||
* 利用反射动态加载依赖库
|
||||
* java9及以上版本可用
|
||||
* @param jar jar文件
|
||||
*/
|
||||
Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
|
||||
method.setAccessible(true);
|
||||
MethodHandle addURL = lookup.unreflect(method);
|
||||
URL url = jar.toURI().toURL();
|
||||
URLClassLoader urlClassLoader = new URLClassLoader(new URL[] {url});
|
||||
addURL.invoke(urlClassLoader, url);
|
||||
//java8
|
||||
Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
|
||||
method.setAccessible(true);
|
||||
method.invoke(classLoader, url);
|
||||
```
|
||||
|
||||
### util工具类
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
- `ArrayDeque` 提供 resizable-array 并实现 Deque 接
|
||||
- `Arrays` 包含一个静态工厂,允许将数组视为列表
|
||||
- `Collections` 包含对集合进行操作或返回集合的静态方法
|
||||
- `Date` 表示特定的时间瞬间,精度为毫秒
|
||||
- `Dictionary` 是任何类的抽象父类,例如 Hashtable,它将键映射到值
|
||||
- `EnumMap` 一个专门用于枚举键的 Map 实现
|
||||
- `EnumSet` 一个专门用于枚举键的 Set 实现
|
||||
- `Formatter` 提供对布局对齐和对齐、数字、字符串和日期/时间数据的常用格式以及特定于语言环境的输出的支持
|
||||
- `SecureRandom` 实例用于生成安全的伪随机数流
|
||||
- `UUID` 表示一个不可变的通用唯一标识符
|
||||
- `Vector` 实现了一个可增长的对象数组
|
||||
- `LocalDate` 表示没有时区的日期,只包含年月日,不可变并且线程安全的,java8 及以上版本可用
|
||||
- `LocalTime` 表示没有时区的时间,只包含时分秒,不可变并且线程安全的,java8 及以上版本可用
|
||||
- `LocalDateTime` 表示没有时区的日期时间,同时包含年月日时分秒,不可变并且线程安全的,java8 及以上版本可用
|
||||
|
||||
### IO流
|
||||
|
||||
```java
|
||||
// 输入流转输出流
|
||||
byte[] inputContent = "test".getBytes();
|
||||
try (InputStream inputStream = new ByteArrayInputStream(inputContent);
|
||||
OutputStream outputStream = new ByteArrayOutputStream()) {
|
||||
byte[] buffer = new byte[1024];
|
||||
int len;
|
||||
while ((len = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, len);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
```
|
||||
- `ArrayDeque`: 可调整大小的数组双端队列,实现了Deque接口
|
||||
- `Arrays`: 提供静态工厂,允许将数组视为列表
|
||||
- `Collections`: 包含操作集合或返回集合的静态方法
|
||||
- `Date`: 表示特定时间瞬间,精度为毫秒
|
||||
- `Dictionary`: 抽象父类,可用于键值对映射,例如Hashtable
|
||||
- `EnumMap`: 专门用于枚举键的Map实现
|
||||
- `EnumSet`: 专门用于枚举键的Set实现
|
||||
- `Formatter`: 提供对布局、对齐、数字、字符串和日期/时间数据的格式化支持,以及特定于语言环境的输出
|
||||
- `SecureRandom`: 生成安全的伪随机数流的实例
|
||||
- `UUID`: 表示不可变的通用唯一标识符
|
||||
- `Vector`: 实现了可增长的对象数组
|
||||
- `LocalDate`: 表示无时区的日期,仅包含年月日,不可变且线程安全,适用于Java 8及更高版本
|
||||
- `LocalTime`: 表示无时区的时间,仅包含时分秒,不可变且线程安全,适用于Java 8及更高版本
|
||||
- `LocalDateTime`: 表示无时区的日期时间,包含年月日时分秒,不可变且线程安全,适用于Java 8及更高版本
|
||||
|
||||
### Collections 工具类
|
||||
|
||||
@@ -1018,24 +1554,8 @@ list.add(2);
|
||||
list.add(3);
|
||||
list.add(3);
|
||||
list.add(3);
|
||||
int frequency = Collections.frequency(list, 2); // frequency = 2
|
||||
```
|
||||
|
||||
### Stream 流
|
||||
|
||||
```java
|
||||
// 统计词频
|
||||
List<Integer> list = new ArrayList<>();
|
||||
list.add(1);
|
||||
list.add(1);
|
||||
list.add(3);
|
||||
list.add(2);
|
||||
list.add(2);
|
||||
list.add(2);
|
||||
Map<Integer, Long> frequencyMap = list.stream().collect(Collectors.groupingBy(x -> x, Collectors.counting()));
|
||||
// 1: 2
|
||||
// 2: 3
|
||||
// 3: 1
|
||||
int frequency = Collections
|
||||
.frequency(list, 2); // frequency = 2
|
||||
```
|
||||
|
||||
另见
|
||||
|
||||
@@ -11,7 +11,7 @@ JavaScript 备忘清单
|
||||
JavaScript 是一种轻量级的解释型编程语言。
|
||||
|
||||
- [JSON 备忘清单](json.md)
|
||||
- [JavaScript 中的正则表达式](/regex#regex-in-javascript)
|
||||
- [JavaScript 中的正则表达式](./regex.md#javascript-中的正则表达式)
|
||||
- [TypeScript 备忘清单](./typescript.md)
|
||||
|
||||
### 打印调试
|
||||
|
||||
295
docs/kotlin.md
@@ -17,6 +17,7 @@ fun main() {
|
||||
main() 函数是每个 Kotlin 程序的起点,在执行之前必须包含在代码中
|
||||
|
||||
### 打印声明
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```kotlin
|
||||
println("Greetings, earthling!")
|
||||
@@ -31,6 +32,7 @@ Take me to your leader.
|
||||
```
|
||||
|
||||
### 注释
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```kotlin
|
||||
// 这是单行注释
|
||||
@@ -109,7 +111,7 @@ println(monument.length)
|
||||
```
|
||||
|
||||
### 字符转义序列
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
```kotlin
|
||||
print("\"Excellent!\" I cried. \"Elementary,\" said he.")
|
||||
@@ -149,6 +151,7 @@ print("\"Excellent!\" I cried. \"Elementary,\" said he.")
|
||||
```
|
||||
|
||||
### 增强赋值运算符
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```kotlin
|
||||
var batteryPercentage = 80
|
||||
@@ -267,6 +270,7 @@ println(shorts && sunny) // false
|
||||
```
|
||||
|
||||
### 或运算符:||
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```kotlin
|
||||
var late = true
|
||||
@@ -295,6 +299,7 @@ println(!full) // true
|
||||
```
|
||||
|
||||
### 评估顺序
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```kotlin
|
||||
!true && (false || true) // false
|
||||
@@ -311,6 +316,16 @@ println(!full) // true
|
||||
*/
|
||||
```
|
||||
|
||||
### 等式运算符
|
||||
|
||||
```kotlin
|
||||
var myAge = 22
|
||||
var sisterAge = 21
|
||||
|
||||
myAge == sisterAge // false
|
||||
myAge !== sisterAge // true
|
||||
```
|
||||
|
||||
### 嵌套条件
|
||||
|
||||
```kotlin
|
||||
@@ -356,16 +371,6 @@ if (height in 1..53) {
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 等式运算符
|
||||
|
||||
```kotlin
|
||||
var myAge = 22
|
||||
var sisterAge = 21
|
||||
|
||||
myAge == sisterAge // false
|
||||
myAge !== sisterAge // true
|
||||
```
|
||||
|
||||
Collections
|
||||
---
|
||||
|
||||
@@ -523,7 +528,7 @@ fun main() {
|
||||
### 默认参数
|
||||
|
||||
```kotlin
|
||||
fun favoriteLanguage(name, language = "Kotlin") {
|
||||
fun favoriteLanguage(name: String, language: String = "Kotlin") {
|
||||
println("Hello, $name. Your favorite programming language is $language")
|
||||
}
|
||||
|
||||
@@ -608,10 +613,11 @@ fun main() {
|
||||
|
||||
### 简单的高阶函数
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```kotlin
|
||||
//注意啦,这里的num1AndNum2有个operation,它是接收了一个函数作为形参
|
||||
// 注意啦,这里的 num1AndNum2 有个 operation,它是接收了一个函数作为形参
|
||||
fun num1AndNum2(num1: Int, num2: Int, operation: (Int, Int) -> Int): Int {
|
||||
//让我们试着向operation传入参数
|
||||
// 让我们试着向 operation 传入参数
|
||||
return operation(num1, num2)
|
||||
}
|
||||
|
||||
@@ -622,14 +628,11 @@ fun plus(num1: Int, num2: Int): Int {
|
||||
fun main(args: Array<String>) {
|
||||
val total = num1AndNum2(100, 200, ::plus)
|
||||
println(total)//300
|
||||
//怎么样?我们利用传入一个函数来充当另一个函数的参数
|
||||
// 怎么样?我们利用传入一个函数来充当另一个函数的参数
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
还记得我们怎么在Java中用接口吗?
|
||||
|
||||
试着用函数参数简化它
|
||||
还记得我们怎么在 Java 中用接口吗?试着用函数参数简化它
|
||||
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
@@ -675,23 +678,81 @@ fun main(args: Array<String>) {
|
||||
这里之所以可以把lambda写在外部,是因为operation是最后一个参数。
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
类
|
||||
---
|
||||
|
||||
### 类示例
|
||||
### 扩展函数
|
||||
|
||||
```kotlin
|
||||
// 具有包含默认值的属性的类
|
||||
class Student {
|
||||
var name = "Lucia"
|
||||
var semester = "Fall"
|
||||
var gpa = 3.95
|
||||
// Kotlin File
|
||||
fun String.lettersCount(): Int {
|
||||
var count = 0
|
||||
// this 相当于我们下面写的字符串具体的内容
|
||||
// for 可以用 forEach 代替
|
||||
for (char in this) {
|
||||
// 判断是不是字母(包括中文)
|
||||
if (char.isLetter()) {
|
||||
count++
|
||||
}
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
// 没有类体的简写语法
|
||||
class Student
|
||||
fun main() {
|
||||
//不修改 String 类的情况下新增方法
|
||||
println("123demo".lettersCount())
|
||||
// Print: 4
|
||||
}
|
||||
```
|
||||
|
||||
### 运算符重载
|
||||
|
||||
```kotlin
|
||||
class Money(var amount: Double)
|
||||
|
||||
// 配合扩展函数,重载运算符 + 即 plus
|
||||
operator fun Money.plus(money: Money): Money {
|
||||
// 把金额相加返回一个新的 Money对象
|
||||
return Money(this.amount + money.amount)
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val appleMoney = Money(10.0)
|
||||
val eggMoney = Money(6.0)
|
||||
// 你没有看错,我们将两个类对象相加了
|
||||
val allMoney = appleMoney + eggMoney
|
||||
println(allMoney.amount)
|
||||
// Print: 16.0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
这里的 **运算符重载** 依赖于 **扩展函数**
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 中缀表达式
|
||||
|
||||
```kotlin
|
||||
// infix 定义一个中缀表达式,类似扩展函数那样
|
||||
infix fun LocalDate.formatBy(pattern:String):String{
|
||||
val formatter = DateTimeFormatter.ofPattern(pattern)
|
||||
return this.format(formatter)
|
||||
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val currentDate = LocalDate.now()
|
||||
println(currentDate formatBy "yyyy-MM-dd")
|
||||
// Print: 2024-02-08
|
||||
|
||||
(1 until 100).forEach {
|
||||
println(it)
|
||||
// Print 1 至 99
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
类
|
||||
---
|
||||
|
||||
### 类实例
|
||||
|
||||
```kotlin
|
||||
@@ -715,42 +776,73 @@ fun main() {
|
||||
```
|
||||
|
||||
### 主构造函数
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```kotlin
|
||||
class Student(val name: String, val gpa: Double, val semester: String, val estimatedGraduationYear: Int)
|
||||
class Student(
|
||||
val name: String,
|
||||
val gpa: Double,
|
||||
val semester: String,
|
||||
val estimatedGraduationYear: Int
|
||||
)
|
||||
|
||||
fun main() {
|
||||
var student = Student("Lucia", 3.95, "Fall", 2022)
|
||||
println(student.name)
|
||||
// Prints: Lucia
|
||||
println(student.gpa)
|
||||
// Prints: 3.95
|
||||
println(student.semester)
|
||||
// Prints: Fall
|
||||
println(student.estimatedGraduationYear)
|
||||
// Prints: 2022
|
||||
val student = Student("Lucia", 3.95, "Fall", 2022)
|
||||
println(student.name)
|
||||
// Prints: Lucia
|
||||
println(student.gpa)
|
||||
// Prints: 3.95
|
||||
println(student.semester)
|
||||
// Prints: Fall
|
||||
println(student.estimatedGraduationYear)
|
||||
// Prints: 2022
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 初始化块
|
||||
```
|
||||
|
||||
### 次构造函数
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```kotlin
|
||||
class Student(val name: String, val gpa: Double, val semester: String, val estimatedGraduationYear: Int) {
|
||||
init {
|
||||
println("$name has ${estimatedGraduationYear - 2020} years left in college.")
|
||||
}
|
||||
class Student(
|
||||
val name: String,
|
||||
val gpa: Double,
|
||||
val semester: String,
|
||||
val estimatedGraduationYear: Int
|
||||
) {
|
||||
constructor(name: String, gpa: Double) : this(name, gpa, "Fall", 2024)
|
||||
}
|
||||
|
||||
fun main() {
|
||||
var student = Student("Lucia", 3.95, "Fall", 2022)
|
||||
// Prints: Lucia has 2 years left in college.
|
||||
val student = Student("Lucia", 3.95)
|
||||
println(student.name)
|
||||
// Prints: Lucia
|
||||
println(student.semester)
|
||||
// Prints: Fall
|
||||
println(student.estimatedGraduationYear)
|
||||
// Prints: 2024
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 类示例
|
||||
|
||||
```kotlin
|
||||
// 具有包含默认值的属性的类
|
||||
class Student {
|
||||
var name = "Lucia"
|
||||
var semester = "Fall"
|
||||
var gpa = 3.95
|
||||
}
|
||||
|
||||
// 没有类体的简写语法
|
||||
class Student
|
||||
```
|
||||
|
||||
### 成员函数
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
```kotlin
|
||||
class Student(val name: String, val gpa: Double, val semester: String, val estimatedGraduationYear: Int) {
|
||||
@@ -781,6 +873,109 @@ fun main() {
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 初始化块
|
||||
|
||||
```kotlin
|
||||
class Student(val name: String, val gpa: Double, val semester: String, val estimatedGraduationYear: Int) {
|
||||
init {
|
||||
println("$name has ${estimatedGraduationYear - 2020} years left in college.")
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
var student = Student("Lucia", 3.95, "Fall", 2022)
|
||||
// Prints: Lucia has 2 years left in college.
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### Data数据类
|
||||
|
||||
```kotlin
|
||||
// 默认实现 getter/setter 和 toString 这些方法
|
||||
data class UserInfo(
|
||||
val name: String,
|
||||
val age: Int
|
||||
)
|
||||
|
||||
fun main() {
|
||||
|
||||
val userInfo = UserInfo("张三", 20)
|
||||
println(userInfo.name)
|
||||
// 张三
|
||||
println(userInfo.toString())
|
||||
// UserInfo(name=张三, age=20)
|
||||
}
|
||||
```
|
||||
|
||||
### 伴生对象
|
||||
|
||||
```kotlin
|
||||
// 私有化构造方法
|
||||
class User private constructor(val name: String) {
|
||||
// 伴生对象,相当于一个静态类
|
||||
companion object {
|
||||
fun createUser(name: String): User {
|
||||
return User(name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
// 就像是调用静态方法
|
||||
val user = User.createUser("张三")
|
||||
println(user.name)
|
||||
//Print: 张三
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### 内部类
|
||||
|
||||
```kotlin
|
||||
class Outer {
|
||||
val outStr: String = "Outer"
|
||||
// inner 可以让内部类访问外部类
|
||||
inner class Inner {
|
||||
fun printOutStr(){
|
||||
println(outStr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val outer = Outer()
|
||||
outer.Inner().printOutStr()
|
||||
// Print: Outer
|
||||
}
|
||||
```
|
||||
|
||||
如果不用inner修饰,会导致Inner类无法使用outStr
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### object单例类
|
||||
|
||||
```kotlin
|
||||
object HttpUtils {
|
||||
|
||||
const val baseUrl = "https://xxxx.com"
|
||||
|
||||
fun getRequest(url: String): String {
|
||||
// 示例代码....
|
||||
return "Result"
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
println(HttpUtils.baseUrl)
|
||||
// Print: "https://xxxx.com"
|
||||
HttpUtils.getRequest("xxxxx")
|
||||
}
|
||||
```
|
||||
|
||||
object类中定义的函数和属性都可以用类名直接引用
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
||||
@@ -10,24 +10,29 @@ Kubernetes 备忘清单
|
||||
|
||||
```bash
|
||||
$ kubectl get no # 显示所有节点信息
|
||||
$ kubectl get no -o wide # 显示所有节点的更多信息
|
||||
# 显示所有节点的更多信息
|
||||
$ kubectl get no -o wide
|
||||
$ kubectl describe no # 显示节点详情
|
||||
$ kubectl get no -o yaml # 以yaml格式,显示节点详情
|
||||
$ kubectl get node --selector=[label_name] # 筛选指定标签的节点
|
||||
# 以yaml格式,显示节点详情
|
||||
$ kubectl get no -o yaml
|
||||
# 筛选指定标签的节点
|
||||
$ kubectl get node --selector=[label_name]
|
||||
# 输出 jsonpath 表达式定义的字段信息
|
||||
$ kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
|
||||
# 输出jsonpath表达式定义的字段信息
|
||||
$ kubectl top node [node_name] # 显示节点(CPU/内存/存储)使用情况
|
||||
# 显示节点(CPU/内存/存储)使用情况
|
||||
$ kubectl top node [node_name]
|
||||
```
|
||||
|
||||
### 容器组
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
资源名称: pods, 缩写: po
|
||||
|
||||
```bash
|
||||
$ kubectl get po # 显示所有容器组信息
|
||||
$ kubectl get po # 显示所有容器组信息
|
||||
$ kubectl get po -o wide
|
||||
$ kubectl describe po
|
||||
$ kubectl get po --show-labels # 查看容器组的labels
|
||||
$ kubectl get po --show-labels # 查看容器组的labels
|
||||
$ kubectl get po -l app=nginx
|
||||
$ kubectl get po -o yaml
|
||||
$ kubectl get pod [pod_name] -o yaml --export
|
||||
@@ -39,7 +44,7 @@ $ kubectl get pods --field-selector status.phase=Running
|
||||
|
||||
### 命名空间
|
||||
|
||||
资源名称: namespaces, 缩写: ns
|
||||
资源名称: `namespaces`, 缩写: `ns`
|
||||
|
||||
```bash
|
||||
$ kubectl get ns
|
||||
@@ -49,7 +54,7 @@ $ kubectl describe ns
|
||||
|
||||
### 无状态
|
||||
|
||||
资源名称: deployments, 缩写: deploy
|
||||
资源名称: `deployments`, 缩写: `deploy`
|
||||
|
||||
```bash
|
||||
$ kubectl get deploy
|
||||
@@ -60,7 +65,7 @@ $ kubectl get deploy -o yaml
|
||||
|
||||
### 服务
|
||||
|
||||
资源名称: services, 缩写: svc
|
||||
资源名称: `services`, 缩写: `svc`
|
||||
|
||||
```bash
|
||||
$ kubectl get svc
|
||||
@@ -71,8 +76,9 @@ $ kubectl get svc --show-labels
|
||||
```
|
||||
|
||||
### 守护进程集
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
资源名称: daemonsets, 缩写: ds
|
||||
资源名称: `daemonsets`, 缩写: `ds`
|
||||
|
||||
```bash
|
||||
$ kubectl get ds
|
||||
@@ -83,7 +89,7 @@ $ kubectl get ds [ds_name] -n [ns_name] -o yaml
|
||||
|
||||
### 事件
|
||||
|
||||
资源名称: events, 缩写: ev
|
||||
资源名称: `events`, 缩写: `ev`
|
||||
|
||||
```bash
|
||||
$ kubectl get events
|
||||
@@ -91,27 +97,29 @@ $ kubectl get events -n kube-system
|
||||
$ kubectl get events -w
|
||||
```
|
||||
|
||||
### 服务帐户
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
资源名称: `serviceaccounts`, 缩写: `sa`
|
||||
|
||||
```bash
|
||||
$ kubectl get sa
|
||||
$ kubectl get sa -o yaml
|
||||
$ kubectl get serviceaccounts default -o yaml >./sa.yaml
|
||||
$ kubectl replace serviceaccount default -f ./sa.yaml
|
||||
```
|
||||
|
||||
### 日志
|
||||
|
||||
```bash
|
||||
$ kubectl logs [pod_name]
|
||||
$ kubectl logs --since=1h [pod_name]
|
||||
$ kubectl logs --tail=20 [pod_name]
|
||||
$ kubectl logs -f -c [container_name] [pod_name]
|
||||
$ kubectl logs \
|
||||
-f -c [container_name] [pod_name]
|
||||
$ kubectl logs [pod_name] > pod.log
|
||||
```
|
||||
|
||||
### 服务帐户
|
||||
|
||||
资源名称: serviceaccounts, 缩写: sa
|
||||
|
||||
```bash
|
||||
$ kubectl get sa
|
||||
$ kubectl get sa -o yaml
|
||||
$ kubectl get serviceaccounts default -o yaml >./sa.yaml
|
||||
$ kubectl replace serviceaccount default -f ./sa.yaml
|
||||
```
|
||||
|
||||
### 副本集
|
||||
|
||||
资源名称: replicasets, 缩写: rs
|
||||
@@ -127,7 +135,13 @@ $ kubectl get rs -o yaml
|
||||
|
||||
```bash
|
||||
$ kubectl get roles --all-namespaces
|
||||
$ kubectl get roles --all-namespaces -o yaml
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
$ kubectl get roles \
|
||||
--all-namespaces -o yaml
|
||||
```
|
||||
|
||||
### 保密字典
|
||||
@@ -203,6 +217,7 @@ $ kubectl taint [node_name] [taint_name]
|
||||
```
|
||||
|
||||
### 标签
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ kubectl label nodes <node-name> <label-key>=<label-value> #增加
|
||||
@@ -233,6 +248,7 @@ $ kubectl edit pod [pod_name]
|
||||
```
|
||||
|
||||
### 无状态/命名空间
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
```bash
|
||||
$ kubectl edit deploy [deploy_name]
|
||||
@@ -265,6 +281,7 @@ $ kubectl delete sa [sa_name]
|
||||
```
|
||||
|
||||
### 注释
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ kubectl annotatepo [pod_name] [annotation]
|
||||
@@ -275,6 +292,7 @@ $ kubectl annotateno [node_name]
|
||||
---
|
||||
|
||||
### 创建容器组
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ kubectl create -f [name_of_file]
|
||||
@@ -287,7 +305,8 @@ $ kubectl run [pod_name] --image=nginx --restart=Never
|
||||
### 创建服务
|
||||
|
||||
```bash
|
||||
$ kubectl create svc nodeport [svc_name] --tcp=8080:80
|
||||
$ kubectl create svc nodeport [svc_name] \
|
||||
--tcp=8080:80
|
||||
```
|
||||
|
||||
### 创建无状态应用
|
||||
@@ -295,16 +314,12 @@ $ kubectl create svc nodeport [svc_name] --tcp=8080:80
|
||||
```bash
|
||||
$ kubectl create -f [name_of_file]
|
||||
$ kubectl apply -f [name_of_file]
|
||||
$ kubectl create deploy [deploy_name] --image=nginx
|
||||
```
|
||||
|
||||
### 容器交互
|
||||
|
||||
```bash
|
||||
$ kubectl run [pod_name] --image=busybox --rm -it --restart=Never -- sh
|
||||
$ kubectl create deploy [deploy_name] \
|
||||
--image=nginx
|
||||
```
|
||||
|
||||
### 输出YAML文件
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ kubectl create deploy [deploy_name] --image=nginx --dry-run -o yaml > deploy.yaml
|
||||
@@ -312,6 +327,14 @@ $ kubectl get po [pod_name] -o yaml --export > pod.yaml
|
||||
$ kubectl run nginx --image=nginx:alpine --dry-run -o -yaml > deploy.yaml
|
||||
```
|
||||
|
||||
### 容器交互
|
||||
|
||||
```bash
|
||||
$ kubectl run [pod_name] \
|
||||
--image=busybox --rm -it \
|
||||
--restart=Never -- sh
|
||||
```
|
||||
|
||||
### 获取帮助
|
||||
|
||||
```bash
|
||||
|
||||
@@ -98,7 +98,7 @@ Linux 命令速查表
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 进程
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
@@ -109,9 +109,6 @@ Linux 命令速查表
|
||||
**`kill pid`** | 使用给定的pid终止进程
|
||||
**`killall proc`** | 杀死/终止所有名为proc的进程
|
||||
**`pkill process-name`** | 向具有其名称的进程发送信号
|
||||
**`bg`** | 将一个在后台暂停的命令,变成继续执行
|
||||
**`fg`** | 将后台中的命令调至前台继续运行
|
||||
**`fg n`** | job n to the foreground
|
||||
**`lsof`** | 列出进程打开的文件 [#](./lsof.md)
|
||||
**`renice 19 PID`** | 使进程以非常低的优先级运行
|
||||
**`pgrep firefox`** | 查找Firefox进程ID
|
||||
@@ -218,42 +215,119 @@ Linux 命令速查表
|
||||
**`cd /test`** | 将目录更改为/test目录
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
快捷键
|
||||
### 文件描述符
|
||||
<!--rehype:wrap-class=row-span-1-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
**`0`** | 标准输入
|
||||
**`1`** | 标准输出
|
||||
**`2`** | 错误输出
|
||||
**`/dev/null`** | Linux的空设备文件,俗称“黑洞”
|
||||
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 输出重定向
|
||||
<!--rehype:wrap-class=row-span-2 col-span-2-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
**`>`** | 覆盖运算符
|
||||
**`>>`** | 追加运算符
|
||||
**`>&`** | 重定向合并运算符
|
||||
**`command > filename`** | 标准输出覆盖写入新文件
|
||||
**`command 1> filename`** | 标准输出覆盖写入新文件(同上)
|
||||
**`command 2> filename`** | 标准错误覆盖写入新文件
|
||||
**`command >> filename`** | 标准输出追加到新文件
|
||||
**`command 1>> filename`** | 标准输出追加到新文件(同上)
|
||||
**`command 2>> filename`** | 标准错误追加到新文件
|
||||
**`2>&1`** | 标准错误重定向到标准输出
|
||||
**`1>&2`** | 标准输出重定向到标准错误
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
前后台
|
||||
---
|
||||
|
||||
### 命令行编辑
|
||||
### &(终端关闭,程序也关闭)
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
**Tab** | 自动补全
|
||||
**Ctrl+A** | 移动光标到命令行首
|
||||
**Ctrl+E** | 移动光标到命令行尾
|
||||
**Ctrl+Left** | 光标左移一个单词
|
||||
**Ctrl+Right** | 光标右移一个单词
|
||||
**Ctrl+K** | 删除光标之后所有字符
|
||||
**Ctrl+U** | 清空当前键入的命令
|
||||
**Ctrl+W** | 删除光标前的单词
|
||||
**Ctrl+Y** | 粘贴`Ctrl+W`或`Ctrl+K`删除的内容
|
||||
**Ctrl+D** | 删除当前光标所在字符 (在没有字符时会关闭终端)
|
||||
Ctrl+B (Left) | 光标左移(后退)
|
||||
Ctrl+F (Right) | 光标右移(前进)
|
||||
Ctrl+H (Backspace) | 删除光标的前一个字符
|
||||
**`command &`** | 使用后台进程模式执行 command
|
||||
**`Ctrl+Z`** | 将当前进程放到后台(但程序是Stopped状态)
|
||||
**`jobs`** | 查看任务(状态、ID等)
|
||||
**`fg n`** | 将jobID为n的任务切到**前台**运行
|
||||
**`bg n`** | 将jobID为n的任务切到**后台**运行
|
||||
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### nohup(终端关闭,程序继续运行)
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
**`nohup command &`** | 后台执行 command,标准输出到 nohup.out
|
||||
**`nohup command > log_file &`** | 后台执行 command,标准输出到 log_file
|
||||
**`nohup command > log_file 2>&1 &`** | 后台执行 command,标准输出和错误输出到 log_file
|
||||
**`nohup command > log_file 2>err_log &`** | 后台执行 command,标准输出到 log_file,错误输出到 err_log
|
||||
**`ps/kill`** | 查看进程/结束进程
|
||||
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### screen(创建独立会话)
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
**`screen -S my_session`** | 创建一个名为 my_session 的会话
|
||||
**`screen -ls`** | 列出当前所有的 session
|
||||
**`screen -r my_session`** | 重新连接 my_session 这个会话
|
||||
**`screen -d my_session`** | 脱离 my_session 这个会话
|
||||
**`Ctrl+a+d`** | 在 screen 中,脱离当前会话
|
||||
**`exit`** | 在 screen 中,退出并删除当前 screen
|
||||
**`-X -S my_session quit`** | 删除 my_session 这个会话
|
||||
**`screen -wipe`** | 删除所有已经失效的会话
|
||||
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
快捷键
|
||||
---
|
||||
|
||||
### 命令行编辑
|
||||
<!--rehype:wrap-class=row-span-2 col-span-2-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
`Tab` | 自动补全
|
||||
`Ctrl`+`A` | 移动光标到命令行首
|
||||
`Ctrl`+`E` | 移动光标到命令行尾
|
||||
`Ctrl`+`Left` | 光标左移一个单词
|
||||
`Ctrl`+`Right` | 光标右移一个单词
|
||||
`Ctrl`+`K` | 删除光标之后所有字符
|
||||
`Ctrl`+`U` | 清空当前键入的命令
|
||||
`Ctrl`+`W` | 删除光标前的单词
|
||||
`Ctrl`+`Y` | 粘贴 `Ctrl` + `W` 或 `Ctrl` + `K` 删除的内容
|
||||
`Ctrl`+`D` | 删除当前光标所在字符 (在没有字符时会关闭终端)
|
||||
`Ctrl`+`B` (Left) | 光标左移(后退)
|
||||
`Ctrl`+`F` (Right) | 光标右移(前进)
|
||||
`Ctrl`+`H` (Backspace) | 删除光标的前一个字符
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 其他
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:--- | :---
|
||||
:--- | :---
|
||||
**Ctrl+L** | 清屏
|
||||
**Ctrl+C** | 中断正在执行的程序
|
||||
**Ctrl+R** | 按字符串寻找历史命令
|
||||
**Ctrl+Z** | 将当前进程放到后台(之后可以用`fg`命令重回到前台)
|
||||
**Shift+Insert** | 粘贴
|
||||
**Ctrl+PageUp** | 屏幕输出向上翻页
|
||||
**Ctrl+PageDown** | 屏幕输出向下翻页
|
||||
Ctrl+P (Up) | 上一条命令
|
||||
Ctrl+N (Down) | 下一条命令
|
||||
`Ctrl`+`L` | 清屏
|
||||
`Ctrl`+`C` | 中断正在执行的程序
|
||||
`Ctrl`+`R` | 按字符串寻找历史命令
|
||||
`Ctrl`+`Z` | 将当前进程放到后台(但程序是Stopped状态)
|
||||
`Shift`+`Insert` | 粘贴
|
||||
`Ctrl`+`PageUp` | 屏幕输出向上翻页
|
||||
`Ctrl`+`PageDown` | 屏幕输出向下翻页
|
||||
`Ctrl`+`P` (Up) | 上一条命令
|
||||
`Ctrl`+`N` (Down) | 下一条命令
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
@@ -1027,5 +1027,5 @@ origin 函数用于告诉这个变量的从何而来
|
||||
---
|
||||
|
||||
* [make 中文教程](https://seisman.github.io/how-to-write-makefile/overview.html) _(seisman.github.io)_
|
||||
* [make 手册](https://www.gnu.org/software/make/manual/make.html#toc-Overview-of-make) _(www.gnu.org)_
|
||||
* [make 官网](https://www.gnu.org/software/make/) _www.gnu.org_
|
||||
* [make 手册](https://www.gnu.org/software/make/manual/make.html#toc-Overview-of-make) _(<www.gnu.org>)_
|
||||
* [make 官网](https://www.gnu.org/software/make/) _<www.gnu.org>_
|
||||
|
||||
@@ -131,13 +131,11 @@ ___
|
||||
|
||||
### 代码
|
||||
|
||||
```markdown
|
||||
|
||||
````markdown
|
||||
```javascript
|
||||
console.log("This is a block code")
|
||||
```
|
||||
|
||||
```
|
||||
````
|
||||
|
||||
```markdown
|
||||
~~~css
|
||||
|
||||
104
docs/matlab.md
@@ -198,8 +198,8 @@ c = 2×2 complex
|
||||
|
||||
### 输入命令
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[ans](https://ww2.mathworks.cn/help/matlab/ref/ans.html) | 最近计算的答案
|
||||
[clc](https://ww2.mathworks.cn/help/matlab/ref/clc.html) | 清空命令行窗口
|
||||
[diary](https://ww2.mathworks.cn/help/matlab/ref/diary.html) | 将命令行窗口文本记录到日志文件中
|
||||
@@ -221,8 +221,8 @@ c = 2×2 complex
|
||||
|
||||
创建和合并数组
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[zeros](https://ww2.mathworks.cn/help/matlab/ref/zeros.html) | 创建全零数组
|
||||
[ones](https://ww2.mathworks.cn/help/matlab/ref/ones.html) | 创建全部为 1 的数组
|
||||
[rand](https://ww2.mathworks.cn/help/matlab/ref/rand.html) | 均匀分布的随机数
|
||||
@@ -239,8 +239,8 @@ c = 2×2 complex
|
||||
|
||||
创建网格
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[linspace](https://ww2.mathworks.cn/help/matlab/ref/linspace.html) | 生成线性间距向量
|
||||
[logspace](https://ww2.mathworks.cn/help/matlab/ref/logspace.html) | 生成对数间距向量
|
||||
[freqspace](https://ww2.mathworks.cn/help/matlab/ref/freqspace.html) | 频率响应的频率间距
|
||||
@@ -249,8 +249,8 @@ c = 2×2 complex
|
||||
|
||||
确定大小、形状和排序
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[length](https://ww2.mathworks.cn/help/matlab/ref/length.html) | 最大数组维度的长度
|
||||
[size](https://ww2.mathworks.cn/help/matlab/ref/size.html) | 数组大小
|
||||
[ndims](https://ww2.mathworks.cn/help/matlab/ref/double.ndims.html) | 数组维度数目
|
||||
@@ -266,8 +266,8 @@ c = 2×2 complex
|
||||
|
||||
重构和重新排列
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[sort](https://ww2.mathworks.cn/help/matlab/ref/sort.html) | 对数组元素排序
|
||||
[sortrows](https://ww2.mathworks.cn/help/matlab/ref/double.sortrows.html) | 对矩阵行或表行进行排序
|
||||
[flip](https://ww2.mathworks.cn/help/matlab/ref/flip.html) | 翻转元素顺序
|
||||
@@ -285,8 +285,8 @@ c = 2×2 complex
|
||||
|
||||
索引
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[colon](https://ww2.mathworks.cn/help/matlab/ref/colon.html) | 向量创建、数组下标和 <code class="literal">for</code> 循环迭代
|
||||
[end](https://ww2.mathworks.cn/help/matlab/ref/end.html) | 终止代码块或指示最大数组索引
|
||||
[ind2sub](https://ww2.mathworks.cn/help/matlab/ref/ind2sub.html) | 将线性索引转换为下标
|
||||
@@ -297,8 +297,8 @@ c = 2×2 complex
|
||||
|
||||
创建数值变量
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[double](https://ww2.mathworks.cn/help/matlab/ref/double.html) | 双精度数组
|
||||
[single](https://ww2.mathworks.cn/help/matlab/ref/single.html) | 单精度数组
|
||||
[int8](https://ww2.mathworks.cn/help/matlab/ref/int8.html) | 8 位有符号整数数组
|
||||
@@ -312,15 +312,15 @@ c = 2×2 complex
|
||||
|
||||
在数值类型之间转换
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[cast](https://ww2.mathworks.cn/help/matlab/ref/cast.html) | 将变量转换为不同的数据类型
|
||||
[typecast](https://ww2.mathworks.cn/help/matlab/ref/typecast.html) | 在不更改基础数据的情况下转换数据类型
|
||||
|
||||
查询类型和值
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[allfinite](https://ww2.mathworks.cn/help/matlab/ref/allfinite.html") | Determine if all array elements are finite
|
||||
[anynan](https://ww2.mathworks.cn/help/matlab/ref/anynan.html") | Determine if any array element is NaN
|
||||
[isinteger](https://ww2.mathworks.cn/help/matlab/ref/isinteger.html) | 确定输入是否为整数数组
|
||||
@@ -333,8 +333,8 @@ c = 2×2 complex
|
||||
|
||||
数值范围
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[eps](https://ww2.mathworks.cn/help/matlab/ref/eps.html) | 浮点相对精度
|
||||
[flintmax](https://ww2.mathworks.cn/help/matlab/ref/flintmax.html) | 浮点格式的最大连续整数
|
||||
[Inf](https://ww2.mathworks.cn/help/matlab/ref/inf.html) | 创建所有值均为 `Inf` 的数组
|
||||
@@ -363,8 +363,8 @@ c = 2×2 complex
|
||||
|
||||
### 字符串数组
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[string](https://ww2.mathworks.cn/help/matlab/ref/string.html) | 字符串数组
|
||||
[strings](https://ww2.mathworks.cn/help/matlab/ref/strings.html) | 创建不包含字符的字符串数组
|
||||
[join](https://ww2.mathworks.cn/help/matlab/ref/join.html) | 合并字符串
|
||||
@@ -372,8 +372,8 @@ c = 2×2 complex
|
||||
|
||||
### 字符数组
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[char](https://ww2.mathworks.cn/help/matlab/ref/char.html) | 字符数组
|
||||
[cellstr](https://ww2.mathworks.cn/help/matlab/ref/cellstr.html) | 转换为字符向量元胞数组
|
||||
[blanks](https://ww2.mathworks.cn/help/matlab/ref/blanks.html) | 创建空白字符数组
|
||||
@@ -381,8 +381,8 @@ c = 2×2 complex
|
||||
|
||||
### 字符或字符串数组
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[compose](https://ww2.mathworks.cn/help/matlab/ref/compose.html) | 将数据格式化为多个字符串
|
||||
[sprintf](https://ww2.mathworks.cn/help/matlab/ref/sprintf.html) | 将数据格式化为字符串或字符向量
|
||||
[strcat](https://ww2.mathworks.cn/help/matlab/ref/strcat.html) | 水平串联字符串
|
||||
@@ -399,8 +399,8 @@ c = 2×2 complex
|
||||
|
||||
### 字符或字符串 - 在数值和字符串之间转换
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[double](https://ww2.mathworks.cn/help/matlab/ref/double.html) | 双精度数组
|
||||
[string](https://ww2.mathworks.cn/help/matlab/ref/string.html) | 字符串数组
|
||||
[str2double](https://ww2.mathworks.cn/help/matlab/ref/str2double.html) | 将字符串转换为双精度值
|
||||
@@ -411,8 +411,8 @@ c = 2×2 complex
|
||||
|
||||
数据类型
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[ischar](https://ww2.mathworks.cn/help/matlab/ref/ischar.html) | 确定输入是否为字符数组
|
||||
[iscellstr](https://ww2.mathworks.cn/help/matlab/ref/iscellstr.html) | 确定输入是否为字符向量元胞数组
|
||||
[isstring](https://ww2.mathworks.cn/help/matlab/ref/isstring.html) | 确定输入是否为字符串数组
|
||||
@@ -420,8 +420,8 @@ c = 2×2 complex
|
||||
|
||||
文本属性
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[strlength](https://ww2.mathworks.cn/help/matlab/ref/strlength.html) | 字符串长度
|
||||
[isstrprop](https://ww2.mathworks.cn/help/matlab/ref/isstrprop.html) | 确定输入字符串中的哪些字符属于指定类别
|
||||
[isletter](https://ww2.mathworks.cn/help/matlab/ref/isletter.html) | 确定哪些字符为字母
|
||||
@@ -432,8 +432,8 @@ c = 2×2 complex
|
||||
|
||||
查找
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[contains](https://ww2.mathworks.cn/help/matlab/ref/contains.html) | 确定字符串中是否有模式
|
||||
[matches](https://ww2.mathworks.cn/help/matlab/ref/matches.html) | 确定模式是否与字符串匹配
|
||||
[count](https://ww2.mathworks.cn/help/matlab/ref/count.html) | 计算字符串中模式的出现次数
|
||||
@@ -444,22 +444,22 @@ c = 2×2 complex
|
||||
|
||||
替换
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[replace](https://ww2.mathworks.cn/help/matlab/ref/replace.html) | 查找并替换一个或多个子字符串
|
||||
[replaceBetween](https://ww2.mathworks.cn/help/matlab/ref/replacebetween.html) | 替换起点和终点之间的子字符串
|
||||
[strrep](https://ww2.mathworks.cn/help/matlab/ref/strrep.html) | 查找并替换子字符串
|
||||
|
||||
### 字符串匹配模式 - 构建模式
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[pattern](https://ww2.mathworks.cn/help/matlab/ref/pattern.html) | 用于搜索和匹配文本的模式
|
||||
|
||||
### 字符串匹配模式 - 字符匹配模式
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[alphanumericsPattern](https://ww2.mathworks.cn/help/matlab/ref/alphanumericspattern.html) | 匹配字母和数字字符
|
||||
[characterListPattern](https://ww2.mathworks.cn/help/matlab/ref/characterlistpattern.html) | 匹配列表中的字符
|
||||
[digitsPattern](https://ww2.mathworks.cn/help/matlab/ref/digitspattern.html) | 匹配数字字符
|
||||
@@ -469,8 +469,8 @@ c = 2×2 complex
|
||||
|
||||
### 字符串匹配模式 - 模式搜索规则
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[optionalPattern](https://ww2.mathworks.cn/help/matlab/ref/optionalpattern.html) | 使模式匹配可选
|
||||
[possessivePattern](https://ww2.mathworks.cn/help/matlab/ref/possessivepattern.html) | 匹配模式而不回溯
|
||||
[caseSensitivePattern](https://ww2.mathworks.cn/help/matlab/ref/casesensitivepattern.html) | 以区分大小写的方式匹配模式
|
||||
@@ -495,15 +495,15 @@ c = 2×2 complex
|
||||
|
||||
### 字符串匹配模式 - 自定义模式显示
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[maskedPattern](https://ww2.mathworks.cn/help/matlab/ref/maskedpattern.html) | 具有指定显示名称的模式
|
||||
[namedPattern](https://ww2.mathworks.cn/help/matlab/ref/namedpattern.html) | 指定命名模式
|
||||
|
||||
### 字符串匹配模式 - 正则表达式
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[regexp](https://ww2.mathworks.cn/help/matlab/ref/regexp.html) | 匹配正则表达式(区分大小写)
|
||||
[regexpi](https://ww2.mathworks.cn/help/matlab/ref/regexpi.html) | 匹配正则表达式(不区分大小写)
|
||||
[regexprep](https://ww2.mathworks.cn/help/matlab/ref/regexprep.html) | 使用正则表达式替换文本
|
||||
@@ -512,8 +512,8 @@ c = 2×2 complex
|
||||
|
||||
### 字符串匹配模式 - 联接和拆分
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[join](https://ww2.mathworks.cn/help/matlab/ref/join.html) | 合并字符串
|
||||
[plus](https://ww2.mathworks.cn/help/matlab/ref/plus.html) | 添加数字,追加字符串
|
||||
[split](https://ww2.mathworks.cn/help/matlab/ref/split.html) | 在分隔符处拆分字符串
|
||||
@@ -529,8 +529,8 @@ c = 2×2 complex
|
||||
### 字符串编辑
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[erase](https://ww2.mathworks.cn/help/matlab/ref/erase.html) | 删除字符串内的子字符串
|
||||
[eraseBetween](https://ww2.mathworks.cn/help/matlab/ref/erasebetween.html) | 删除起点和终点之间的子字符串
|
||||
[extract](https://ww2.mathworks.cn/help/matlab/ref/extract.html) | 从字符串中提取子字符串
|
||||
@@ -550,8 +550,8 @@ c = 2×2 complex
|
||||
|
||||
### 字符串比较
|
||||
|
||||
:- | :- | :-
|
||||
:- | :- | :-
|
||||
:- | :-
|
||||
:- | :-
|
||||
[matches](https://ww2.mathworks.cn/help/matlab/ref/matches.html) | 确定模式是否与字符串匹配
|
||||
[strcmp](https://ww2.mathworks.cn/help/matlab/ref/strcmp.html) | 比较字符串
|
||||
[strcmpi](https://ww2.mathworks.cn/help/matlab/ref/strcmpi.html) | 比较字符串(不区分大小写)
|
||||
|
||||
@@ -556,7 +556,7 @@ ON t(c3,c4)
|
||||
删除索引
|
||||
|
||||
```sql
|
||||
DROP INDEX idx_name;
|
||||
DROP INDEX idx_name ON t;
|
||||
```
|
||||
|
||||
MySQL 数据类型
|
||||
@@ -601,6 +601,80 @@ MySQL 数据类型
|
||||
| `DOUBLE` | Decimal (24 to 53 digits) |
|
||||
| `DECIMAL` | "DOUBLE" stored as string |
|
||||
|
||||
## 函数
|
||||
|
||||
### 聚合函数
|
||||
|
||||
| 函数 | 解释 |
|
||||
| :--------- |:-------------------------------|
|
||||
| `SUM()` | 计算一列值的总和 |
|
||||
| `AVG()` | 计算一列值的平均值 |
|
||||
| `COUNT()` | 计算行数,可选择性地忽略NULL值 |
|
||||
| `MAX()` | 找出一列的最大值 |
|
||||
| `MIN()` | 找出一列的最小值 |
|
||||
|
||||
### 数学函数
|
||||
|
||||
<!--rehype:wrap-class=col-span-2 -->
|
||||
|
||||
| 函数 | 解释 | 示例语法 | 结果 |
|
||||
| :-------------- | :---------------------------------------------- | :----------------------- | :-------- |
|
||||
| `ABS(x)` | 返回数值的绝对值 | `ABS(-5)` | 5 |
|
||||
| `ROUND(x,y)` | 四舍五入到指定的小数位数,y为小数位数,默认为0 | `ROUND(3.1415,2)` | 3.14 |
|
||||
| `FLOOR(x)` | 向下取整至最接近的整数 | `FLOOR(3.7)` | 3 |
|
||||
| `CEIL(x)` | 向上取整至最接近的整数 | `CEIL(3.3)` | 4 |
|
||||
| `SQRT(x)` | 返回一个数的平方根 | `SQRT(16)` | 4 |
|
||||
| `MOD(x,y)` | 返回x除以y的余数 | `MOD(10,3)` | 1 |
|
||||
| `RAND([seed])` | 返回0到1之间的随机数,可选种子值 | `RAND()` 或 `RAND(123)` | 0.345... |
|
||||
|
||||
### 日期和时间函数
|
||||
|
||||
| 函数 | 解释 |
|
||||
| :--------------- | :-------------------------- |
|
||||
| `NOW()` | 返回当前日期和时间 |
|
||||
| `CURDATE()` | 返回当前日期 |
|
||||
| `CURTIME()` | 返回当前时间 |
|
||||
| `DATE_FORMAT()` | 格式化日期时间输出 |
|
||||
| `DATEDIFF()` | 计算两个日期之间相差的天数 |
|
||||
| `STR_TO_DATE()` | 将字符串转换为日期格式 |
|
||||
|
||||
### 字符串函数
|
||||
|
||||
<!--rehype:wrap-class=col-span-2 -->
|
||||
|
||||
| 函数 | 解释 | 示例语法 | 结果 |
|
||||
| :------------------------------ | :------------------------ | ---------------------------- | --------------- |
|
||||
| `CONCAT(s1,s2,...)` | 连接两个或更多字符串 | `CONCAT('Hello, ','World!')` | 'Hello, World!' |
|
||||
| `LOWER(str)` | 转换为小写 | `LOWER('HELLO')` | 'hello' |
|
||||
| `UPPER(str)` | 转换为大写 | `UPPER('world')` | 'WORLD' |
|
||||
| `TRIM(str)` | 去除字符串两端空格 | `TRIM(' Hello ')` | 'Hello' |
|
||||
| `LEFT(str,len)` | 提取字符串左侧的若干字符 | `LEFT('Hello', 3)` | 'Hel' |
|
||||
| `RIGHT(str,len)` | 提取字符串右侧的若干字符 | `RIGHT('Hello', 2)` | 'lo' |
|
||||
| `SUBSTR(str,pos,len)` | 提取字符串中的一部分 | `SUBSTR('Hello', 2, 3)` | 'ell' |
|
||||
| `REPLACE(str,from_str,to_str)` | 替换字符串中的部分文本 | `REPLACE('Hello', 'l', 'L')` | 'HeLLo' |
|
||||
|
||||
### 高级函数
|
||||
|
||||
<!--rehype:wrap-class=col-span-3 -->
|
||||
|
||||
| 函数 | 解释 | 示例语法 | 结果 |
|
||||
| ----------------------------------- | -------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------- |
|
||||
| BIN(x) | 返回 x 的二进制编码,x 为十进制数。 | `BIN(2)` | `10` |
|
||||
| BINARY(s) | 将字符串 s 转换为二进制字符串。 | `BINARY 'RUNOOB'` | `'RUNOOB'`(显示效果,实际存储为二进制) |
|
||||
| CASE | 复合条件函数,根据条件返回不同结果。 | `CASE WHEN 1 > 0 THEN '1 > 0' WHEN 2 > 0 THEN '2 > 0' ELSE '3 > 0' END` | `'1 > 0'` |
|
||||
| CAST(x AS type) | 转换数据类型。 | `CAST('2017-08-29' AS DATE)` | `2017-08-29` |
|
||||
| COALESCE(expr1, expr2, ..., expr_n) | 返回第一个非空表达式的值。 | `COALESCE(NULL, NULL, 'runoob.com', NULL, 'google.com')` | `'runoob.com'` |
|
||||
| CONNECTION_ID() | 返回当前连接的唯一ID。 | `CONNECTION_ID()` | `4292835`(示例值) |
|
||||
| CONV(x, f1, f2) | 将 f1 进制数转换为 f2 进制数。 | `CONV(15, 10, 2)` | `1111` |
|
||||
| CONVERT(s USING cs) | 转换字符串 s 的字符集为 cs。 | `CHARSET(CONVERT('ABC' USING gbk))` | `gbk` |
|
||||
| CURRENT_USER() | 返回当前用户。 | `CURRENT_USER()` | `guest@%` |
|
||||
| DATABASE() | 返回当前数据库名。 | `DATABASE()` | `runoob` |
|
||||
| IF(expr, v1, v2) | 条件表达式,expr 为真则 v1,否则 v2。 | `IF(1 > 0, '正确', '错误')` | `'正确'` |
|
||||
| IFNULL(v1, v2) | 如果 v1 不为 NULL,则返回 v1,否则返回 v2。 | `IFNULL(NULL, 'Hello Word')` | `'Hello Word'` |
|
||||
| ISNULL(expression) | 判断表达式是否为 NULL。 | `ISNULL(NULL)` | `1` |
|
||||
| LAST_INSERT_ID() | 返回最近生成的 AUTO_INCREMENT 值。 | `LAST_INSERT_ID()` | `6`(示例值) |
|
||||
| NULLIF(expr1, expr2) | 若 expr1 等于 expr2,则返回 NULL,否则返回 expr1。 | `NULLIF(25, 25)` | `NULL` |
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
||||
2159
docs/neo4j.md
Normal file
@@ -316,7 +316,7 @@ server {
|
||||
### 重定向(301永久)
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
将 www.example.com 重定向到 example.com
|
||||
将 <www.example.com> 重定向到 example.com
|
||||
|
||||
```nginx
|
||||
server {
|
||||
@@ -811,27 +811,38 @@ location ~ \/public\/(css|js|img)\/.*\.(js|css|gif|jpg|jpeg|png|bmp|swf) {
|
||||
}
|
||||
```
|
||||
|
||||
### 阻止常见攻击
|
||||
### ulimit 不继承系统设置的问题
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
#### base64编码的网址
|
||||
- 执行 status 命令
|
||||
|
||||
```nginx
|
||||
location ~* "(base64_encode)(.*)(\()" {
|
||||
deny all;
|
||||
}
|
||||
```
|
||||
```bash
|
||||
sudo service nginx status
|
||||
```
|
||||
|
||||
#### javascript eval() url
|
||||
执行 status 命令,看到 Loaded: loaded (/lib/systemd/system/nginx.service;...) 这一行的nginx.service 文件位置
|
||||
|
||||
```nginx
|
||||
location ~* "(eval\()" {
|
||||
deny all;
|
||||
}
|
||||
```
|
||||
- 打开 service 文件
|
||||
|
||||
```bash
|
||||
sudo vim /lib/systemd/system/nginx.service
|
||||
```
|
||||
|
||||
- 修改 service 中的配置
|
||||
找到 `[Service]` 部分,将 `LimitNOFILE=65535` 添加到该部分
|
||||
|
||||
```bash
|
||||
[Service]
|
||||
...
|
||||
LimitNOFILE=65535
|
||||
...
|
||||
```
|
||||
<!--rehype:className=style-timeline-->
|
||||
|
||||
解决 `systemctl` 管理的 ulimit 不继承系统设置的问题
|
||||
|
||||
### Gzip 配置
|
||||
<!--rehype:wrap-class=col-span-4 row-span-2-->
|
||||
<!--rehype:wrap-class=col-span-4-->
|
||||
|
||||
```nginx
|
||||
gzip on;
|
||||
@@ -851,8 +862,27 @@ gzip_types
|
||||
gzip_disable "msie6";
|
||||
```
|
||||
|
||||
### 阻止常见攻击
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
#### base64编码的网址
|
||||
|
||||
```nginx
|
||||
location ~* "(base64_encode)(.*)(\()" {
|
||||
deny all;
|
||||
}
|
||||
```
|
||||
|
||||
#### javascript eval() url
|
||||
|
||||
```nginx
|
||||
location ~* "(eval\()" {
|
||||
deny all;
|
||||
}
|
||||
```
|
||||
|
||||
### 使网站不可索引
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
```nginx
|
||||
add_header X-Robots-Tag "noindex";
|
||||
|
||||
146
docs/nvm.md
Normal file
@@ -0,0 +1,146 @@
|
||||
nvm 备忘清单
|
||||
===
|
||||
|
||||
nvm 是一个用于管理电脑上多个 node.js 版本的程序
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
-----
|
||||
|
||||
### 安装
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
Node Version Manager 用于管理多个活动的 Node.js 版本
|
||||
|
||||
- [Windows 版本](https://github.com/coreybutler/nvm-windows/releases) _(github.io)_
|
||||
- [Posix 兼容的 Shell 版本](https://github.com/nvm-sh/nvm?tab=readme-ov-file) _(github.io)_
|
||||
|
||||
#### Windows
|
||||
|
||||
最新的 windows 版本通过 [nvm-windows发行版下载](https://github.com/coreybutler/nvm-windows/releases) 地址下载安装程序
|
||||
双击 `setup` 程序按照提示操作即可完成安装。
|
||||
|
||||
#### macOS/Linux
|
||||
|
||||
```shell
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
```shell
|
||||
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
#### 快速使用
|
||||
|
||||
```shell
|
||||
# 下载并安装 Node.js 20 版本
|
||||
nvm install 20
|
||||
# 验证环境中的 Node.js 版本是否正确
|
||||
node --version # 应该打印“v20.11.1”
|
||||
# 验证环境中是否存在正确的 NPM 版本
|
||||
npm --version # 应该打印“10.2.4”
|
||||
```
|
||||
|
||||
### 展示当前使用版本
|
||||
|
||||
```shell
|
||||
nvm current
|
||||
```
|
||||
|
||||
### 安装指定版本的 node 程序
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
version 设置为 `latest` 安装最新版本或者设置为 "lts" 安装最近的 LTS(长期支持)版本。
|
||||
|
||||
```shell
|
||||
nvm install <version> [arch]
|
||||
```
|
||||
|
||||
`arch` 可以指定 `32` 或者 `64` 位版本(默认跟随系统),设置为 `all` 同时安装 32 和 64 位版本。在命令最后添加 `--insecure` 将跳过远程下载服务器的 SSL 验证。
|
||||
|
||||
### 切换使用指定版本
|
||||
|
||||
```shell
|
||||
nvm use <version> [arch]
|
||||
```
|
||||
|
||||
### 列出 node.js 已安版本
|
||||
|
||||
可选输入 available 显示可获取的版本下载列表。
|
||||
|
||||
```shell
|
||||
nvm list [available]
|
||||
```
|
||||
|
||||
### 卸载指定版本
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```shell
|
||||
# <version> 可选设置 latest/lts/newest
|
||||
nvm uninstall <version>
|
||||
```
|
||||
|
||||
启用 `newest` 指定最近安装版本。
|
||||
|
||||
```shell
|
||||
nvm use <arch> # 可选指定32/64位架构
|
||||
```
|
||||
|
||||
将继续使用当前版本,但是将切换为指定架构程序。
|
||||
|
||||
### 查看 node 运行模式
|
||||
|
||||
```shell
|
||||
nvm arch [32|64]
|
||||
```
|
||||
|
||||
查看 node 程序是运行在 `32` 位还是 `64` 位模式下,指定 `32` 或者 `64` 覆盖默认运行架构模式
|
||||
|
||||
### 检查 NVM4W 进程已知问题
|
||||
|
||||
```shell
|
||||
nvm check
|
||||
```
|
||||
|
||||
### 启用/关闭 node.js 版本管理
|
||||
|
||||
```shell
|
||||
nvm on # 启用
|
||||
nvm off # 关闭 - 不会执行任何卸载操作
|
||||
```
|
||||
|
||||
### 设置下载代理
|
||||
|
||||
```shell
|
||||
nvm proxy [url]
|
||||
```
|
||||
|
||||
可选 url 留空查看当前使用代理,设置为 "none" 移除代理设置。
|
||||
|
||||
### 设置版本存储目录
|
||||
|
||||
设置 nvm 储存不同版本的 node.js 的目录。如果未设置path,将展示当前存储目录。
|
||||
|
||||
```shell
|
||||
nvm root <path>
|
||||
```
|
||||
|
||||
### 展示当前 nvm 使用版本
|
||||
|
||||
```shell
|
||||
nvm version
|
||||
```
|
||||
|
||||
### 指定 node 镜像
|
||||
|
||||
```shell
|
||||
nvm node_mirror <node_mirror_url>
|
||||
```
|
||||
|
||||
### 指定 npm 镜像
|
||||
|
||||
```shell
|
||||
nvm npm_mirror <npm_mirror_url>
|
||||
```
|
||||
159
docs/oracle.md
@@ -8,14 +8,21 @@ Oracle 备忘清单
|
||||
### SELECT 语句
|
||||
|
||||
```sql
|
||||
SELECT * FROM beverages WHERE field1 = 'Kona' AND field2 = 'coffee' AND field3 = 122;
|
||||
SELECT *
|
||||
FROM beverages
|
||||
WHERE field1 = 'Kona'
|
||||
AND field2 = 'coffee'
|
||||
AND field3 = 122;
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### SELECT INTO 语句
|
||||
|
||||
```sql
|
||||
SELECT name,address,phone_number INTO v_employee_name,v_employee_address,v_employee_phone_number FROM employee WHERE employee_id = 6;
|
||||
SELECT name, address, phone_number
|
||||
INTO v_employee_name, v_employee_address, v_employee_phone_number
|
||||
FROM employee
|
||||
WHERE employee_id = 6;
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
@@ -25,24 +32,35 @@ SELECT name,address,phone_number INTO v_employee_name,v_employee_address,v_emplo
|
||||
使用 VALUES 关键字插入
|
||||
|
||||
```sql
|
||||
INSERT INTO table_name VALUES ('Value1', 'Value2', ... );
|
||||
INSERT INTO table_name(Column1, Column2, ... ) VALUES ( 'Value1', 'Value2', ... );
|
||||
INSERT INTO table_name
|
||||
VALUES ('Value1', 'Value2', ... );
|
||||
|
||||
INSERT INTO table_name (Column1, Column2, ... )
|
||||
VALUES ( 'Value1', 'Value2', ... );
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
使用 SELECT 语句插入
|
||||
|
||||
```sql
|
||||
INSERT INTO table_name(SELECT Value1, Value2, ... from table_name );
|
||||
INSERT INTO table_name(Column1, Column2, ... ) ( SELECT Value1, Value2, ... from table_name );
|
||||
INSERT INTO table_name
|
||||
SELECT Value1, Value2, ...
|
||||
FROM table_name;
|
||||
|
||||
INSERT INTO table_name (Column1, Column2, ...)
|
||||
SELECT Value1, Value2, ...
|
||||
FROM table_name;
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### DELETE 语句
|
||||
|
||||
```sql
|
||||
DELETE FROM table_name WHERE some_column=some_value
|
||||
DELETE FROM customer WHERE sold = 0;
|
||||
DELETE FROM table_name
|
||||
WHERE some_column = some_value;
|
||||
|
||||
DELETE FROM customer
|
||||
WHERE sold = 0;
|
||||
```
|
||||
|
||||
### UPDATE 语句
|
||||
@@ -384,7 +402,8 @@ CREATE TABLE table_name
|
||||
column1 datatype null/not null,
|
||||
column2 datatype null/not null,
|
||||
...
|
||||
CONSTRAINT constraint_name CHECK (column_name condition) [DISABLE]
|
||||
CONSTRAINT constraint_name
|
||||
CHECK (column_name condition) [DISABLE]
|
||||
);
|
||||
```
|
||||
|
||||
@@ -410,7 +429,8 @@ CREATE TABLE table_name
|
||||
column1 datatype null/not null,
|
||||
column2 datatype null/not null,
|
||||
...
|
||||
CONSTRAINT constraint_name UNIQUE (column1, column2, column_n)
|
||||
CONSTRAINT constraint_name
|
||||
UNIQUE (column1, column2, column_n)
|
||||
);
|
||||
```
|
||||
|
||||
@@ -421,7 +441,8 @@ CREATE TABLE customer
|
||||
(
|
||||
id integer not null,
|
||||
name varchar2(20),
|
||||
CONSTRAINT customer_id_constraint UNIQUE (id)
|
||||
CONSTRAINT customer_id_constraint
|
||||
UNIQUE (id)
|
||||
);
|
||||
```
|
||||
|
||||
@@ -431,14 +452,18 @@ CREATE TABLE customer
|
||||
|
||||
```sql
|
||||
ALTER TABLE [table name]
|
||||
ADD CONSTRAINT [constraint name] UNIQUE( [column name] ) USING INDEX [index name];
|
||||
ADD CONSTRAINT [constraint name]
|
||||
UNIQUE([column name])
|
||||
USING INDEX [index name];
|
||||
```
|
||||
|
||||
例如:
|
||||
|
||||
```sql
|
||||
ALTER TABLE employee
|
||||
ADD CONSTRAINT uniqueEmployeeId UNIQUE(employeeId) USING INDEX ourcompanyIndx_tbs;
|
||||
ADD CONSTRAINT uniqueEmployeeId
|
||||
UNIQUE(employeeId)
|
||||
USING INDEX ourcompanyIndx_tbs;
|
||||
```
|
||||
|
||||
### 添加外部约束
|
||||
@@ -447,14 +472,19 @@ foregin 约束的语法是:
|
||||
|
||||
```sql
|
||||
ALTER TABLE [table name]
|
||||
ADD CONSTRAINT [constraint name] FOREIGN KEY (column,...) REFERENCES table [(column,...)] [ON DELETE {CASCADE | SET NULL}]
|
||||
ADD CONSTRAINT [constraint name]
|
||||
FOREIGN KEY (column,...)
|
||||
REFERENCES table [(column,...)]
|
||||
[ON DELETE {CASCADE | SET NULL}];
|
||||
```
|
||||
|
||||
例如:
|
||||
|
||||
```sql
|
||||
ALTER TABLE employee
|
||||
ADD CONSTRAINT fk_departament FOREIGN KEY (departmentId) REFERENCES departments(Id);
|
||||
ADD CONSTRAINT fk_departament
|
||||
FOREIGN KEY (departmentId)
|
||||
REFERENCES departments(Id);
|
||||
```
|
||||
|
||||
### 删除约束
|
||||
@@ -482,13 +512,17 @@ INDEXES
|
||||
|
||||
```sql
|
||||
CREATE [UNIQUE] INDEX index_name
|
||||
ON table_name (column1, column2, . column_n)
|
||||
ON table_name (
|
||||
column1,
|
||||
column2,
|
||||
.
|
||||
column_n
|
||||
)
|
||||
[ COMPUTE STATISTICS ];
|
||||
```
|
||||
|
||||
`UNIQUE` 表示索引列中值的组合必须是唯一的
|
||||
|
||||
`COMPUTE STATISTICS` 告诉 Oracle 在创建索引期间收集统计信息。 然后优化器使用这些统计信息来选择执行语句时的最佳执行计划。例如:
|
||||
- `UNIQUE` 表示索引列中值的组合必须是唯一的
|
||||
- `COMPUTE STATISTICS` 告诉 Oracle 在创建索引期间收集统计信息。然后优化器使用这些统计信息来选择执行语句时的最佳执行计划。例如:
|
||||
|
||||
```sql
|
||||
CREATE INDEX customer_idx
|
||||
@@ -604,7 +638,8 @@ DBA 相关
|
||||
创建用户的语法是:
|
||||
|
||||
```sql
|
||||
CREATE USER username IDENTIFIED BY password;
|
||||
CREATE USER username
|
||||
IDENTIFIED BY password;
|
||||
```
|
||||
|
||||
例如:
|
||||
@@ -641,6 +676,90 @@ ALTER USER username IDENTIFIED BY password;
|
||||
ALTER USER brian IDENTIFIED BY brianpassword;
|
||||
```
|
||||
|
||||
### 查看表空间的名称以及大小
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```sql
|
||||
SELECT t.table_name,
|
||||
ROUND(SUM(bytes / (1024 * 1024)), 0) AS ts_size
|
||||
FROM dba_tablespaces t,
|
||||
dba_data_files d
|
||||
WHERE t.table_name = d.table_name
|
||||
GROUP BY t.table_name;
|
||||
```
|
||||
|
||||
### 查看还没提交的事务
|
||||
|
||||
```sql
|
||||
select * from v$locked_object;
|
||||
select * from v$transaction;
|
||||
```
|
||||
|
||||
### 查看数据库库对象
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```sql
|
||||
SELECT owner, object_type, status, COUNT(*) AS count#
|
||||
FROM all_objects
|
||||
GROUP BY owner, object_type, status;
|
||||
```
|
||||
|
||||
### 查看数据库的版本
|
||||
|
||||
```sql
|
||||
SELECT version
|
||||
FROM Product_component_version
|
||||
WHERE SUBSTR(PRODUCT, 1, 6) = 'Oracle';
|
||||
```
|
||||
|
||||
### 查看数据库的创建日期和归档方式
|
||||
|
||||
```sql
|
||||
SELECT created, Log_Mode, Log_Mode
|
||||
FROM v$Database;
|
||||
```
|
||||
|
||||
### 查看控制文件
|
||||
|
||||
```sql
|
||||
select name from v$controlfile;
|
||||
```
|
||||
|
||||
### 查看日志文件
|
||||
|
||||
```sql
|
||||
select member from v$logfile;
|
||||
```
|
||||
|
||||
### 查看表空间的使用情況
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```sql
|
||||
SELECT SUM(bytes)/(1024*1024) AS free_space,
|
||||
tablespace_name
|
||||
FROM dba_free_space
|
||||
GROUP BY tablespace_name;
|
||||
```
|
||||
|
||||
### 捕捉运行很久的SOL
|
||||
|
||||
```sql
|
||||
COLUMN username FORMAT A12
|
||||
COLUMN opname FORMAT A16
|
||||
COLUMN progress FORMAT A8
|
||||
|
||||
SELECT username,
|
||||
sid,
|
||||
opname,
|
||||
ROUND(sofar * 100 / totalwork, 0) || '%' AS progress,
|
||||
time_remaining,
|
||||
sql_text
|
||||
FROM v$session_longops, v$sql
|
||||
WHERE time_remaining <> 0
|
||||
AND sql_address = address
|
||||
AND sql_hash_value = hash_value;
|
||||
```
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
||||
168
docs/pandoc.md
Normal file
@@ -0,0 +1,168 @@
|
||||
Pandoc 备忘清单
|
||||
===
|
||||
|
||||
Pandoc 是一个文档转换器,这个 [pandoc](https://pandoc.org/) 备忘单包含 pandoc 命令和一些常见的 pandoc 技巧
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 语法
|
||||
|
||||
```bash
|
||||
$ pandoc -s [source file] -o [output file]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
- [Pandoc 官方文档](https://pandoc.org/)
|
||||
|
||||
#### 安装
|
||||
|
||||
安装命令 | 环境
|
||||
:-|-
|
||||
`$ brew install pandoc` | macos
|
||||
`$ choco install pandoc` | windows
|
||||
|
||||
#### Debian/Ubuntu
|
||||
|
||||
```bash
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install pandoc
|
||||
```
|
||||
|
||||
#### Fedora
|
||||
|
||||
```bash
|
||||
$ sudo dnf install pandoc
|
||||
```
|
||||
|
||||
#### Arch Linux
|
||||
|
||||
```bash
|
||||
$ sudo pacman -S pandoc
|
||||
```
|
||||
|
||||
### 将 LaTeX 转换为 MS Word
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
简单的 `.tex` 到 `.docx`
|
||||
|
||||
```bash
|
||||
$ pandoc -s file.tex -o file.docx
|
||||
```
|
||||
|
||||
将 `.tex` 转换为 `.docx` 并使用默认引文
|
||||
|
||||
```bash
|
||||
$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib -o file.docx
|
||||
```
|
||||
|
||||
将 `.tex` 文件转换为 `.docx` 文件,并注明具体引文
|
||||
|
||||
```bash
|
||||
$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib --csl=apa.csl -o file.docx
|
||||
```
|
||||
|
||||
`.tex` 到 `.docx`,带交叉引用
|
||||
|
||||
```bash
|
||||
$ pandoc -s file.tex --filter pandoc-crossref -o file.docx
|
||||
```
|
||||
|
||||
使用示例
|
||||
---
|
||||
|
||||
### 转换文件格式
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.pdf
|
||||
```
|
||||
|
||||
### 支持的输入格式
|
||||
|
||||
```bash
|
||||
$ pandoc -s input.txt -o output.html
|
||||
```
|
||||
|
||||
### 自定义输出格式
|
||||
|
||||
```bash
|
||||
$ pandoc input.md --to=latex -o output.tex
|
||||
```
|
||||
|
||||
### 添加元数据
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.pdf --metadata title="My Document"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 从 URL 转换
|
||||
|
||||
```bash
|
||||
$ pandoc https://example.com/document.md -o output.pdf
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 生成幻灯片
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -t beamer -o output.pdf
|
||||
```
|
||||
|
||||
### 合并文件
|
||||
|
||||
```bash
|
||||
$ pandoc file1.md file2.md -o output.pdf
|
||||
```
|
||||
|
||||
### 指定样式文件
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.pdf --css=style.css
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 转换为 AsciiDoc
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.asciidoc
|
||||
```
|
||||
|
||||
### 转换为 Docx 格式
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.docx
|
||||
```
|
||||
|
||||
### 执行 Lua 过滤器
|
||||
|
||||
```bash
|
||||
$ pandoc input.md --lua-filter=custom-filter.lua -o output.pdf
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 自动生成目录
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.pdf --toc
|
||||
```
|
||||
|
||||
### 禁用目录编号
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.pdf --toc --toc-depth=2
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 显示详细信息
|
||||
|
||||
```bash
|
||||
$ pandoc input.md -o output.pdf -v
|
||||
```
|
||||
|
||||
### 查看支持的输出格式
|
||||
|
||||
```bash
|
||||
$ pandoc --list-output-formats
|
||||
```
|
||||
177
docs/phpstorm.md
Normal file
@@ -0,0 +1,177 @@
|
||||
PhpStorm 键盘快捷键
|
||||
===
|
||||
|
||||
在 JetBrains PhpStorm 中发现的 96 个键盘快捷键的可视化备忘表
|
||||
|
||||
键盘快捷键
|
||||
---
|
||||
|
||||
### 编辑
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `Space` | 基本代码补全
|
||||
`Alt` `Enter` | 显示意图操作和快速修复
|
||||
`Ctrl` `P` | 参数信息(在方法调用参数中)
|
||||
`Ctrl` `Q` | 快速文档查询
|
||||
`Ctrl` `(鼠标悬停在代码上)` | 简要信息
|
||||
`Alt` `Insert` | 生成代码...(Getters、Setters、Constructors)
|
||||
`Ctrl` `O` | 覆盖方法
|
||||
`Ctrl` `I` | 实现方法
|
||||
`Ctrl` `Alt` `T` | 包围...(if..else, try..catch, for, 等)
|
||||
`Ctrl` `/` | 使用行注释进行注释/取消注释
|
||||
`Ctrl` `Shift` `/` | 使用块注释进行注释/取消注释
|
||||
`Ctrl` `W` | 逐渐选择增加的代码块
|
||||
`Ctrl` `Shift` `W` | 将当前选择减少到先前的状态
|
||||
`Ctrl` `Alt` `L` | 重新格式化代码
|
||||
`Ctrl` `Alt` `I` | 自动缩进行
|
||||
`Ctrl` `D` | 复制当前行或选定的块
|
||||
`Ctrl` `Y` | 删除插入符处的行
|
||||
`Ctrl` `Shift` `J` | 智能行合并(仅限 HTML 和 JavaScript)
|
||||
`Ctrl` `Enter` | 智能行拆分(仅限 HTML 和 JavaScript)
|
||||
`Shift` `Enter` | 开始新行
|
||||
`Ctrl` `Shift` `U` | 切换插入符处单词或选定的块的大小写
|
||||
`Ctrl` `Shift` `[` | 选择至代码块开头
|
||||
`Ctrl` `Shift` `]` | 选择至代码块结尾
|
||||
`Ctrl` `Delete` | 删除至字词末尾
|
||||
`Ctrl` `Backspace` | 删除至字词开头
|
||||
`Ctrl` `+/-` | 展开/折叠代码块
|
||||
`Ctrl` `F4` | 关闭活动编辑器标签
|
||||
`Ctrl` `Shift` `V` | 从历史粘贴
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 调试
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`F8` | 逐步执行
|
||||
`F7` | 逐步进入
|
||||
`Shift` `F8` | 逐步退出
|
||||
`Alt` `F8` | 评估表达式
|
||||
`F9` | 恢复程序
|
||||
`Ctrl` `F8` | 切换断点
|
||||
`Ctrl` `Shift` `F8` | 查看断点
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 运行
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Shift` `F10` | 运行
|
||||
`Shift` `F9` | 调试
|
||||
`Ctrl` `Shift` `F10` | 从编辑器运行上下文配置
|
||||
`Ctrl` `Shift` `X` | 运行命令行
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 搜索/替换
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `F/R` | 查找/替换
|
||||
`F3` | 查找下一个
|
||||
`Shift` `F3` | 查找上一个
|
||||
`Ctrl` `Shift` `F/R` | 在路径中查找/替换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用搜索
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Alt` `F7` | 查找用法
|
||||
`Ctrl` `F7` | 在文件中查找用法
|
||||
`Ctrl` `Shift` `F7` | 在文件中突出显示用法
|
||||
`Ctrl` `Alt` `F7` | 显示用法
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 导航
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `N` | 转到类
|
||||
`Ctrl` `Shift` `N` | 转到文件
|
||||
`Ctrl` `Shift` `Alt` `N` | 转到符号
|
||||
`Ctrl` `G` | 转到行
|
||||
`Alt` `Left/Right` | 转到下一个/上一个编辑器标签
|
||||
`Esc` | 转到编辑器(从工具窗口)
|
||||
`Ctrl` `E` | 最近的文件弹出窗口
|
||||
`Ctrl` `Alt` `Left/Right` | 后退/前进导航
|
||||
`Ctrl` `Shift` `Backspace` | 转到上次编辑位置
|
||||
`Alt` `F1` | 在任何视图中选择当前文件或符号
|
||||
`Ctrl` `B` | 转到声明
|
||||
`Ctrl` `Alt` `B` | 转到实现
|
||||
`Ctrl` `Shift` `I` | 打开快速定义查找
|
||||
`Ctrl` `Shift` `B` | 转到类型声明
|
||||
`Ctrl` `U` | 转到超类/超方法
|
||||
`Alt` `Up/Down` | 转到上一个/下一个方法
|
||||
`Ctrl` `]/[` | 移动至代码块结束/开始
|
||||
`F2` | 下一个突出显示的错误
|
||||
`Shift` `F2` | 上一个突出显示的错误
|
||||
`F4` | 编辑/查看源码
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 重构
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`F5/F6` | 复制/移动
|
||||
`Alt` `Delete` | 安全删除
|
||||
`Shift` `F6` | 重命名
|
||||
`Ctrl` `Alt` `N` | 内联变量
|
||||
`Ctrl` `Alt` `M/V/F/C` | 提取方法/变量/字段/常量
|
||||
`Ctrl` `Alt` `Shift` `T` | 重构此处(显示所有可用的重构)
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### VCS/本地历史
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Alt` <code>\`</code> | VCS 快速弹出窗口
|
||||
`Ctrl` `K` | 提交项目到 VCS
|
||||
`Ctrl` `T` | 从 VCS 更新项目
|
||||
`Alt` `Shift` `C` | 查看最近的更改
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 通用
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Shift x2` | 到处搜索
|
||||
`Ctrl` `Shift` `A` | 查找操作
|
||||
`Alt` `1-9` | 打开对应的工具窗口
|
||||
`Ctrl` `Alt` `F11` | 切换全屏模式
|
||||
`Ctrl` `Shift` `F12` | 切换最大化编辑器
|
||||
`Alt` `Shift` `F` | 添加到收藏夹
|
||||
`Alt` `Shift` `I` | 使用当前配置文件检查当前文件
|
||||
`Ctrl` `Alt` `S` | 打开设置对话框
|
||||
`Ctrl` `Tab` | 在标签和工具窗口之间切换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 模板/代码片段
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `J` | 插入模板
|
||||
`eco` | 'echo' 语句
|
||||
`fore` | foreach(iterable_expr as $value) {...}
|
||||
`forek` | foreach(iterable_expr as $key => $value) {...}
|
||||
`inc/inco` | 'include'/'include_once' 语句
|
||||
`prif` | 私有函数
|
||||
`prof` | 受保护函数
|
||||
`pubf` | 公共函数
|
||||
`rqr/rqro` | 'require'/'require_once' 语句
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 其他
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`Ctrl` `Shift` `A` | 查找操作
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
- [PhpStorm 键盘快捷键](https://resources.jetbrains.com/storage/products/phpstorm/docs/PhpStorm_ReferenceCard.pdf) _(resources.jetbrains.com)_
|
||||
@@ -1851,6 +1851,12 @@ brew upgrade pipenv # homebrew
|
||||
```
|
||||
|
||||
```shell
|
||||
# 将 pipenv 命令加入到系统环境变量 $PATH 中 (Unix and MacOS)
|
||||
dir=$(python -c 'import site; print(site.USER_BASE + "/bin")') # 打印 python site-packages bin 路径
|
||||
echo 'export PATH="'$dir':$PATH"' >> ~/.zshrc # 将 dir 路径加入到 PATH 中
|
||||
source ~/.zshrc
|
||||
|
||||
|
||||
# 安装 package
|
||||
pipenv install <package name> # 不指定版本
|
||||
pipenv install <package name>==<version> # 精确指定版本
|
||||
|
||||
@@ -174,6 +174,30 @@ tensor([2., 2., 2., 2., 2.], dtype=torch.float64)
|
||||
|
||||
注意: 所有在CPU上的Tensors, 除了CharTensor, 都可以转换为Numpy array并可以反向转换.
|
||||
|
||||
### squeeze函数
|
||||
|
||||
```python
|
||||
>>> x = torch.rand(1, 2, 1, 28, 1)
|
||||
>>> x.squeeze().shape # squeeze不加参数,默认去除所有为1的维度
|
||||
torch.Size([2, 28])
|
||||
>>> x.squeeze(dim=0).shape # squeeze加参数,去除指定为1的维度
|
||||
torch.Size([2, 1, 28, 1])
|
||||
>>> x.squeeze(1).shape # squeeze加参数,如果不为1,则不变
|
||||
torch.Size([1, 2, 1, 28, 1])
|
||||
>>> torch.squeeze(x,-1).shape # 既可以是函数,也可以是方法
|
||||
torch.Size([1, 2, 1, 28])
|
||||
```
|
||||
|
||||
### unsqueeze函数
|
||||
|
||||
```python
|
||||
>>> x = torch.rand(2, 28)
|
||||
>>> x.unsqueeze(0).shape # unsqueeze必须加参数, _ 2 _ 28 _
|
||||
torch.Size([1, 2, 28]) # 参数代表在哪里添加维度 0 1 2
|
||||
>>> torch.unsqueeze(x, -1).shape # 既可以是函数,也可以是方法
|
||||
torch.Size([2, 28, 1])
|
||||
```
|
||||
|
||||
导入 Imports
|
||||
---
|
||||
|
||||
|
||||
@@ -473,6 +473,7 @@ const school = <div>学校</div>;
|
||||
`<!--rehype:className=style-none-->` | \<li> 没有标记样式
|
||||
`<!--rehype:className=style-timeline-->` | `时间轴`样式
|
||||
`<!--rehype:className=style-arrow-->` | `箭头`标记
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### KaTeX 数学渲染
|
||||
|
||||
|
||||
295
docs/r.md
Normal file
@@ -0,0 +1,295 @@
|
||||
R 备忘清单
|
||||
===
|
||||
|
||||
该备忘单提供了使用 R 语言的示例,涵盖 R 语言基础知识、控制流、类型、结构/类、运算符、函数方法等
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 获取帮助
|
||||
|
||||
访问帮助文件
|
||||
|
||||
```r
|
||||
?mean
|
||||
# 获取特定功能的帮助
|
||||
help.search('weighted mean')
|
||||
# 在帮助文件中搜索单词或短语
|
||||
help(package = 'dplyr')
|
||||
# 查找软件包的帮助。
|
||||
```
|
||||
|
||||
有关对象的更多信息
|
||||
|
||||
```r
|
||||
str(iris)
|
||||
# 获取对象结构的摘要
|
||||
class(iris)
|
||||
# 查找对象所属的类
|
||||
```
|
||||
|
||||
### 下载和使用库
|
||||
|
||||
```r
|
||||
install.packages('dplyr')
|
||||
# 从 CRAN 下载并安装软件包
|
||||
install.packages(“BiocManager”)
|
||||
library(BiocManager)
|
||||
BiocManager::install("dplyr")
|
||||
# 使用Bioconductor的BiocManager包下载并安装软件包
|
||||
devtools::install_github("clusterProfiler")
|
||||
# 直接从github中下载并安装软件包
|
||||
library(dplyr)
|
||||
# 将包加载到会话中,使所有其功能可供使用
|
||||
dplyr::select
|
||||
# 使用包中的特定函数
|
||||
data(iris)
|
||||
# 将内置数据集加载到环境中。
|
||||
```
|
||||
|
||||
### 工作目录
|
||||
|
||||
查找当前工作目录(其中找到输入并发送输出)
|
||||
|
||||
```r
|
||||
getwd()
|
||||
```
|
||||
|
||||
更改当前工作目录
|
||||
|
||||
```r
|
||||
setwd(‘C://file/path’)
|
||||
```
|
||||
|
||||
使用 RStudio 中的项目来设置工作目录到您正在使用的文件夹
|
||||
|
||||
基础入门
|
||||
---
|
||||
|
||||
### 变量和赋值
|
||||
|
||||
```R
|
||||
x <- 10 # 使用箭头赋值
|
||||
y = 20 # 或者直接使用等号赋值
|
||||
```
|
||||
|
||||
### 数据类型
|
||||
|
||||
```R
|
||||
numeric_var <- 3.14 # 数值型
|
||||
character_var <- "hello" # 字符串
|
||||
logical_var <- TRUE # 逻辑型
|
||||
```
|
||||
|
||||
### 向量和列表
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```R
|
||||
# 向量
|
||||
numeric_vector <- c(1, 2, 3, 4)
|
||||
character_vector <- c("apple", "orange", "banana")
|
||||
|
||||
# 列表
|
||||
my_list <- list(name = "John", age = 30, city = "New York")
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
向量和操作
|
||||
|
||||
```r
|
||||
# 创建向量
|
||||
numbers <- c(1, 2, 3, 4, 5)
|
||||
# 计算向量的和
|
||||
sum_result <- sum(numbers)
|
||||
# 计算向量的平均值
|
||||
mean_result <- mean(numbers)
|
||||
```
|
||||
|
||||
### 数据框(Data Frame)
|
||||
|
||||
```R
|
||||
my_df <- data.frame(name = c("John", "Alice"), age = c(30, 25))
|
||||
|
||||
# 创建数据框
|
||||
student_data <- data.frame(
|
||||
name = c("John", "Alice", "Bob"),
|
||||
age = c(25, 23, 22),
|
||||
grade = c("A", "B", "C")
|
||||
)
|
||||
|
||||
# 显示数据框
|
||||
print(student_data)
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 函数
|
||||
|
||||
```R
|
||||
# 定义函数
|
||||
add_numbers <- function(a, b) {
|
||||
result <- a + b
|
||||
return(result)
|
||||
}
|
||||
|
||||
# 调用函数
|
||||
sum_result <- add_numbers(10, 5)
|
||||
```
|
||||
|
||||
### 条件语句
|
||||
|
||||
```R
|
||||
if (x > 0) {
|
||||
print("Positive")
|
||||
} else {
|
||||
print("Non-positive")
|
||||
}
|
||||
```
|
||||
|
||||
### for 循环语句
|
||||
|
||||
```R
|
||||
for (i in 1:5) {
|
||||
print(i)
|
||||
}
|
||||
```
|
||||
|
||||
### while 循环
|
||||
|
||||
```r
|
||||
counter <- 1
|
||||
while (counter <= 5) {
|
||||
print(counter)
|
||||
counter <- counter + 1
|
||||
}
|
||||
```
|
||||
|
||||
### 数据读取和输出
|
||||
|
||||
```R
|
||||
# 读取数据
|
||||
my_data <- read.csv("data.csv")
|
||||
# 输出数据
|
||||
write.csv(my_data, "output.csv")
|
||||
```
|
||||
|
||||
### 清理工作空间
|
||||
|
||||
```r
|
||||
# 清空所有变量
|
||||
rm(list = ls())
|
||||
# 退出 R
|
||||
q()
|
||||
```
|
||||
|
||||
图形绘制
|
||||
---
|
||||
|
||||
### 散点图
|
||||
|
||||
```R
|
||||
plot(x, y)
|
||||
```
|
||||
|
||||
### 直方图
|
||||
|
||||
```R
|
||||
hist(data)
|
||||
```
|
||||
|
||||
### 线图
|
||||
|
||||
```R
|
||||
plot(x, y, type = "l")
|
||||
```
|
||||
|
||||
### 绘制散点图
|
||||
|
||||
```R
|
||||
x <- c(1, 2, 3, 4, 5)
|
||||
y <- c(2, 4, 5, 6, 7)
|
||||
plot(x, y, main = "Scatter Plot", xlab = "X-axis", ylab = "Y-axis")
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 绘制直方图
|
||||
|
||||
```R
|
||||
data <- c(1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5)
|
||||
hist(data, main = "Histogram", xlab = "Value", col = "lightblue")
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 绘制折线图
|
||||
|
||||
```R
|
||||
x <- c(1, 2, 3, 4, 5)
|
||||
y <- c(2, 4, 5, 6, 7)
|
||||
plot(x, y, type = "l", main = "Line Plot", xlab = "X-axis", ylab = "Y-axis")
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
向量
|
||||
---
|
||||
|
||||
### 创建向量
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
:- | - | -
|
||||
-------|-------|-------
|
||||
`c(2, 4, 6)` | 2 4 6 | 将元素连接成向量
|
||||
`2:6` | 2 3 4 5 6 | 整数序列
|
||||
`seq(2, 3, by=0.5)` | 2.0 2.5 3.0 | 复杂的序列
|
||||
`rep(1:2, times=3)` | 1 2 1 2 1 2 | 重复向量
|
||||
`rep(1:2, each=3)` | 1 1 1 2 2 2 | 重复向量的元素
|
||||
|
||||
### 选择向量元素
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
#### 按位置
|
||||
|
||||
:- | -
|
||||
----|----
|
||||
`x[4]` | 第四个元素
|
||||
`x[-4]` | 除了第四个之外的所有
|
||||
`x[2:4]` | 元素二到四
|
||||
`x[-(2:4)]` | 除二到四之外的所有元素
|
||||
`x[c(1, 5)]` | 元素一和元素五
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
#### 按值
|
||||
|
||||
:- | -
|
||||
----|----
|
||||
`x[x == 10]` | 等于 10 的元素
|
||||
`x[x < 0]` | 所有元素小于零
|
||||
`x[x %in% c(1, 2, 5)]` | 集合 1, 2, 5 中的元素
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
#### 命名向量
|
||||
|
||||
:- | -
|
||||
----|----
|
||||
`x['apple']` | 名为“apple”的元素。
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### 重复向量的元素
|
||||
|
||||
:- | -
|
||||
----|----
|
||||
`sort(x)` | 返回排序后的 x
|
||||
`rev(x)` | 返回 x 的反转
|
||||
`table(x)` | 查看值的计数
|
||||
`unique(x)`| 查看唯一值
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
- [全面了解Base R](https://blanket58.github.io/books/study-notes-of-R/) _(github.io)_
|
||||
- [R 语言官网](https://www.r-project.org/) _(r-project.org)_
|
||||
- [数据科学 R](https://r4ds.hadley.nz/) _(hadley.nz)_
|
||||
- [使用 R 进行整洁的建模](https://www.tmwr.org/) _(tmwr.org)_
|
||||
- [在 R 中使用 mlr3 进行应用机器学习](https://mlr3book.mlr-org.com/) _(mlr-org.com)_
|
||||
- [深度学习](https://srdas.github.io/DLBook/) _(github.io)_
|
||||
- [搜索任何与 R 相关的内容](https://rdrr.io/) _(rdrr.io)_
|
||||
- [R 文档](https://www.rdocumentation.org/) _(rdocumentation.org)_
|
||||
389
docs/sdkman.md
Normal file
@@ -0,0 +1,389 @@
|
||||
SDKMAN 备忘清单
|
||||
====
|
||||
|
||||
[SDKMAN](http://sdkman.io) 是一款管理 java 体系中的各类 SDK 版本的工具,可以用于大多数基于 Uinx 的系统
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 安装
|
||||
|
||||
macOS/Linux
|
||||
|
||||
```bash
|
||||
curl -s "https://get.sdkman.io" \| bash
|
||||
```
|
||||
|
||||
Windows 需要 (WSL Approach) 或者 (Git Bash Approach)
|
||||
|
||||
```bash
|
||||
curl -s "https://get.sdkman.io" \| bash
|
||||
```
|
||||
|
||||
初始化 SDKMAN
|
||||
|
||||
```bash
|
||||
source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||
```
|
||||
|
||||
查看 sdkman 是否安装成功
|
||||
|
||||
```bash
|
||||
$ sdk version
|
||||
```
|
||||
|
||||
### 获取帮助
|
||||
|
||||
您可以通过运行以下命令获得基本帮助:
|
||||
|
||||
```bash
|
||||
$ sdk help
|
||||
```
|
||||
|
||||
这将提供一个有用的顶级帮助页面。您可以向该命令添加限定符以获得有关特定子命令的帮助
|
||||
|
||||
```bash
|
||||
$ sdk help install
|
||||
```
|
||||
|
||||
### 查看
|
||||
|
||||
列出所有可用的 SDKs
|
||||
|
||||
```bash
|
||||
sdk list
|
||||
```
|
||||
|
||||
查看当前使用的 SDK
|
||||
|
||||
```bash
|
||||
$ sdk current
|
||||
```
|
||||
|
||||
查看特定 SDK 的版本列表(例如,Java)
|
||||
|
||||
```bash
|
||||
$ sdk list java
|
||||
```
|
||||
|
||||
### 安装卸载
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
安装特定版本的 SDK(例如,Java)
|
||||
|
||||
```bash
|
||||
$ sdk install java <version>
|
||||
```
|
||||
|
||||
使用已安装的 SDK(例如,Java)
|
||||
|
||||
```bash
|
||||
$ sdk use java <version>
|
||||
```
|
||||
|
||||
使用已安装的 SDK(例如,Java)
|
||||
|
||||
```bash
|
||||
$ sdk use java <version>
|
||||
```
|
||||
|
||||
卸载 SDK(例如,Java)
|
||||
|
||||
```bash
|
||||
$ sdk uninstall java <version>
|
||||
```
|
||||
|
||||
列出所有已安装的 SDKs
|
||||
|
||||
```bash
|
||||
$ sdk list installed
|
||||
```
|
||||
|
||||
删除一个指定版本
|
||||
|
||||
```bash
|
||||
$ sdk uninstall scala 3.4.1
|
||||
```
|
||||
|
||||
### 更新
|
||||
|
||||
更新 SDKMAN 自身
|
||||
|
||||
```bash
|
||||
$ sdk selfupdate
|
||||
```
|
||||
|
||||
更新已安装的 SDKs
|
||||
|
||||
```bash
|
||||
$ sdk update
|
||||
```
|
||||
|
||||
设置默认的 SDK 版本(例如,Java)
|
||||
|
||||
```bash
|
||||
$ sdk default java <version>
|
||||
```
|
||||
|
||||
### 帮助
|
||||
|
||||
查看 SDKMAN 所有可用的命令
|
||||
|
||||
```bash
|
||||
$ sdk help
|
||||
```
|
||||
|
||||
这些命令可以帮助你安装、管理和使用不同版本的 SDK,如 Java、Groovy、Gradle、Maven 等。
|
||||
|
||||
### 安装本地版本
|
||||
|
||||
使用快照版本?已经在本地安装了吗?通过指定本地安装的路径来安装本地版本:
|
||||
|
||||
```bash
|
||||
$ sdk install groovy 3.0.0-SNAPSHOT /path/to/groovy-3.0.0-SNAPSHOT
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
```bash
|
||||
$ sdk install java 17-zulu /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 使用版本
|
||||
|
||||
查看已安装的 SDKs**:
|
||||
|
||||
```bash
|
||||
$ sdk list installed
|
||||
```
|
||||
|
||||
切换使用特定版本的 SDK(例如,Java):
|
||||
|
||||
```bash
|
||||
$ sdk use java <version>
|
||||
$ sdk use scala 3.4.1
|
||||
```
|
||||
|
||||
设置默认使用的 SDK 版本(例如,Java):
|
||||
|
||||
```bash
|
||||
$ sdk default java <version>
|
||||
$ sdk default scala 3.4.1
|
||||
```
|
||||
|
||||
### 查看当前使用的版本
|
||||
|
||||
要查 sdk 当前使用的版本:
|
||||
|
||||
```shell
|
||||
$ sdk current java
|
||||
Using java version 21.0.2-tem
|
||||
```
|
||||
|
||||
要查看所有 sdk 当前使用的版本:
|
||||
|
||||
```shell
|
||||
$ sdk current
|
||||
Using:
|
||||
groovy: 4.0.20
|
||||
java: 21.0.2-tem
|
||||
scala: 3.4.1
|
||||
```
|
||||
|
||||
### 配置 ENV
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
切换到特定的 JDK 或 SDK,通过项目基本目录中的 `.sdkmanrc` 文件来实现。执行下面命令自动生配置文件:
|
||||
|
||||
```bash
|
||||
$ sdk env init
|
||||
```
|
||||
|
||||
现在已经在当前目录中创建了一个包含以下内容的配置文件:
|
||||
|
||||
```shell
|
||||
# Enable auto-env through the sdkman_auto_env config
|
||||
# Add key=value pairs of SDKs to use below
|
||||
|
||||
java=21.0.2-tem
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
切换到 `.sdkmanrc`文件中的配置,只需发出以下命令:
|
||||
|
||||
```bash
|
||||
$ sdk env
|
||||
# 您应该看到如下输出:
|
||||
# Using java version 21.0.2-tem in this shell.
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
通过下面命令,将 SDK 重置为默认版本
|
||||
|
||||
```shell
|
||||
$ sdk env clear
|
||||
```
|
||||
|
||||
安装 `.sdkmanrc` 配置文件中指定丢失的 SDK
|
||||
|
||||
```shell
|
||||
$ sdk env install
|
||||
```
|
||||
|
||||
在 cd 到目录中时自动切换 SDK 版本,可以通过在 sdkman 配置中设置 `sdkman_auto_env=true` 来实现。请注意,这也会在离开目录时将任何特定于项目的SDK重置为默认版本。
|
||||
|
||||
### 升级版本
|
||||
|
||||
升级特定 SDK 到最新版本
|
||||
|
||||
```shell
|
||||
$ sdk upgrade springboot
|
||||
```
|
||||
|
||||
要查看所有 SDK 的过时内容:
|
||||
|
||||
```shell
|
||||
$ sdk upgrade
|
||||
```
|
||||
|
||||
### SDKMAN 版本
|
||||
|
||||
```shell
|
||||
$ sdk version
|
||||
|
||||
SDKMAN!
|
||||
script: 5.7.0
|
||||
native: 0.1.3
|
||||
```
|
||||
|
||||
### 自动更新
|
||||
|
||||
安装新版本的 `SDKMAN` 如果可用
|
||||
|
||||
```bash
|
||||
$ sdk selfupdate
|
||||
```
|
||||
|
||||
通过将 force 参数传递给命令强制重新安装:
|
||||
|
||||
```bash
|
||||
$ sdk selfupdate force
|
||||
```
|
||||
|
||||
自动每日检查新版本的SDKMAN!也将代表用户执行。
|
||||
|
||||
### Home
|
||||
|
||||
获取 SDK 所在位置的绝对路径
|
||||
|
||||
```shell
|
||||
$ sdk home java 21.0.2-tem
|
||||
|
||||
# /home/myuser/.sdkman/candidates/java/21.0.2-tem
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### Flush
|
||||
|
||||
应该很少需要刷新 `SDKMAN` 。flush 命令有助于实现这一点,因此您不需要删除任何目录。
|
||||
|
||||
```bash
|
||||
$ sdk flush
|
||||
```
|
||||
|
||||
手动删除像 `.sdkman/tmp` 目录这样的目录会破坏 sdkman!请始终使用 flush 命令!
|
||||
|
||||
### 离线模式
|
||||
|
||||
启用强制脱机模式
|
||||
|
||||
```shell
|
||||
$ sdk offline enable
|
||||
```
|
||||
|
||||
重新启用联机模式
|
||||
|
||||
```shell
|
||||
$ sdk offline disable
|
||||
```
|
||||
|
||||
离线模式下显示当前安装的和活动的版本:
|
||||
|
||||
```shell
|
||||
$ sdk list groovy
|
||||
# ---------------------------
|
||||
#
|
||||
# 离线模式:仅显示已安装的groovy版本
|
||||
# --------------------------
|
||||
# >
|
||||
# > 2.4.4
|
||||
#
|
||||
# - 2.4.3
|
||||
#
|
||||
# --------------------------
|
||||
#
|
||||
# - - installed
|
||||
# >
|
||||
# > - currently in use
|
||||
# >
|
||||
# ---------------------------
|
||||
```
|
||||
|
||||
当互联网可用/不可用时,离线模式也将自动禁用/启用。当然,需要互联网连接的命令不会起作用,但会发出警告。
|
||||
|
||||
### 更新
|
||||
|
||||
当 SDK 元数据可能变得过时时,会显示一条警告,并说明如何更新。
|
||||
|
||||
```shell
|
||||
WARNING: SDKMAN is out-of-date and requires an update.
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
只需运行以下命令,就可以刷新 SDK 缓存,并且可以安装新的 SDK 缓存:
|
||||
|
||||
```shell
|
||||
$ sdk update
|
||||
# Adding new candidates(s): kotlin
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
定期更新 `SDKMAN` 需要更新以了解新的(或已删除的)SDK。
|
||||
|
||||
### 配置
|
||||
|
||||
可以在 `~/.sdkman/etc/config` 文件中找到配置。要编辑配置,可以发出 `sdk-config` 命令在系统编辑器中编辑此文件。以下配置可用:
|
||||
|
||||
```ini
|
||||
# 使 sdkman 成为非交互式的,适用于 CI 环境
|
||||
sdkman_auto_answer=true|false
|
||||
|
||||
# 检查更新版本并提示更新
|
||||
sdkman_selfupdate_feature=true|false
|
||||
|
||||
# 禁用 SSL 证书验证
|
||||
# https://github.com/sdkman/sdkman-cli/issues/327
|
||||
# HERE BE DRAGONS....
|
||||
sdkman_insecure_ssl=true|false
|
||||
|
||||
# 配置 curl 超时
|
||||
sdkman_curl_connect_timeout=5
|
||||
sdkman_curl_continue=true
|
||||
sdkman_curl_max_time=10
|
||||
|
||||
# 订阅测试版频道
|
||||
sdkman_beta_channel=true|false
|
||||
|
||||
# 启用详细调试
|
||||
sdkman_debug_mode=true|false
|
||||
|
||||
# 启用色彩模式
|
||||
sdkman_colour_enable=true|false
|
||||
|
||||
# 启用自动环境
|
||||
sdkman_auto_env=true|false
|
||||
|
||||
# 启用 bash 或 zsh 自动完成功能
|
||||
sdkman_auto_complete=true|false
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
323
docs/sketch.md
@@ -6,129 +6,230 @@ Sketch 备忘清单
|
||||
快捷键
|
||||
---
|
||||
|
||||
### 插入
|
||||
### 常规
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
| ----- | ---- |
|
||||
| `a` | (New Artboard) 新画板 |
|
||||
| `s` | (Slice) 切片 |
|
||||
| `r` | (Rectangle) 长方形 |
|
||||
| `d` | (Rounde) 圆形 |
|
||||
| `u` | (Rectangle) 长方形 |
|
||||
| `o` | (Oval) 椭圆形 |
|
||||
| `l` | (Line) 线 |
|
||||
| `v` | (Vector Point) 向量点 |
|
||||
| `p` | (Pencil) 铅笔 |
|
||||
| `t` | (Text) 文本 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `C` | 复制
|
||||
`Cmd` `X` | 剪切
|
||||
`Cmd` `V` | 粘贴
|
||||
`Cmd` `Shift` `V` | 覆盖选择粘贴
|
||||
`Space` `(拖动)` | 平移画布
|
||||
`Cmd` `Shift` `N` | 新建页面
|
||||
`Fn` `Up` | 上一页
|
||||
`Fn` `Down` | 下一页
|
||||
`Cmd` `+` | 放大
|
||||
`Cmd` `-` | 缩小
|
||||
`Ctrl` `R` | 切换标尺
|
||||
`Ctrl` `P` | 切换像素
|
||||
`Ctrl` `X` | 切换像素网格
|
||||
`Ctrl` `G` | 切换网格
|
||||
`Ctrl` `L` | 切换布局
|
||||
`Ctrl` `E` | 切换切片
|
||||
`Ctrl` `F` | 切换原型设计
|
||||
`Cmd` `F` | 在图层列表中过滤
|
||||
`Cmd` `Ctrl` `K` | 运行自定义插件
|
||||
`Cmd` `Z` | 撤销
|
||||
`Cmd` `Shift` `Z` | 重做
|
||||
`Cmd` `N` | 新建文档
|
||||
`Cmd` `Shift` `N` | 新建云文档
|
||||
`Cmd` `O` | 打开文档
|
||||
`Cmd` `Shift` `O` | 打开云文档
|
||||
`Cmd` `W` | 关闭窗口
|
||||
`Cmd` `S` | 保存文档
|
||||
`Cmd` `Shift` `S` | 复制文档
|
||||
`Cmd` `Shift` `Opt` `S` | 另存为...
|
||||
`Cmd` `Shift` `P` | 页面设置
|
||||
`Cmd` `,` | 打开首选项窗口
|
||||
`Cmd` `H` | 隐藏 Sketch
|
||||
`Cmd` `Q` | 退出 Sketch
|
||||
`Cmd` `Shift` `?` | 打开帮助菜单
|
||||
`Cmd` `P` | 打开预览窗口
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 类型
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
### 插入图层
|
||||
|
||||
| 快捷键 | 类型 |
|
||||
| ----- | ---- |
|
||||
| `Cmd + B` | 加粗 |
|
||||
| `Cmd + I` | 斜体 |
|
||||
| `Cmd + U` | 下划线 |
|
||||
| `Alt + Cmd (+) +` | 增加字体大小 |
|
||||
| `Alt + Cmd (+) –` | 减小字体大小 |
|
||||
| `Alt + Control + L` | 增加字符间距 |
|
||||
| `Alt + Control + T` | 减少字符间距 |
|
||||
| `Cmd + T` | 更改字体 |
|
||||
| `Shift + Cmd + O` | 将文本转换为轮廓 |
|
||||
| `Cmd + Shift + {` | 左对齐 |
|
||||
| `Cmd + Shift + \` | 居中对齐 |
|
||||
| `Cmd + Shift + }` | 右对齐 |
|
||||
| `Control + Cmd + Space` | 特殊字符 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`R` | 矩形
|
||||
`O` | 椭圆
|
||||
`L` | 直线
|
||||
`U` | 圆角矩形
|
||||
`V` | 矢量工具
|
||||
`P` | 铅笔工具
|
||||
`T` | 文本工具
|
||||
`A` | 画板工具
|
||||
`S` | 切片工具
|
||||
`H` | 热点工具
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 画布视图
|
||||
### 选择图层
|
||||
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `A` | 全选
|
||||
`Cmd` `Shift` `A` | 选择所有画板
|
||||
`Fn` `Right` | 选择下一个画板
|
||||
`Fn` `Left` | 选择上一个画板
|
||||
`Cmd` `Shift` `J` | 在图层列表中显示所选内容
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
| 画布视图 | 快捷键 |
|
||||
| ----- | ---- |
|
||||
| `Cmd (+) +` | 放大 |
|
||||
| `Cmd (+) -` | 缩小 |
|
||||
| `Cmd + 0` | 实际尺寸 |
|
||||
| `Cmd + 1` | 中心画布 |
|
||||
| `Cmd + 2` | 缩放选择 |
|
||||
| `Cmd + 3` | 中心选择 |
|
||||
| `§` | 临时缩放到实际大小 |
|
||||
| `Alt + Tab` | 关注第一个输入字段 |
|
||||
| `Control + R` | 切换标尺 |
|
||||
| `Control + G` | 切换网格 |
|
||||
| `Control + L` | 切换图层指南 |
|
||||
| `Control + P` | 切换像素 |
|
||||
| `Control + H` | 切换选择手柄 |
|
||||
| `Control + X` | 切换像素网格 |
|
||||
| `Space + Drag` | 移动画布 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
### 移动和调整图层大小
|
||||
|
||||
### 窗口
|
||||
|
||||
| 快捷键 | Window |
|
||||
| ----- | ---- |
|
||||
| `Cmd + ~` | 在文档之间切换 |
|
||||
| `Alt + Cmd + 1` | 切换层列表 |
|
||||
| `Alt + Cmd + 2` | 切换检查器 |
|
||||
| `Alt + Cmd + 3` | 切换图层、检查器 |
|
||||
| `Alt + Cmd + T` | 切换工具栏 |
|
||||
| `Cmd + .` | 演示模式 |
|
||||
| `Control + Cmd + F` | 进入全屏 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 编辑形状
|
||||
|
||||
| 编辑形状 | 快捷键 |
|
||||
| ----- | ---- |
|
||||
| `Cmd + Alt` | 保留当前选择 |
|
||||
| `Control + Cmd + M` | 用作蒙版跨度`(适用于图层和组)` |
|
||||
| `Alt + Cmd + U` | 联盟 |
|
||||
| `Alt + Cmd + S` | 减去 |
|
||||
| `Alt + Cmd + I` | 相交 |
|
||||
| `Alt + Cmd + X` | 区别 |
|
||||
| `Cmd + Arrows` | 更改对象大小 |
|
||||
| `Shift + Cmd + Arrows` | 将单位更改 10 |
|
||||
| `1, 2, 3, 4` | 更改矢量点样式 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Opt` | 显示到其他图层的距离(悬停时)
|
||||
`Cmd` `D` | 复制
|
||||
`(箭头键)` | 将图层向任何方向微调1像素
|
||||
`Shift` `(箭头键)` | 将图层向任何方向微调10像素
|
||||
`Cmd` `K` | 缩放图层
|
||||
`Cmd` `Right/Down` | 增加1像素
|
||||
`Cmd` `Left/Up` | 减少1像素
|
||||
`Cmd` `Shift` `Right/Down` | 增加10像素
|
||||
`Cmd` `Shift` `Left/Up` | 减少10像素
|
||||
`Ctrl` `Opt` | 在文本图层上显示基线或大写字母高度的距离(悬停时)
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 编辑图层
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
| 快捷键 | 编辑图层 |
|
||||
| ----- | ---- |
|
||||
| `Alt` | 显示到其他图层的距离 |
|
||||
| `Alt + Cmd` | 显示到组内其他图层的距离 |
|
||||
| `Alt + Drag` | 复制(用 ⌘D 重复) |
|
||||
| `Alt + Cmd + C` | 复制样式 |
|
||||
| `Alt + Cmd + V` | 粘贴样式 |
|
||||
| `Control + C` | 选色器 |
|
||||
| `Cmd + T` | 转换 |
|
||||
| `Shift + Cmd + R` | 旋转 |
|
||||
| `F` | 切换填充 |
|
||||
| `B` | 切换边框 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Enter` | 编辑图层
|
||||
`Esc` | 完成编辑
|
||||
`Opt` `Tab` | 聚焦检查器中的X位置输入字段
|
||||
`Del` | 删除图层
|
||||
`Cmd` `Opt` `C` | 复制样式
|
||||
`Cmd` `Opt` `V` | 粘贴样式
|
||||
`Ctrl` `S` | 同步共享样式
|
||||
`Opt` `Ctrl` `S` | 重置共享样式
|
||||
`W` | 为画板添加链接
|
||||
`F` | 切换填充
|
||||
`B` | 切换边框
|
||||
`Ctrl` `C` | 选择颜色
|
||||
`0-9` | 编辑图层不透明度
|
||||
`Cmd` `Shift` `T` | 变换形状
|
||||
`Cmd` `Shift` `R` | 旋转图层
|
||||
`Cmd` `Ctrl` `M` | 用作蒙版
|
||||
`Cmd` `Esc` | 返回实例
|
||||
`Cmd` `Opt` `U` | 合并多个图层
|
||||
`Cmd` `Opt` `S` | 减去多个图层
|
||||
`Cmd` `Opt` `I` | 与多个图层相交
|
||||
`Cmd` `Opt` `X` | 差异多个图层
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 排列图层、组和画板
|
||||
### 矢量编辑
|
||||
|
||||
| 排列图层、组和画板 | 快捷键 |
|
||||
| ----- | ---- |
|
||||
| `Alt + Cmd + ↑` | 向前进 |
|
||||
| `Control + Alt + Cmd + ↑` | 带到前面 |
|
||||
| `Alt + Cmd + ↓` | 向后发送 |
|
||||
| `Control + Alt + Cmd + ↓` | 送回 |
|
||||
| `Shift + Cmd + H` | 隐藏 |
|
||||
| `Shift + Cmd + L` | 锁 |
|
||||
| `Cmd + R` | 改名 |
|
||||
| `Cmd + G` | 图层组 |
|
||||
| `Shift + Cmd + G` | 取消组合图层 |
|
||||
| `Shift + Tab` | 选择上层 |
|
||||
| `Tab` | 选择下面的图层 |
|
||||
| `Esc` | 选择父画板 |
|
||||
| `Cmd + F` | 按名称查找图层 |
|
||||
| `Fn + ↑` | 选择上方页面 |
|
||||
| `Fn + ↓` | 选择下面的页面 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `Opt` `O` | 打开或关闭路径
|
||||
`Tab` | 选择下一个点
|
||||
`Opt` | 显示所有控制点
|
||||
`1` | 直线点类型
|
||||
`2` | 镜像点类型
|
||||
`3` | 断开连接的点类型
|
||||
`4` | 非对称点类型
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 文本编辑
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `Shift` `Opt` `V` | 以富文本方式粘贴
|
||||
`Cmd` `T` | 更改字体
|
||||
`Cmd` `B` | 粗体
|
||||
`Cmd` `I` | 斜体
|
||||
`Cmd` `U` | 下划线
|
||||
`Cmd` `Opt` `+` | 增大字体大小
|
||||
`Cmd` `Opt` `-` | 减小字体大小
|
||||
`Ctrl` `Opt` `L` | 增大字符间距
|
||||
`Ctrl` `Opt` `T` | 减小字符间距
|
||||
`Cmd` `Shift` `[` | 左对齐
|
||||
`Cmd` `Shift` `\` | 居中对齐
|
||||
`Cmd` `Shift` `]` | 右对齐
|
||||
`Cmd` `Opt` `Space` | 表情符号和符号
|
||||
`Cmd` `Opt` `O` | 转换为轮廓
|
||||
`Shift` `Enter` | 插入换行符
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 排列图层
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `G` | 分组
|
||||
`Cmd` `Shift` `G` | 解组
|
||||
`Cmd` `R` | 重命名图层
|
||||
`Tab` | 在组内选择下一图层
|
||||
`Shift` `Tab` | 在组内选择上一图层
|
||||
`Enter` | 在组内选择图层
|
||||
`Esc` | 选择父组
|
||||
`Cmd` `]` | 上移一层
|
||||
`Cmd` `Opt` `]` | 移至顶层
|
||||
`Cmd` `[` | 下移一层
|
||||
`Cmd` `Opt` `[` | 移至底层
|
||||
`Cmd` `Shift` `Opt` `Up` | 向上移动,移出组或画板
|
||||
`Cmd` `Ctrl` `H` | 水平分布
|
||||
`Cmd` `Ctrl` `V` | 垂直分布
|
||||
`Cmd` `Shift` `H` | 隐藏或显示图层
|
||||
`Cmd` `Shift` `L` | 锁定或解锁图层
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 导出图层
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `Shift` `E` | 导出
|
||||
`Cmd` `E` | 导出选定的图层
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 缩放和焦点
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Cmd` `0` | 缩放至100%
|
||||
`Cmd` `1` | 缩放至画布上的所有元素
|
||||
`Cmd` `2` | 缩放至选定的图层
|
||||
`Cmd` `3` | 将选定的图层居中于画布
|
||||
`Shift` <code>\`</code> | 临时缩小至100%
|
||||
`Cmd` `Ctrl` `F` | 切换全屏
|
||||
`Cmd` `Opt` `1` | 显示或隐藏图层列表
|
||||
`Cmd` `Opt` `2` | 显示或隐藏检查器
|
||||
`Cmd` `.` | 进入演示模式
|
||||
`Cmd` `Opt` `T` | 显示或隐藏工具栏
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 文本字段
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Opt` `Tab` | 聚焦检查器
|
||||
`Tab` | 选择下一字段
|
||||
`Shift` `Tab` | 选择上一字段
|
||||
`Enter` | 确认更改
|
||||
`Esc` | 清除更改
|
||||
`Up` | 将值增加1
|
||||
`Down` | 将值减少1
|
||||
`Shift` `Up` | 将值增加10
|
||||
`Shift` `Down` | 将值减少10
|
||||
`Opt` `Up` | 将值增加0.1
|
||||
`Opt` `Down` | 将值减少0.1
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
### 杂项
|
||||
|
||||
快捷键 | 操作
|
||||
---|---
|
||||
`Shift` | 以禁用所有插件的状态启动 Sketch(启动时按住)
|
||||
`Cmd` `Ctrl` `D` | 从符号分离
|
||||
`Cmd` `Ctrl` `Opt` `D` | 从符号分离所有内容
|
||||
`Cmd` `Shift` `D` | 刷新数据
|
||||
`Cmd` `Ctrl` `R` | 再次运行上次使用的插件
|
||||
`0-9` | 选择渐变停止点后,将其定位在0%和100%之间
|
||||
`=` | 将选定的渐变停止点直接定位在两个现有停止点之间
|
||||
<!--rehype:className=left-align shortcuts-->
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
311
docs/swift.md
@@ -385,9 +385,11 @@ switch secondaryColor {
|
||||
case "orange":
|
||||
print("红色和黄色的混合")
|
||||
case "purple":
|
||||
print("红色和蓝色的混合")
|
||||
default:
|
||||
print("这可能不是辅助颜色")
|
||||
print("红色和蓝色的混合")
|
||||
case "green":
|
||||
print("蓝色和黄色的混合")
|
||||
default:
|
||||
print("这可能不是辅助颜色")
|
||||
}
|
||||
// 打印: 蓝色和黄色的混合
|
||||
```
|
||||
@@ -522,8 +524,8 @@ let zeroToThree = 0...3
|
||||
### stride() 函数
|
||||
|
||||
```swift
|
||||
for oddNum in stride(from: 1, to: 5, by: 2) {
|
||||
print(oddNum)
|
||||
for num in stride(from: 1, to: 5, by: 2) {
|
||||
print(num)
|
||||
}
|
||||
// 打印: 1
|
||||
// 打印: 3
|
||||
@@ -542,6 +544,7 @@ for char in "hehe" {
|
||||
```
|
||||
|
||||
### continue 关键字
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```swift
|
||||
for num in 0...5 {
|
||||
@@ -558,6 +561,7 @@ for num in 0...5 {
|
||||
`continue` 关键字将强制循环继续进行下一次迭代
|
||||
|
||||
### break 关键字
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```swift
|
||||
for char in "supercalifragilistice" {
|
||||
@@ -584,21 +588,58 @@ for _ in 1...3 {
|
||||
// 打印: Olé
|
||||
```
|
||||
|
||||
### 遍历指定范围
|
||||
|
||||
```swift
|
||||
for i in 0...10 {
|
||||
print(i) //0 到 10
|
||||
}
|
||||
```
|
||||
|
||||
封闭指定范围操作符(...)
|
||||
|
||||
### while 循环
|
||||
|
||||
```swift
|
||||
var counter = 1
|
||||
var stopNum = Int.random(in: 1...10)
|
||||
|
||||
// 循环打印,直到满足停止条件
|
||||
while counter < stopNum {
|
||||
print(counter)
|
||||
counter += 1
|
||||
}
|
||||
// 循环打印,直到满足停止条件
|
||||
```
|
||||
|
||||
`while` 循环接受一个条件,并在所提供的条件为 `true` 时持续执行其主体代码。如果条件从不为假,则循环将继续运行,程序将陷入`无限循环`
|
||||
|
||||
### repeate while
|
||||
|
||||
```swift
|
||||
var counter = 1
|
||||
|
||||
repeat {
|
||||
print(counter)
|
||||
counter += 1
|
||||
} while counter <= 5
|
||||
```
|
||||
|
||||
至少执行一次
|
||||
|
||||
### 遍历字典对象
|
||||
|
||||
```swift
|
||||
// 创建一个字典
|
||||
var myDictionary = [
|
||||
"name": "John", "age": 25
|
||||
]
|
||||
|
||||
// 使用for-in循环遍历字典
|
||||
for (key, value) in myDictionary {
|
||||
print("\(key): \(value)")
|
||||
}
|
||||
```
|
||||
|
||||
数组和集合
|
||||
----
|
||||
|
||||
@@ -727,7 +768,7 @@ oddNumbers.remove(2)
|
||||
oddNumbers.removeAll()
|
||||
```
|
||||
|
||||
### .contains()
|
||||
### .contains() 检测数组中的值
|
||||
|
||||
```swift
|
||||
var names: Set = ["Rosa", "Doug", "Waldo"]
|
||||
@@ -1001,6 +1042,8 @@ func washCar() -> Void {
|
||||
}
|
||||
```
|
||||
|
||||
返回值为空的函数(void)
|
||||
|
||||
### 调用函数
|
||||
|
||||
```swift
|
||||
@@ -1103,7 +1146,7 @@ greet(person: "Aliya") // Hello Aliya
|
||||
```swift
|
||||
var currentSeason = "冬天"
|
||||
|
||||
func season(month: Int, name: inout String) {
|
||||
func season(month:Int, name:inout String) {
|
||||
switch month {
|
||||
case 1...2:
|
||||
name = "冬天 ⛄️"
|
||||
@@ -1142,9 +1185,67 @@ func getFirstInitial(from name: String?) -> String? {
|
||||
return name?.first
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
函数可以接受可选类型并返回可选类型。当一个函数不能返回请求类型的合理实例时,它应该返回 `nil`
|
||||
|
||||
### 省略 return 关键字
|
||||
|
||||
```swift
|
||||
func multiply(x: Int, y: Int) -> Int {
|
||||
x * y
|
||||
}
|
||||
```
|
||||
|
||||
### 额外指定参数命名标签
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```swift
|
||||
func calculate(of numbers: Int...) -> Int {
|
||||
var sum = 0
|
||||
|
||||
for number in numbers {
|
||||
sum += number
|
||||
}
|
||||
|
||||
return sum
|
||||
}
|
||||
|
||||
// 调用函数时,使用外部参数名
|
||||
let result = calculate(of: 1, 2, 3, 4, 5)
|
||||
print("Sum: \(result)")
|
||||
```
|
||||
|
||||
### 函数作为参数
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```swift
|
||||
func doMath(
|
||||
operation: (Int, Int) -> Int,
|
||||
a: Int, b: Int
|
||||
) -> Int {
|
||||
return operation(a, b)
|
||||
}
|
||||
// 定义一些可以作为参数传递的函数
|
||||
func add(_ a: Int, _ b: Int) -> Int {
|
||||
return a + b
|
||||
}
|
||||
// 使用 doMath 函数,并将 add 函数作为参数传递
|
||||
let result = doMath(5, 3, operation: add)
|
||||
print("Addition Result: \(result)")
|
||||
```
|
||||
|
||||
### 闭包
|
||||
|
||||
```swift
|
||||
let add: (Int, Int) -> Int = { (a, b) in
|
||||
return a + b
|
||||
}
|
||||
// 调用闭包
|
||||
let result = add(3, 5)
|
||||
print("Sum: \(result)")
|
||||
```
|
||||
|
||||
结构
|
||||
----
|
||||
|
||||
@@ -1401,6 +1502,17 @@ let resolution = Resolution(width: 1920)
|
||||
let someVideoMode = VideoMode()
|
||||
```
|
||||
|
||||
### 类的扩展
|
||||
|
||||
```swift
|
||||
extension String {
|
||||
var boolValue: Bool {
|
||||
return self == "1"
|
||||
}
|
||||
}
|
||||
let isTure = "0".boolValue
|
||||
```
|
||||
|
||||
枚举
|
||||
----
|
||||
|
||||
@@ -1429,8 +1541,8 @@ enum Dessert {
|
||||
case brownie
|
||||
}
|
||||
|
||||
let customerOrder: Dessert = .cake(flavor: "红色天鹅绒")
|
||||
switch customerOrder {
|
||||
let custom: Dessert = .cake(flavor: "红色")
|
||||
switch custom {
|
||||
case let .cake(flavor):
|
||||
print("你点了一个 \(flavor) 蛋糕")
|
||||
case .brownie:
|
||||
@@ -1476,29 +1588,37 @@ enum Dessert {
|
||||
case brownie
|
||||
}
|
||||
|
||||
let order: Dessert = .cake(flavor: "红色天鹅绒")
|
||||
let order: Dessert = .cake(flavor: "红色")
|
||||
```
|
||||
|
||||
### 实例方法
|
||||
### 枚举的可赋值性
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```swift
|
||||
enum Traffic {
|
||||
case light
|
||||
case heavy
|
||||
|
||||
mutating func reportAccident() {
|
||||
self = .heavy
|
||||
}
|
||||
enum Content {
|
||||
case empty
|
||||
case text(String)
|
||||
case number(Int)
|
||||
}
|
||||
|
||||
var currentTraffic: Traffic = .light
|
||||
|
||||
currentTraffic.reportAccident()
|
||||
// currentTraffic 现在是 .heavy
|
||||
```
|
||||
|
||||
就像类和结构一样,枚举也可以有实例方法。如果实例方法改变了枚举的值,则需要将其标记为 `mutating`
|
||||
使用 switch 处理可赋值枚举
|
||||
|
||||
```swift
|
||||
let content = Content.text("Hello")
|
||||
switch content {
|
||||
case .empty:
|
||||
print("Value is empty")
|
||||
case .text(let value):
|
||||
print("Value is \(value)")
|
||||
case .number(_): //不调用时,可以省略
|
||||
print("Value is a number")
|
||||
}
|
||||
// 或者
|
||||
if case .text(let value) = content {
|
||||
print("Value is \(value)")
|
||||
}
|
||||
```
|
||||
|
||||
### 从原始值初始化
|
||||
|
||||
@@ -1528,6 +1648,147 @@ enum ShirtSize: String {
|
||||
}
|
||||
```
|
||||
|
||||
### 遍历字符串
|
||||
|
||||
```swift
|
||||
enum Currency: String {
|
||||
case euro = "EUR"
|
||||
case dollar = "USD"
|
||||
case pound = "GBP"
|
||||
}
|
||||
```
|
||||
|
||||
输出枚举的原始值
|
||||
|
||||
```swift
|
||||
let euroSymbol = Currency.euro.rawValue
|
||||
print("欧元的货币符号是 \(euroSymbol)")
|
||||
```
|
||||
|
||||
### 实例方法
|
||||
|
||||
```swift
|
||||
enum Traffic {
|
||||
case light
|
||||
case heavy
|
||||
|
||||
mutating func reportAccident() {
|
||||
self = .heavy
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
枚举也可以有实例方法
|
||||
|
||||
```swift
|
||||
var currentTraffic: Traffic = .light
|
||||
currentTraffic.reportAccident()
|
||||
// currentTraffic 现在是 .heavy
|
||||
```
|
||||
|
||||
实例方法改变了枚举的值,则需要将其标记为 `mutating`
|
||||
|
||||
扩展
|
||||
---
|
||||
|
||||
### 声明扩展
|
||||
|
||||
```swift
|
||||
struct Person {
|
||||
var name: String
|
||||
var age: Int
|
||||
func eat() {}
|
||||
}
|
||||
extension Person {
|
||||
// 添加新功能
|
||||
}
|
||||
extension Person: SomeProtocol {
|
||||
// 实现协议方法、属性
|
||||
}
|
||||
```
|
||||
|
||||
### 扩展构造器
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```swift
|
||||
// 给CGRect结构体提供允许center和size的构造器
|
||||
extension CGRect {
|
||||
init(center: CGPoint, size: CGSize) {
|
||||
let x: CGFloat = center.x - size.width * 0.5
|
||||
let y: CGFloat = center.y - size.height * 0.5
|
||||
self.init(origin: CGPoint(x: x, y: y),
|
||||
size: size)
|
||||
}
|
||||
}
|
||||
let frame = CGRect(center: CGPoint(x: 100, y: 100),
|
||||
size: CGSize(width: 50, height: 50))
|
||||
print("Origin is \(frame.origin)")
|
||||
```
|
||||
|
||||
### 扩展可变实例方法
|
||||
|
||||
```swift
|
||||
extension Double {
|
||||
mutating func cube() {
|
||||
self = self * self * self
|
||||
}
|
||||
}
|
||||
var boxCube: Double = 2.0
|
||||
boxCube.cube()
|
||||
print(boxCube)
|
||||
```
|
||||
|
||||
### 扩展方法
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```swift
|
||||
extension String {
|
||||
func deletingPrefix(_ prefix: String) -> String {
|
||||
guard self.hasPrefix(prefix) else {
|
||||
return self
|
||||
}
|
||||
return String(self.dropFirst(prefix.count))
|
||||
}
|
||||
}
|
||||
print("Hello World".deletingPrefix("He"))
|
||||
```
|
||||
|
||||
### 扩展计算属性
|
||||
|
||||
```swift
|
||||
// 扩展可以添加计算属性,不能添加存储属性
|
||||
extension Double {
|
||||
var km: Double { self * 1000 }
|
||||
var m: Double { self }
|
||||
var cm: Double { self / 100.0 }
|
||||
var mm: Double { self / 1000.0 }
|
||||
}
|
||||
let metric: Double = 30.48.cm
|
||||
print("1 metric is \(metric.m) meter")
|
||||
print("1 metric is \(metric.km) kilometer")
|
||||
```
|
||||
|
||||
### 扩展存储属性
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```swift
|
||||
// 但可以通过 objc_getAssociatedObject/objc_setAssociatedObject 实现添加存储属性
|
||||
private var fuchsiaKey = "fuchsiaKey"
|
||||
extension UIColor {
|
||||
var fuchsia: UIColor? {
|
||||
get {
|
||||
return objc_getAssociatedObject(self, &fuchsiaKey) as? UIColor
|
||||
}
|
||||
set {
|
||||
objc_setAssociatedObject(self, &fuchsiaKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
|
||||
166
docs/swiftui.md
@@ -1199,6 +1199,172 @@ struct SheetDetail: Identifiable {
|
||||
|
||||
文档 - [ActionSheet](https://developer.apple.com/documentation/swiftui/actionsheet)
|
||||
|
||||
SwiftData
|
||||
---
|
||||
|
||||
### SwiftData声明
|
||||
|
||||
```swift
|
||||
import SwiftData
|
||||
// 通过@Model宏来定义模型schema
|
||||
// 支持基础值类型String、Int、CGFloat等
|
||||
// 支持复杂类型Struct、Enum、Codable、集合等
|
||||
@Model
|
||||
class Person {
|
||||
var id: String
|
||||
var name: String
|
||||
var age: Int
|
||||
init(name: String, age: Int) {
|
||||
self.id = UUID().uuidString
|
||||
self.name = name
|
||||
self.age = age
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 声明@Attribute
|
||||
|
||||
```swift
|
||||
@Model
|
||||
class Person {
|
||||
// @Attribute(.unique)为id添加唯一约束
|
||||
@Attribute(.unique) var id: String
|
||||
var name: String
|
||||
var age: Int
|
||||
init(name: String, age: Int) {
|
||||
self.id = UUID().uuidString
|
||||
self.name = name
|
||||
self.age = age
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 声明@Relationship
|
||||
|
||||
```swift
|
||||
@Model
|
||||
class Person {
|
||||
@Attribute(.unique)
|
||||
var id: String
|
||||
var name: String
|
||||
var age: Int
|
||||
// @Relationship(deleteRule: .cascade)
|
||||
// 使得Person在数据库里被删除时
|
||||
// 删除掉所有关联的students
|
||||
@Relationship(deleteRule: .cascade)
|
||||
var students: [Student]? = []
|
||||
init(name: String, age: Int) {
|
||||
self.id = UUID().uuidString
|
||||
self.name = name
|
||||
self.age = age
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 声明Transient
|
||||
|
||||
```swift
|
||||
@Model
|
||||
class Person {
|
||||
@Attribute(.unique)
|
||||
var id: String
|
||||
var name: String
|
||||
// @Transient表示不要持久化这个属性
|
||||
// 需要提供一个默认值
|
||||
@Transient
|
||||
var age: Int = 0
|
||||
init(name: String) {
|
||||
self.id = UUID().uuidString
|
||||
self.name = name
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### @Query
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```swift
|
||||
struct ContentView: View {
|
||||
// Query 可以高效地查询大型数据集,并自定义返回内容的方式,如排序、过滤
|
||||
@Query(sort: \.age, order: .reverse) var persons: [Person]
|
||||
@Environment(\.modelContext) var modelContext
|
||||
var body: some View {
|
||||
NavigationStack() {
|
||||
List {
|
||||
ForEach(trips) { trip in
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 构建ModelContainer
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```swift
|
||||
// 用 Schema 进行初始化
|
||||
let container = try ModelContainer(for: Person.self)
|
||||
// 用配置(ModelConfiguration)初始化
|
||||
let container = try ModelContainer(
|
||||
for: Person.self,
|
||||
configurations: ModelConfiguration(url: URL("path"))
|
||||
)
|
||||
// 通过View 和 Scene 的修饰器来快速关联一个 ModelContainer
|
||||
struct SwiftDataDemoApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
}
|
||||
.modelContainer(for: Person.self)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 构建ModelContext
|
||||
|
||||
```swift
|
||||
// 在配置Model Container完成后
|
||||
// 通过Environment 来访问到 modelContext
|
||||
struct ContextView : View {
|
||||
@Environment(\.modelContext)
|
||||
private var context
|
||||
}
|
||||
// 或者直接获取共享的主Actor context
|
||||
let context = container.mainContext
|
||||
// 或者直接初始化一个新的Context
|
||||
let context = ModelContext(container)
|
||||
```
|
||||
|
||||
### 增、删、改
|
||||
|
||||
```swift
|
||||
let person = Person(name: "Lily", age: 10)
|
||||
// Insert a new person
|
||||
context.insert(person)
|
||||
// Delete an existing person
|
||||
context.delete(person)
|
||||
// Manually save changes to the context
|
||||
try context.save()
|
||||
```
|
||||
|
||||
### 查询
|
||||
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```swift
|
||||
let personPredicate = #Predicate<Person> {
|
||||
$0.name == "Lily" &&
|
||||
$0.age == 10
|
||||
}
|
||||
|
||||
let descriptor = FetchDescriptor<Person>(predicate: personPredicate)
|
||||
let persons = try? context.fetch(descriptor)
|
||||
```
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ tar cvzf compressedArchive.tar.gz /home/cyberpunk/testdir
|
||||
|
||||
### 生成压缩率更高的 `tar.bz2` 文件
|
||||
|
||||
`tar` 的 `bz2` 压缩,可以创建比 `gzip` 文件小的归档。`Bz2` 模式执行归档压缩和解压所需的时间比 `gzip` 模式多。通常,这个时间差可以忽略不计,但如果文件非常打,或者是文件数量非常多,那么时间差就会非常大。
|
||||
`tar` 的 `bz2` 压缩,可以创建比 `gzip` 文件小的归档。`Bz2` 模式执行归档压缩和解压所需的时间比 `gzip` 模式多。通常,这个时间差可以忽略不计,但如果文件非常大,或者是文件数量非常多,那么时间差就会非常大。
|
||||
|
||||
```shell
|
||||
tar cvfj Archive.tar.bz2 /home/cyberpunk/testdir
|
||||
|
||||
321
docs/tauri.md
Normal file
@@ -0,0 +1,321 @@
|
||||
tauri 备忘清单
|
||||
===
|
||||
|
||||
这个 [tauri](https://tauri.app/) 快速参考备忘单显示了它的常用命令使用清单
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 快速开始
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
Bash
|
||||
|
||||
```bash
|
||||
sh <(curl https://create.tauri.app/sh)
|
||||
```
|
||||
|
||||
PowerShell
|
||||
|
||||
```bash
|
||||
C:\> irm https://create.tauri.app/ps | iex
|
||||
```
|
||||
|
||||
Cargo
|
||||
|
||||
```bash
|
||||
$ cargo install create-tauri-app --locked
|
||||
$ cargo create-tauri-app
|
||||
```
|
||||
|
||||
npm/yarn/pnpm/bunx
|
||||
|
||||
```bash
|
||||
$ npm create tauri-app@latest
|
||||
$ yarn create tauri-app
|
||||
$ pnpm create tauri-app
|
||||
$ bunx create-tauri-app
|
||||
```
|
||||
|
||||
#### 依赖环境
|
||||
|
||||
软件 | 描述
|
||||
:- |:-
|
||||
[rust](https://www.rust-lang.org/tools/install)| rust安装
|
||||
[nodejs](https://nodejs.org/en)| nodejs安装
|
||||
[Windows Build Tools](https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/)| Microsoft C++ 生成工具 (for windows)
|
||||
[Android Studio](https://developer.android.google.cn/studio?hl=zh-cn)|安卓开发工具
|
||||
|
||||
### 启动 Tauri 开发窗口
|
||||
|
||||
```bash
|
||||
$ npm run tauri dev
|
||||
$ yarn tauri dev
|
||||
$ pnpm tauri dev
|
||||
$ bunx tauri dev
|
||||
$ cargo tauri dev
|
||||
```
|
||||
|
||||
### 检测最新版本的 Tauri
|
||||
|
||||
```bash
|
||||
$ npm outdated @tauri-apps/cli
|
||||
$ yarn outdated @tauri-apps/cli
|
||||
$ pnpm add -D @tauri-apps/cli
|
||||
$ npm outdated @tauri-apps/cli
|
||||
```
|
||||
|
||||
### 更新 npm 包
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ npm install @tauri-apps/cli@latest @tauri-apps/api@latest
|
||||
$ yarn upgrade @tauri-apps/cli @tauri-apps/api --latest
|
||||
$ yarn up @tauri-apps/cli @tauri-apps/api
|
||||
$ pnpm update @tauri-apps/cli @tauri-apps/api --latest
|
||||
$ bun update @tauri-apps/cli @tauri-apps/api
|
||||
```
|
||||
|
||||
### 更新 Cargo 包
|
||||
|
||||
打开 `src-tauri/Cargo.toml` 并更改 `tauri` 和 `tauri-build`
|
||||
|
||||
```ini
|
||||
[build-dependencies]
|
||||
tauri-build = "%version%"
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "%version%" }
|
||||
```
|
||||
|
||||
其中 `%version%` 是上面相应的版本号
|
||||
|
||||
```bash
|
||||
$ cd src-tauri
|
||||
$ cargo update
|
||||
```
|
||||
|
||||
### 应用程序调试
|
||||
|
||||
代码中输出日志方法
|
||||
|
||||
```rust
|
||||
println!("Message from Rust: {}", msg);
|
||||
```
|
||||
|
||||
在 Linux 和 macOS 上通过下面命令重新运行
|
||||
|
||||
```bash
|
||||
RUST_BACKTRACE=1 tauri dev
|
||||
```
|
||||
|
||||
Window 上这样开启
|
||||
|
||||
```bash
|
||||
set RUST_BACKTRACE=1
|
||||
tauri dev
|
||||
```
|
||||
|
||||
### 以编程方式打开 Devtools
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```rust
|
||||
use tauri::Manager;
|
||||
tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
#[cfg(debug_assertions)] // 仅在调试构建时包含此代码
|
||||
{
|
||||
let window = app.get_window("main").unwrap();
|
||||
window.open_devtools();
|
||||
window.close_devtools();
|
||||
}
|
||||
Ok(())
|
||||
});
|
||||
```
|
||||
|
||||
### 在生产中使用检查器
|
||||
|
||||
```bash
|
||||
$ npm run tauri build -- --debug
|
||||
$ yarn tauri build --debug
|
||||
$ pnpm tauri build --debug
|
||||
$ bunx tauri build --debug
|
||||
$ cargo tauri build --debug
|
||||
```
|
||||
|
||||
### 启用开发工具功能
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```ini
|
||||
[dependencies]
|
||||
tauri = { version = "...", features = ["...", "devtools"] }
|
||||
```
|
||||
|
||||
在文件 `src-tauri/Cargo.toml` 中启用 `devtools Cargo` 功能
|
||||
|
||||
安卓开发
|
||||
---
|
||||
|
||||
### 环境变量
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
`JAVA_HOME`
|
||||
|
||||
`ANDROID_HOME`
|
||||
|
||||
`NDK_HOME`
|
||||
|
||||
### 准备目标
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ npm install @tauri-apps/cli@next @tauri-apps/api@next
|
||||
$ npm run tauri migrate
|
||||
$ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
||||
$ rm -r src-tauri/gen
|
||||
$ npm run tauri android init
|
||||
$ npm run tauri icon
|
||||
```
|
||||
|
||||
修改应用名:%app_path%\src-tauri\gen\android\app\src\main\res\values\strings.xml
|
||||
|
||||
### 编译
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
```bash
|
||||
$ npm run tauri android dev
|
||||
$ npm run tauri android build
|
||||
```
|
||||
|
||||
### 签名
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
```bash
|
||||
$ keytool -genkey -alias android.keystore -keyalg RSA -validity 20000 -keystore android.keystore
|
||||
$ zipalign -p -f -v 4 unsigned.apk release.apk
|
||||
$ apksigner sign --ks android.keystore release.apk
|
||||
```
|
||||
|
||||
配置
|
||||
---
|
||||
|
||||
### 配置结构
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
默认配置 `tauri.conf.json`,还支持 `tauri.conf.json5` 和 `Tauri.toml`
|
||||
|
||||
-- | --
|
||||
:--- | ---
|
||||
`package` | 包设置
|
||||
`tauri` | Tauri 配置
|
||||
`build` | 构建配置
|
||||
`plugins` | 插件配置
|
||||
|
||||
下面配置能与主配置进行合并
|
||||
|
||||
- `tauri.linux.conf.json` 或 `Tauri.linux.conf.toml`
|
||||
- `tauri.windows.conf.json` 或 `Tauri.windows.conf.toml`
|
||||
- `tauri.macos.conf.json` 或 `Tauri.macos.conf.toml`
|
||||
|
||||
示例
|
||||
|
||||
```json
|
||||
{
|
||||
"build": { ... },
|
||||
"package": { ... },
|
||||
"tauri": { ... }
|
||||
}
|
||||
```
|
||||
|
||||
### Tauri 配置
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
配置 | Type | 描述
|
||||
:--- | --- | ---
|
||||
`pattern` | [PatternKind](#patternkind) | 应用程序名称
|
||||
`version` | [WindowConfig\[\]](#windowconfig) | 应用程序版本
|
||||
`cli` | [CliConfig](#cliconfig) | CLI 配置
|
||||
`bundle` | BundleConfig | 打包器配置
|
||||
`allowlist` | AllowlistConfig | 允许列表配置
|
||||
`security` | SecurityConfig | 安全配置
|
||||
`updater` | UpdaterConfig | 更新程序配置
|
||||
`systemTray` | [SystemTrayConfig](#systemtrayconfig) | 配置应用系统托盘
|
||||
`macOSPrivateApi` | boolean | macOS 私有API配置
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
### CliConfig
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
配置 | Type | 描述
|
||||
:--- | --- | ---
|
||||
`description` | string? | 将显示在帮助信息中
|
||||
`longDescription` | string? | 将显示在帮助信息中
|
||||
`beforeHelp` | string? | 该信息显示在自动生成的帮助信息之前。这通常用于标题信息
|
||||
`afterHelp` | string? | 显示在自动生成的帮助信息之后。通常用于描述如何使用参数,或者需要注意的注意事项
|
||||
`args` | array? | 命令的参数列表
|
||||
`subcommands` | object? | 该命令的子命令列表
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
描述 CLI 配置
|
||||
|
||||
### Package 配置
|
||||
|
||||
配置 | 描述
|
||||
:--- | ---
|
||||
`productName` | 应用程序名称
|
||||
`version` | 应用程序版本
|
||||
|
||||
### WindowConfig
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
窗口配置对象
|
||||
|
||||
配置 | Type | 默认值 | 描述
|
||||
:--- | --- | --- | ---
|
||||
`label` | string | null | 窗口标识符
|
||||
`url` | [WindowUrl](#windowurl) | view | 窗口的 webview URL
|
||||
`userAgent` | userAgent? | null | webview 的用户代理
|
||||
`fileDropEnabled` | boolean | true | 是否在 Web 视图上启用文件放置
|
||||
`center` | boolean | false | 窗口是否开始居中
|
||||
`x` | number? | null | 窗口左上角的水平位置
|
||||
`y` | number? | null | 窗口左上角的水平位置
|
||||
`width` | number | 800 | 窗口宽度
|
||||
`height` | number | 600 | 窗口高度
|
||||
`minWidth` | number | null | 最小窗口宽度
|
||||
`minHeight` | number | null | 最小窗口高度
|
||||
|
||||
### PatternKind
|
||||
|
||||
应用模式。可以是以下类型中的任意一种:
|
||||
|
||||
#### 棕地模式
|
||||
|
||||
```json
|
||||
{ "use": "brownfield" }
|
||||
```
|
||||
|
||||
#### 隔离模式。建议出于安全目的
|
||||
|
||||
```json
|
||||
{
|
||||
"use": "isolation",
|
||||
"options": { "dir": string }
|
||||
}
|
||||
```
|
||||
|
||||
### WindowUrl
|
||||
|
||||
要在 Tauri Web 视图窗口中打开的 URL。可以是以下任何一种类型:
|
||||
|
||||
- `string` (format: `uri`):外部 URL。
|
||||
- `string`:应用程序 URL 的路径部分。例如,要加载 `tauri://localhost/users/john`,只需在此配置中提供 `users/john`
|
||||
|
||||
### SystemTrayConfig
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
配置 | Type | 默认值 | 描述
|
||||
:--- | --- | --- | ---
|
||||
`iconPath` | string(必填) | null | 系统托盘上使用的默认图标的路径
|
||||
`iconAsTemplate` | boolean | false | 用于确定图像是否代表 macOS 上的[模板](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc)图像
|
||||
`menuOnLeftClick` | boolean | true | 确定在 macOS 上托盘图标收到左键点击时菜单是否应该出现
|
||||
`title` | string? | null | MacOS 托盘标题
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
应用程序系统托盘图标的配置
|
||||
112
docs/twitter.md
Normal file
@@ -0,0 +1,112 @@
|
||||
Twitter
|
||||
===
|
||||
|
||||
Twitter 上的 26 个键盘快捷键和高级搜索参考备忘清单
|
||||
|
||||
键盘快捷键
|
||||
----
|
||||
|
||||
### 动作
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`N` | 新推文
|
||||
`L` | 喜欢推文
|
||||
`R` | 回复推文
|
||||
`T` | 转推
|
||||
`M` | 直接消息
|
||||
`U` | 静音账号
|
||||
`B` | 屏蔽账号
|
||||
`Enter` | 打开推文详情
|
||||
`O` | 展开图片
|
||||
`/` | 搜索
|
||||
`Ctrl` `Enter` | 发送推文
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 导航
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`?` | 完整键盘菜单
|
||||
`J` | 下一个推文
|
||||
`K` | 上一个推文
|
||||
`Space` | 向下翻页
|
||||
`.` | 加载新推文
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 时间线
|
||||
|
||||
快捷键 | 动作
|
||||
---|---
|
||||
`G` `N` | 主页时间线
|
||||
`G` `O` | 瞬间
|
||||
`G` `N` | 通知选项卡
|
||||
`G` `R` | 提及
|
||||
`G` `P` | 个人资料
|
||||
`G` `L` | 喜欢选项卡
|
||||
`G` `I` | 列表选项卡
|
||||
`G` `M` | 直接消息
|
||||
`G` `S` | 设置和隐私
|
||||
`G` `U` | 访问某人的资料
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
高级搜索
|
||||
----
|
||||
|
||||
### 搜索词
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
搜索词 | 搜索结果
|
||||
---|---
|
||||
`watching now` | 同时包含 “watching” 和 “now” 的推文(默认搜索模式)
|
||||
`"happy hour"` | 包含完整的短语 “happy hour” 的推文
|
||||
`love OR hate` | 包含 "love” 或 "hate”,或同时包含两个词的推文
|
||||
`beer -root` | 包含 "beer",但不包含 "root” 的推文
|
||||
`#haiku` | 包含 Twitter 话题 “haiku” 的推文
|
||||
`from:interior` | 由 Twitter 账户 “interior” 发布的推文(用于抓取指定用户的推文)
|
||||
`list: NASA/astronauts-in-space-now` | 由 NASA 列表 astronauts-in-space-now 中的 Twitter 账户发布的推文
|
||||
`to: NASA` | 回复Twitter账户 “NASA” 的推文
|
||||
`@NASA` | 提到 Twitter 账户 “NASA” 的推文(即@指定Twitter账户的推文)
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 内容筛选
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
内容条件 | 搜索结果
|
||||
---|---
|
||||
`politics filter:safe` | 包含“puppy”,且过滤被可能包含潜在敏感信息的推文
|
||||
`puppy filter:media` | 包含“puppy”,且包含图片或视频
|
||||
`puppy -filter:retweets` | 包含“puppy”,且不包含转推(用于过滤转推推文)
|
||||
`puppy filter:native_video` | 包含“puppy”,且包含一个上传的视频
|
||||
`puppy filter:periscope` | 包含“puppy”,且包含一个可展示为视频的链接
|
||||
`puppy filter:images` | 包含“puppy ,且包含一个图片
|
||||
`puppy filter:links` | 包含“puppy,且包含一个链接
|
||||
`puppy url:amazon` | 包含“puppy”,且包含一个内容包括"amazon”的Url链接
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 导航
|
||||
|
||||
- [Twitter 官网](https://twitter.com)<!--rehype:target=__blank-->
|
||||
- [Twitter 的高级搜索](https://twitter.com/search-advanced)<!--rehype:target=__blank-->
|
||||
|
||||
### 时间筛选
|
||||
|
||||
Operator | Finds Tweets..
|
||||
---|---
|
||||
`puppy since:2020-6-4` | 包含“puppy“目发布时间晚于2020.06.04(包含2020.06.04)
|
||||
`puppy until: 2020-6-4` | 包含"puppy目发布时间早于2020,06.04(不包含2020,06.04)
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 其它技巧
|
||||
|
||||
搜索词 | 搜索结果
|
||||
---|---
|
||||
`关键字+min_faves:10` | 超过 10 个<red>`点赞`</red>有关相应关键字的推文;
|
||||
`关键字+min_replies:9` | 超过 9 个<red>`回复`</red>有关相应关键字的推文;
|
||||
`关键字+min_retweets:11` | 超过 11 个<red>`转发`</red>有关相应关键字的推文;
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
另请参阅
|
||||
--------
|
||||
|
||||
- [Twitter 的键盘快捷键](https://help.twitter.com/en/using-twitter/how-to-tweet) _(help.twitter.com)_
|
||||
@@ -403,9 +403,9 @@ Vim 搜索和替换
|
||||
|
||||
:- | -
|
||||
:- | -
|
||||
`/foo` | 向前搜索
|
||||
`/foo\c` | 向前搜索 _(不区分大小写)_
|
||||
`?foo` | 向后搜索
|
||||
`/foo` | 向后搜索
|
||||
`/foo\c` | 向后搜索 _(不区分大小写)_
|
||||
`?foo` | 向前搜索
|
||||
`/\v\d+` | 使用 [regex](./regex.md) 搜索
|
||||
`n` | 下一个匹配的搜索模式
|
||||
`N` | 上一个匹配的搜索
|
||||
|
||||
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wcj/reference",
|
||||
"version": "1.41.0",
|
||||
"version": "1.43.0",
|
||||
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
|
||||
"author": "jaywcjlove",
|
||||
"license": "MIT",
|
||||
@@ -8,7 +8,7 @@
|
||||
"funding": "https://jaywcjlove.github.io/#/sponsor",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"prepare": "husky",
|
||||
"build": "refs-cli",
|
||||
"start": "refs-cli --watch",
|
||||
"prettier": "prettier --write '**/*.{mjs,css,json,prettierrc,lintstagedrc}'",
|
||||
@@ -28,12 +28,12 @@
|
||||
"docs/*.md": "markdownlint --fix"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^8.0.1",
|
||||
"lint-staged": "^13.0.3",
|
||||
"prettier": "^2.7.1",
|
||||
"husky": "^9.0.0",
|
||||
"lint-staged": "^15.0.0",
|
||||
"prettier": "^3.0.0",
|
||||
"refs-cli": "^1.5.1",
|
||||
"markdownlint": "^0.27.0",
|
||||
"markdownlint-cli": "^0.33.0"
|
||||
"markdownlint": "^0.33.0",
|
||||
"markdownlint-cli": "^0.39.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|
||||