Compare commits
185 Commits
Author | SHA1 | Date | |
---|---|---|---|
ae633b43e8 | |||
cc6e992a4b | |||
2d994f8597 | |||
ad5accdeff | |||
3a7af1eef3 | |||
9ef65a9f3d | |||
6c220d88ae | |||
01da713410 | |||
768bcb96d9 | |||
fc11b2f0dc | |||
dda6efdc7c | |||
019b4d51ec | |||
f40b56ebb8 | |||
bb533b9081 | |||
6ca7d88a48 | |||
a2cfd4e785 | |||
b08cc85e41 | |||
3f84fe66d3 | |||
5cde10b118 | |||
db7a9aa6f9 | |||
9879fabc78 | |||
a2a2ae55ca | |||
19f919f532 | |||
cabda9b9c9 | |||
ce12b2a329 | |||
5e3d42d1ad | |||
bf962194da | |||
f5e2ad2c31 | |||
ff0cc58c1d | |||
b42883e3de | |||
931850d916 | |||
f4d2c99007 | |||
112a53c101 | |||
9e525009c9 | |||
f78562b95e | |||
63d846b35d | |||
afd924a928 | |||
fb19cda5bb | |||
c9834110cd | |||
98edffbca0 | |||
b3d206d981 | |||
9ec7595b83 | |||
ef823de9a5 | |||
da22b78d8f | |||
06978b1601 | |||
b768bd4e9b | |||
a143e30d93 | |||
7ac675e34c | |||
8e3307272c | |||
0c9fb086ee | |||
f1200c67e1 | |||
cc20a31a47 | |||
1f34ea3bc3 | |||
61b3b5deec | |||
3fed079194 | |||
c481bcdb7b | |||
96e752e809 | |||
01d238eaab | |||
07aaae0e2b | |||
247cd4d4e6 | |||
9945c1b16f | |||
8b151f891c | |||
9dd378128e | |||
6b286b6eb6 | |||
d280013c31 | |||
bdf0dc17cd | |||
4995e6f500 | |||
822e08a6de | |||
88f392c532 | |||
72766dfabe | |||
bfe5551acf | |||
c5792b7c7e | |||
81548feeef | |||
5e284e6f14 | |||
3c4540d248 | |||
e8ccba5cbb | |||
e6d2a48410 | |||
a82f7b948e | |||
7c17fe1222 | |||
e781a3b20e | |||
0f18fbac08 | |||
17c188861e | |||
1a1bf6cd66 | |||
ab795d65aa | |||
150a9bc943 | |||
89fddf6b6f | |||
a8ba4c4e7a | |||
45908c8d90 | |||
f626e21702 | |||
83d9bda16e | |||
470ccb5311 | |||
3964c0c301 | |||
3d0d2947a0 | |||
df8e3a8099 | |||
88b8c8f1c2 | |||
f123f31449 | |||
c0641d2898 | |||
a442108e0f | |||
2af557fa28 | |||
cb9af579f0 | |||
9a2cbcd359 | |||
0c81d4815b | |||
d3e880b6d2 | |||
8b2c227f73 | |||
545e702138 | |||
6f61fab73d | |||
95a03cef33 | |||
c56a018d9b | |||
a40568cc85 | |||
768fb34db9 | |||
b13bb0d6b9 | |||
7348140ae1 | |||
403838287e | |||
b07df71f57 | |||
5e88df2994 | |||
58f486a9fb | |||
665b7d8ce3 | |||
0af1de43c7 | |||
c5f5f0cd19 | |||
0b704fd5e3 | |||
d7503afff2 | |||
381a23490e | |||
c1fbb99393 | |||
3dd01e372c | |||
033709eb8d | |||
260f1ec438 | |||
b104ca8bfd | |||
b3d7fb1ea1 | |||
cd599f7798 | |||
5b649147ca | |||
aa539136fc | |||
e57f03ce8d | |||
cb33da466e | |||
d2b583fc68 | |||
6cde7a1b6f | |||
57fb87d021 | |||
55f4a35a1a | |||
c5f73221f4 | |||
6d8d80c68e | |||
7efa3c1fca | |||
fbcd7edf78 | |||
33328e5987 | |||
3f191de637 | |||
d75cda78f5 | |||
b5467ec1c2 | |||
51c4d2a719 | |||
ca80355477 | |||
a24330243f | |||
acaccae376 | |||
0e2da4158f | |||
a26f95a1be | |||
53b56623a4 | |||
b58db5cc58 | |||
f00a647c3e | |||
869fbc6b40 | |||
5910a3f924 | |||
fadc13ae70 | |||
36b984bb21 | |||
f778b3c28e | |||
1c0bb6a9a5 | |||
b390eaca59 | |||
0e9d9ac16d | |||
b117f3eab7 | |||
8fddbda70d | |||
0d236303a7 | |||
d1c0ded4f7 | |||
4f705878b6 | |||
63e5cd5109 | |||
f21715f172 | |||
2bd72b4c05 | |||
10a4fe3f5b | |||
0a5373796d | |||
64a2fba903 | |||
a9f661f87f | |||
dcd6d5bdbe | |||
d25eaebcd2 | |||
501c7d757e | |||
8db7257b7a | |||
4c0c1c95e8 | |||
7e263a21e7 | |||
54eba6ebd8 | |||
97cda7ec9f | |||
746a387005 | |||
93e23d581f | |||
44711bf9a1 |
38
.github/workflows/ci.yml
vendored
@ -45,6 +45,34 @@ jobs:
|
||||
with:
|
||||
package-path: ./package.json
|
||||
|
||||
- name: gh-pages README.md
|
||||
working-directory: dist
|
||||
run: |
|
||||
cat << "EOF" > README.md
|
||||
Website: https://jaywcjlove.github.io/reference
|
||||
## Docker
|
||||
|
||||
[](https://hub.docker.com/r/wcjiang/reference) [](https://hub.docker.com/r/wcjiang/reference) [](https://hub.docker.com/r/wcjiang/reference)
|
||||
|
||||
轻松通过 `docker` 部署 `Quick Reference` 网站。
|
||||
|
||||
```bash
|
||||
docker pull wcjiang/reference
|
||||
```
|
||||
|
||||
```bash
|
||||
docker run --name reference --rm -d -p 9667:3000 wcjiang/reference:latest
|
||||
# Or
|
||||
docker run --name reference -itd -p 9667:3000 wcjiang/reference:latest
|
||||
```
|
||||
|
||||
在浏览器中访问以下 URL
|
||||
|
||||
```bash
|
||||
http://localhost:9667/
|
||||
```
|
||||
EOF
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
@ -94,6 +122,8 @@ jobs:
|
||||
```
|
||||
|
||||
# Create Docker Image
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Login to Docker Hub
|
||||
@ -107,7 +137,7 @@ jobs:
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||
tags: ${{ secrets.DOCKER_USER }}/reference:latest
|
||||
|
||||
- name: Build and push image:tags
|
||||
@ -116,7 +146,7 @@ jobs:
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||
tags: ${{ secrets.DOCKER_USER }}/reference:${{steps.changelog.outputs.version}}
|
||||
|
||||
# Create Docker Image in Github
|
||||
@ -132,7 +162,7 @@ jobs:
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||
tags: ghcr.io/jaywcjlove/reference:latest
|
||||
|
||||
- name: Build and push image:tags
|
||||
@ -141,7 +171,7 @@ jobs:
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||
tags: ghcr.io/jaywcjlove/reference:${{steps.changelog.outputs.version}}
|
||||
|
||||
# # Create Docker Image in Github
|
||||
|
145
CONTRIBUTING.md
@ -132,15 +132,81 @@ REF_LABEL=网站首页
|
||||
|
||||
由于中国国内访问,时常打不开,你可以访问下面镜像网站。
|
||||
|
||||
- [quickref.cn](https://quickref.cn)
|
||||
- [ecdata.cn](http://ref.ecdata.cn)
|
||||
- [mofe.io](http://quickref.mofe.io)
|
||||
- [aibk.cn](https://quickref.aibk.cn)
|
||||
- [jgeek.cn](http://reference.jgeek.cn/)
|
||||
- [laoleng.vip](http://bbs.laoleng.vip/reference/)
|
||||
- [liujiapeng.com](https://www.liujiapeng.com/)
|
||||
- [dbyun.net](https://www.dbyun.net/reference/index.html)
|
||||
- [dc6.fun](https://dc6.fun/reference/)
|
||||
- [if010.com](https://quickref.if010.com/)
|
||||
- [pipecraft.net](https://quickref.pipecraft.net/)
|
||||
- [isteed.cc](https://ref.isteed.cc/)
|
||||
- [1han.wiki](https://code.1han.wiki/)
|
||||
- [linzhe.top](https://linzhe.top/)
|
||||
- [xushanxiang.com](https://xushanxiang.com/ref/)
|
||||
- [winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)
|
||||
- [isteed.cc](https://ref.isteed.cc/)
|
||||
- [hestudio.org](https://quickref.hestudio.org)
|
||||
- [surcode.cn](https://ref.surcode.cn)
|
||||
- [cms.im](https://quickref.cms.im/)
|
||||
- [nuomiphp.com](https://reference.tool.nuomiphp.com/)
|
||||
- [eryajf.net](https://ref.eryajf.net/)
|
||||
- [kjchmc.cn](https://ref.kjchmc.cn/)
|
||||
- [likeadmin.cn](https://www.likeadmin.cn/quickref/)
|
||||
- [qiubit.cc](http://ref.qiubit.cc)
|
||||
- [aoh.cc](https://aoh.cc/)
|
||||
- [reference.code05.com](https://reference.code05.com/)
|
||||
- [kyoma.top](https://reference.kyoma.top/)
|
||||
- [quickreference.pages.dev](https://quickreference.pages.dev/)
|
||||
- [code05.com](https://reference.code05.com/)
|
||||
- [xhfun.cn](https://ref.xhfun.cn/)
|
||||
|
||||
感谢🙏
|
||||
|
||||
## 利用 Github Actions 定时任务来完成自动更新
|
||||
|
||||
在仓库添加 `.github/workflows/update-ref.yml` 文件 Github Actions 配置,感谢 @eryajf https://github.com/jaywcjlove/reference/issues/102#issuecomment-1368158419 提供方法
|
||||
|
||||
```yml
|
||||
name: 每8个小时更新一次reference
|
||||
on:
|
||||
schedule:
|
||||
- cron: '21 */8 * * *' # 定时任务
|
||||
workflow_dispatch: # 手动运行
|
||||
|
||||
env: # 设置环境变量
|
||||
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间)
|
||||
|
||||
jobs:
|
||||
build: # 自定义名称
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚜 拉取最新代码
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: 'main'
|
||||
repository: 'jaywcjlove/reference'
|
||||
|
||||
- name: ♻️ 编译静态文件
|
||||
run: |
|
||||
echo -e 'REF_URL=https://refs.xxx.net/\nREF_LABEL=网站首页' > .env
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: 🚁 部署到服务器
|
||||
uses: wlixcc/SFTP-Deploy-Action@v1.0
|
||||
with:
|
||||
username: 'root' #ssh user name
|
||||
port: '22' # 远程服务器ssh端口,默认22
|
||||
server: 'prod.refs.xxx.net' # 远程服务器IP
|
||||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} # 认证服务器秘钥对的私钥
|
||||
local_path: './dist/*' # 对应我们项目打包后的静态文件路径
|
||||
remote_path: '/data/www/refs.xxx.net' # 服务器上的路径
|
||||
delete_remote_files: true
|
||||
```
|
||||
|
||||
## 贡献
|
||||
|
||||
请参阅[贡献指南](./CONTRIBUTING.md)了解如何开始。一如既往,感谢我们出色的贡献者!
|
||||
@ -148,44 +214,65 @@ REF_LABEL=网站首页
|
||||
<!--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/Jack-Zhang-1314" title="fw_qaq">
|
||||
<a href="https://github.com/fwqaaq" title="fw_qaq">
|
||||
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq"/>
|
||||
</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/Alex-Programer" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson">
|
||||
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson"/>
|
||||
</a>
|
||||
<a href="https://github.com/Alex-Programer" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</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/LiuYuan-SHU" title="Liuyuan">
|
||||
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Liuyuan"/>
|
||||
</a>
|
||||
<a href="https://github.com/heStudio-Network" title="醉、倾城">
|
||||
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="醉、倾城"/>
|
||||
</a>
|
||||
<a href="https://github.com/sjh42" title="42:p">
|
||||
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
||||
</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/1834423612" title="kjch">
|
||||
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
||||
</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/eryajf" title="二丫讲梵">
|
||||
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
|
||||
</a>
|
||||
<a href="https://github.com/catcto" title="喵仙人">
|
||||
<img src="https://avatars.githubusercontent.com/u/5467932?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/Smartdousha" title="Anko">
|
||||
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="Anko"/>
|
||||
<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="Brid9e">
|
||||
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Brid9e"/>
|
||||
</a>
|
||||
<a href="https://github.com/CharlotteZeng" title="Chart">
|
||||
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="Chart"/>
|
||||
<a href="https://github.com/ch3nnn" title="Ch3nnn">
|
||||
<img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="Ch3nnn"/>
|
||||
</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/DaiNing810" title="DaiN">
|
||||
<img src="https://avatars.githubusercontent.com/u/94962339?v=4" width="42;" alt="DaiN"/>
|
||||
@ -196,17 +283,23 @@ REF_LABEL=网站首页
|
||||
<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/Ding-Kyoma" title="HooinKyoma">
|
||||
<img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/>
|
||||
</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/LufsX" title="LufsX">
|
||||
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
||||
<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"/>
|
||||
@ -214,9 +307,21 @@ REF_LABEL=网站首页
|
||||
<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/PipecraftNet" title="Pipecraft">
|
||||
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
||||
</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/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/whb1998a" title="WHB">
|
||||
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
||||
</a>
|
||||
<a href="https://github.com/hi-liyan" title="Yan Li">
|
||||
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="Yan Li"/>
|
||||
</a>
|
||||
<a href="https://github.com/y52y" title="Zyj">
|
||||
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
||||
</a>
|
||||
@ -229,6 +334,12 @@ REF_LABEL=网站首页
|
||||
<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/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="godotc">
|
||||
<img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godotc"/>
|
||||
</a>
|
||||
@ -241,12 +352,18 @@ REF_LABEL=网站首页
|
||||
<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/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/larry-xue" title="larry">
|
||||
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
||||
</a>
|
||||
@ -259,9 +376,15 @@ REF_LABEL=网站首页
|
||||
<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/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="shelton">
|
||||
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="shelton"/>
|
||||
</a>
|
||||
|
183
README.md
@ -16,7 +16,7 @@ Quick Reference
|
||||
|
||||
## 正在建设中...
|
||||
|
||||
坑已挖,需要您的参与完善和贡献!🙏
|
||||
坑已挖,需要您的参与完善和[贡献](./docs/quickreference.md)!🙏
|
||||
<!--rehype:style=padding-bottom: 23px;-->
|
||||
|
||||
[Ansible](./docs/ansible.md)<!--rehype:style=background: rgb(238 0 0);&class=contributing tag&data-lang=RedHat&data-info=👆看看还缺点儿什么?-->
|
||||
@ -24,6 +24,7 @@ Quick Reference
|
||||
[C#](./docs/cs.md)<!--rehype:style=background: rgb(6 147 13);&class=contributing-->
|
||||
[Django](./docs/djiango.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-->
|
||||
[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-->
|
||||
@ -44,24 +45,23 @@ Quick Reference
|
||||
[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/djiango.md)<!--rehype:style=background: rgb(12 75 51);&class=contributing tag&data-lang=Python-->
|
||||
[Django](./docs/djiango.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-->
|
||||
[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);-->
|
||||
[INI](./docs/ini.md)<!--rehype:style=background: rgb(57 59 60);-->
|
||||
[JSON](./docs/json.md)<!--rehype:style=background: rgb(57 59 60);-->
|
||||
[Java](./docs/java.md)<!--rehype:style=background: rgb(211 55 49);&class=contributing&data-info=👆看看还缺点儿什么?-->
|
||||
[Julia](./docs/julia.md)<!--rehype:style=background: rgb(211 55 49);&class=contributing&data-info=👆看看还缺点儿什么?-->
|
||||
[Julia](./docs/julia.md)<!--rehype:style=background: rgb(26 188 156);&class=contributing&data-info=👆看看还缺点儿什么?-->
|
||||
[Kotlin](./docs/kotlin.md)<!--rehype:style=background: rgb(211 55 49);&class=contributing&data-info=👆看看还缺点儿什么?-->
|
||||
[Kubernetes](./docs/kubernetes.md)<!--rehype:style=background: rgb(51 113 227);&class=contributing&data-info=👆看看还缺点儿什么?-->
|
||||
[LaTeX](./docs/latex.md)<!--rehype:style=background: rgb(0 128 128);&class=contributing-->
|
||||
[Laravel 8](./docs/laravel.md)<!--rehype:style=background: rgb(249 50 44);&class=contributing tag&data-lang=PHP-->
|
||||
[Markdown](./docs/markdown.md)<!--rehype:style=background: rgb(103 61 156);-->
|
||||
[MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(1 117 143);&class=tag&data-lang=SQL-->
|
||||
[MATLAB](./docs/matlab.md)<!--rehype:style=background: rgb(0 118 168);&class=contributing-->
|
||||
[Oracle](./docs/oracle.md)<!--rehype:style=background: rgb(255 0 0);-->
|
||||
[PHP](./docs/php.md)<!--rehype:style=background: rgb(79 91 147);-->
|
||||
[Python](./docs/python.md)<!--rehype:style=background: rgb(43 91 132);-->
|
||||
[PostgreSQL](./docs/postgres.md)<!--rehype:style=background: rgb(43 109 163);&class=tag&data-lang=SQL-->
|
||||
[Ruby](./docs/ruby.md)<!--rehype:style=background: rgb(204 52 45);-->
|
||||
[Rust](./docs/rust.md)<!--rehype:style=background: rgb(71 71 71);-->
|
||||
[Swift](./docs/swift.md)<!--rehype:style=background: rgb(240 81 57);-->
|
||||
@ -74,6 +74,7 @@ Quick Reference
|
||||
|
||||
## 前端
|
||||
|
||||
[前端导航](./docs/feds.md)<!--rehype:style=background: rgb(35 115 205);&class=tag&data-lang=导航-->
|
||||
[CSS 3](./docs/css.md)<!--rehype:style=background: rgb(35 115 205);&class=tag&data-lang=CSS-->
|
||||
[Electron](./docs/electron.md)<!--rehype:style=background: rgb(0 72 153);-->
|
||||
[Emmet](./docs/emmet.md)<!--rehype:style=background: rgb(122 203 23);-->
|
||||
@ -83,14 +84,18 @@ Quick Reference
|
||||
[Sass](./docs/sass.md)<!--rehype:style=background: rgb(207 100 154);&class=tag&data-lang=CSS-->
|
||||
[HTML](./docs/html.md)<!--rehype:style=background: rgb(228 77 39);-->
|
||||
[JavaScript](./docs/javascript.md)<!--rehype:style=background: rgb(203 183 31);-->
|
||||
[jQuery](./docs/jquery.md)<!--rehype:style=background: rgb(203 183 31);-->
|
||||
[Less.js](./docs/lessjs.md)<!--rehype:style=background: rgb(29 54 93);&class=tag&data-lang=CSS-->
|
||||
[Next.js](./docs/nextjs.md)<!--rehype:style=background: rgb(0 0 0);&class=tag&data-lang=React-->
|
||||
[React](./docs/react.md)<!--rehype:style=background: rgb(34 143 173);-->
|
||||
[React Router](./docs/reactrouter.md)<!--rehype:style=background: rgb(244 66 79);&class=tag&data-lang=React-->
|
||||
[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);-->
|
||||
[Tailwind CSS](./docs/tailwindcss.md)<!--rehype:style=background: rgb(49 120 198);-->
|
||||
[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-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## Nodejs
|
||||
@ -101,6 +106,7 @@ Quick Reference
|
||||
[Lerna](./docs/lerna.md)<!--rehype:style=background: rgb(192 132 252);-->
|
||||
[npm](./docs/npm.md)<!--rehype:style=background: rgb(203 2 0);-->
|
||||
[NestJS](./docs/nestjs.md)<!--rehype:style=background: rgb(237 21 67);&class=contributing-->
|
||||
[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);-->
|
||||
<!--rehype:class=home-card-->
|
||||
@ -108,20 +114,16 @@ Quick Reference
|
||||
## 工具
|
||||
|
||||
[Emacs](./docs/emacs.md)<!--rehype:style=background: rgb(98 36 134);-->
|
||||
[Gmail](./docs/gmail.md)<!--rehype:style=background: rgb(234 67 54);-->
|
||||
[Github](./docs/github.md)<!--rehype:style=background: rgb(36 41 47);-->
|
||||
[nginx](./docs/nginx.md)<!--rehype:style=background: rgb(0 153 0);-->
|
||||
[Semver](./docs/semver.md)<!--rehype:style=background: rgb(106 111 141);-->
|
||||
[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);-->
|
||||
[Vim](./docs/vim.md)<!--rehype:style=background: rgb(9 150 8);-->
|
||||
[WebStorm](./docs/webstorm.md)<!--rehype:style=background: rgb(32 148 220);-->
|
||||
[XPath](./docs/xpath.md)<!--rehype:style=background: rgb(91 163 230);-->
|
||||
[Xcode](./docs/xcode.md)<!--rehype:style=background: rgb(24 151 233);&class=tag&data-lang=macOS-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 命令
|
||||
|
||||
[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++-->
|
||||
@ -131,6 +133,7 @@ Quick Reference
|
||||
[Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[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-->
|
||||
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Find](./docs/find.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
@ -138,12 +141,14 @@ Quick Reference
|
||||
[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-->
|
||||
[Lsof](./docs/lsof.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
|
||||
[Netcat](./docs/netcat.md)<!--rehype:style=background: rgb(4 92 135);-->
|
||||
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[OpenSSL](./docs/openssl.md)<!--rehype:style=background: rgb(114 20 18);-->
|
||||
[ps](./docs/ps.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Systemd](./docs/systemd.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[SSH](./docs/ssh.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
[Screen](./docs/screen.md)<!--rehype:style=background: rgb(99 99 99);-->
|
||||
@ -155,9 +160,38 @@ Quick Reference
|
||||
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 数据库
|
||||
|
||||
[MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(1 117 143);&class=tag&data-lang=SQL-->
|
||||
[MongoDB](./docs/mongodb.md)<!--rehype:style=background: rgb(0 237 100);-->
|
||||
[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);-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
## 快捷键
|
||||
|
||||
[Adobe Lightroom](./docs/adobe-lightroom.md)<!--rehype:style=background: rgb(49 168 255);-->
|
||||
[Adobe Photoshop](./docs/adobe-photoshop.md)<!--rehype:style=background: rgb(49 168 255);-->
|
||||
[Adobe XD](./docs/adobe-xd.md)<!--rehype:style=background: rgb(255 97 246);-->
|
||||
[Android Studio](./docs/android-studio.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Firefox](./docs/firefox.md)<!--rehype:style=background: rgb(253 53 76);-->
|
||||
[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-->
|
||||
[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);-->
|
||||
[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-->
|
||||
|
||||
## 其它
|
||||
|
||||
[Quick Reference](./docs/quickreference.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=排版说明-->
|
||||
[Aspect Ratio](./docs/aspect-ratio.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[Github Actions](./docs/github-actions.md)<!--rehype:style=background: rgb(121 184 255);-->
|
||||
[Gitlab CI/CD](./docs/gitlab-ci.md)<!--rehype:style=background: rgb(226 67 41);&class=contributing-->
|
||||
[Colors Named](./docs/colors-named.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=CSS-->
|
||||
@ -181,50 +215,71 @@ Quick Reference
|
||||
## 感谢所有贡献者
|
||||
<!--rehype:wrap-style=text-align: center;max-width: 650px;margin: 0 auto;&class=home-title-reset-->
|
||||
|
||||
请参阅 [Quick Reference](./docs/quickreference.md) 了解如何开始。一如既往,感谢我们出色的贡献者!
|
||||
请参阅 [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/Jack-Zhang-1314" title="fw_qaq">
|
||||
<a href="https://github.com/fwqaaq" title="fw_qaq">
|
||||
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq"/>
|
||||
</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/Alex-Programer" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson">
|
||||
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson"/>
|
||||
</a>
|
||||
<a href="https://github.com/Alex-Programer" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</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/LiuYuan-SHU" title="Liuyuan">
|
||||
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Liuyuan"/>
|
||||
</a>
|
||||
<a href="https://github.com/heStudio-Network" title="醉、倾城">
|
||||
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="醉、倾城"/>
|
||||
</a>
|
||||
<a href="https://github.com/sjh42" title="42:p">
|
||||
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
||||
</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/1834423612" title="kjch">
|
||||
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
||||
</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/eryajf" title="二丫讲梵">
|
||||
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
|
||||
</a>
|
||||
<a href="https://github.com/catcto" title="喵仙人">
|
||||
<img src="https://avatars.githubusercontent.com/u/5467932?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/Smartdousha" title="Anko">
|
||||
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="Anko"/>
|
||||
<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="Brid9e">
|
||||
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Brid9e"/>
|
||||
</a>
|
||||
<a href="https://github.com/CharlotteZeng" title="Chart">
|
||||
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="Chart"/>
|
||||
<a href="https://github.com/ch3nnn" title="Ch3nnn">
|
||||
<img src="https://avatars.githubusercontent.com/u/40114564?v=4" width="42;" alt="Ch3nnn"/>
|
||||
</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/DaiNing810" title="DaiN">
|
||||
<img src="https://avatars.githubusercontent.com/u/94962339?v=4" width="42;" alt="DaiN"/>
|
||||
@ -235,17 +290,23 @@ Quick Reference
|
||||
<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/Ding-Kyoma" title="HooinKyoma">
|
||||
<img src="https://avatars.githubusercontent.com/u/44542198?v=4" width="42;" alt="HooinKyoma"/>
|
||||
</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/LufsX" title="LufsX">
|
||||
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
||||
<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"/>
|
||||
@ -253,9 +314,21 @@ Quick Reference
|
||||
<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/PipecraftNet" title="Pipecraft">
|
||||
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
||||
</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/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/whb1998a" title="WHB">
|
||||
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
||||
</a>
|
||||
<a href="https://github.com/hi-liyan" title="Yan Li">
|
||||
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="Yan Li"/>
|
||||
</a>
|
||||
<a href="https://github.com/y52y" title="Zyj">
|
||||
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
||||
</a>
|
||||
@ -268,6 +341,12 @@ Quick Reference
|
||||
<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/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="godotc">
|
||||
<img src="https://avatars.githubusercontent.com/u/79260851?v=4" width="42;" alt="godotc"/>
|
||||
</a>
|
||||
@ -280,12 +359,18 @@ Quick Reference
|
||||
<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/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/larry-xue" title="larry">
|
||||
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
||||
</a>
|
||||
@ -298,9 +383,15 @@ Quick Reference
|
||||
<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/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="shelton">
|
||||
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="shelton"/>
|
||||
</a>
|
||||
@ -323,25 +414,47 @@ Quick Reference
|
||||
<img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/>
|
||||
</a><!--GAMFC-END-->
|
||||
|
||||
贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成
|
||||
[贡献者](https://github.com/jaywcjlove/reference/graphs/contributors)列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 根据提交次数的先后顺序自动生成
|
||||
<!--rehype:style=padding-top:1rem;-->
|
||||
|
||||
## 国内镜像网站
|
||||
<!--rehype:wrap-style=text-align: center;max-width: 650px;margin: 0 auto;&class=home-title-reset-->
|
||||
|
||||
由于中国国内访问,时常打不开,你可以访问下面镜像网站。推荐自己的[镜像网站](https://github.com/jaywcjlove/reference/issues/102#issue-1451649637)
|
||||
由于中国国内访问,时常打不开,你可以访问下面镜像网站。推荐自己的[镜像网站](https://github.com/jaywcjlove/reference/discussions/206#discussion-4625735)
|
||||
|
||||
[quickref.cn](https://quickref.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[ecdata.cn](http://ref.ecdata.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[aibk.cn](https://quickref.aibk.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[jgeek.cn](http://reference.jgeek.cn/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[laoleng.vip](http://bbs.laoleng.vip/reference/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[liujiapeng.com](https://www.liujiapeng.com/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[dbyun.net](https://www.dbyun.net/reference/index.html)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[dc6.fun](https://dc6.fun/reference/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
<!--rehype:class=home-card&style=margin:2.2rem 0;display: flex;justify-content: center;gap: 1rem;flex-wrap: wrap;-->
|
||||
[quickref.cn](https://quickref.cn)<!--rehype:target=_blank-->
|
||||
[ecdata.cn](http://ref.ecdata.cn)<!--rehype:target=_blank-->
|
||||
[aibk.cn](https://quickref.aibk.cn)<!--rehype:target=_blank-->
|
||||
[jgeek.cn](http://reference.jgeek.cn/)<!--rehype:target=_blank-->
|
||||
[laoleng.vip](http://bbs.laoleng.vip/reference/)<!--rehype:target=_blank-->
|
||||
[liujiapeng.com](https://www.liujiapeng.com/)<!--rehype:target=_blank-->
|
||||
[dbyun.net](https://www.dbyun.net/reference/index.html)<!--rehype:target=_blank-->
|
||||
[dc6.fun](https://dc6.fun/reference/)<!--rehype:target=_blank-->
|
||||
[if010.com](https://quickref.if010.com/)<!--rehype:target=_blank-->
|
||||
[pipecraft.net](https://quickref.pipecraft.net/)<!--rehype:target=_blank&class=contributing&data-info=👆需要梯子-->
|
||||
[isteed.cc](https://ref.isteed.cc/)<!--rehype:target=_blank-->
|
||||
[1han.wiki](https://code.1han.wiki/)<!--rehype:target=_blank-->
|
||||
[linzhe.top](https://linzhe.top/)<!--rehype:target=_blank-->
|
||||
[xushanxiang.com](https://xushanxiang.com/ref/)<!--rehype:target=_blank-->
|
||||
[winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)<!--rehype:target=_blank&class=contributing&data-info=👆需要梯子-->
|
||||
[isteed.cc](https://ref.isteed.cc/)<!--rehype:target=_blank-->
|
||||
[hestudio.org](https://quickref.hestudio.org)<!--rehype:target=_blank&class=contributing&data-info=👆整点自动同步-->
|
||||
[surcode.cn](https://ref.surcode.cn)<!--rehype:target=_blank-->
|
||||
[cms.im](https://quickref.cms.im/)<!--rehype:target=_blank-->
|
||||
[nuomiphp.com](https://reference.tool.nuomiphp.com/)<!--rehype:target=_blank-->
|
||||
[eryajf.net](https://ref.eryajf.net/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[kjchmc.cn](https://ref.kjchmc.cn/)<!--rehype:target=_blank&class=contributing&data-info=👆实时同步,多线路-->
|
||||
[likeadmin.cn](https://www.likeadmin.cn/quickref/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[qiubit.cc](http://ref.qiubit.cc)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[aoh.cc](https://aoh.cc/)<!--rehype:target=_blank-->
|
||||
[reference.code05.com](https://reference.code05.com/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[kyoma.top](https://reference.kyoma.top/)<!--rehype:target=_blank&class=contributing&data-info=👆实时同步-->
|
||||
[quickreference.pages.dev](https://quickreference.pages.dev/)<!--rehype:target=_blank-->
|
||||
[code05.com](https://reference.code05.com/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
[xhfun.cn](https://ref.xhfun.cn/)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||
<!--rehype:class=home-card home-links-->
|
||||
|
||||
如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 gh-pages 分支代码到你的静态服务就可以了,还可以使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版。
|
||||
如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 [gh-pages](https://github.com/jaywcjlove/reference/tree/gh-pages) 分支代码到你的静态服务就可以了,还可以使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版。
|
||||
|
||||
<!--rehype:ignore:start-->
|
||||
## License
|
||||
|
3
assets/adb.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 16" height="1em" width="1em">
|
||||
<path d="m10.213 1.471.691-1.26c.046-.083.03-.147-.048-.192-.085-.038-.15-.019-.195.058l-.7 1.27A4.832 4.832 0 0 0 8.005.941c-.688 0-1.34.135-1.956.404l-.7-1.27C5.303 0 5.239-.018 5.154.02c-.078.046-.094.11-.049.193l.691 1.259a4.25 4.25 0 0 0-1.673 1.476A3.697 3.697 0 0 0 3.5 5.02h9c0-.75-.208-1.44-.623-2.072a4.266 4.266 0 0 0-1.664-1.476ZM6.22 3.303a.367.367 0 0 1-.267.11.35.35 0 0 1-.263-.11.366.366 0 0 1-.107-.264.37.37 0 0 1 .107-.265.351.351 0 0 1 .263-.11c.103 0 .193.037.267.11a.36.36 0 0 1 .112.265.36.36 0 0 1-.112.264Zm4.101 0a.351.351 0 0 1-.262.11.366.366 0 0 1-.268-.11.358.358 0 0 1-.112-.264c0-.103.037-.191.112-.265a.367.367 0 0 1 .268-.11c.104 0 .19.037.262.11a.367.367 0 0 1 .107.265c0 .102-.035.19-.107.264ZM3.5 11.77c0 .294.104.544.311.75.208.204.46.307.76.307h.758l.01 2.182c0 .276.097.51.292.703a.961.961 0 0 0 .7.288.973.973 0 0 0 .71-.288.95.95 0 0 0 .292-.703v-2.182h1.343v2.182c0 .276.097.51.292.703a.972.972 0 0 0 .71.288.973.973 0 0 0 .71-.288.95.95 0 0 0 .292-.703v-2.182h.76c.291 0 .54-.103.749-.308.207-.205.311-.455.311-.75V5.365h-9v6.404Zm10.495-6.587a.983.983 0 0 0-.702.278.91.91 0 0 0-.293.685v4.063c0 .271.098.501.293.69a.97.97 0 0 0 .702.284c.28 0 .517-.095.712-.284a.924.924 0 0 0 .293-.69V6.146a.91.91 0 0 0-.293-.685.995.995 0 0 0-.712-.278Zm-12.702.283a.985.985 0 0 1 .712-.283c.273 0 .507.094.702.283a.913.913 0 0 1 .293.68v4.063a.932.932 0 0 1-.288.69.97.97 0 0 1-.707.284.986.986 0 0 1-.712-.284.924.924 0 0 1-.293-.69V6.146c0-.264.098-.491.293-.68Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
3
assets/adobe-lightroom.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M19.75.3H4.25C1.9.3 0 2.2 0 4.55v14.9c0 2.35 1.9 4.25 4.25 4.25h15.5c2.35 0 4.25-1.9 4.25-4.25V4.55C24 2.2 22.1.3 19.75.3zm-6.99 16.389c0 .051-.029.09-.06.121a.17.17 0 0 1-.101.029H6.26c-.11 0-.16-.061-.16-.18V6.44c-.01-.07.04-.13.11-.14h2c.05-.01.11.03.11.08v8.43h4.62c.101 0 .131.049.11.14l-.29 1.739zm6.25-7.859v1.95c0 .08-.05.11-.16.11-.649-.04-1.3.08-1.89.34-.2.09-.39.21-.54.37v5.1c0 .1-.04.14-.13.14h-1.95c-.08.01-.15-.04-.16-.119V11.14c0-.24 0-.49-.01-.75s-.01-.52-.02-.78c-.01-.22-.03-.44-.061-.66-.01-.05.02-.1.07-.11.01-.01.02-.01.04 0h1.75c.1 0 .18.07.21.16.04.07.07.15.08.23.02.1.039.21.05.31.01.11.021.23.021.36.299-.35.66-.64 1.069-.86.46-.25.97-.37 1.49-.36.069-.01.13.04.14.11l.001.04z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 830 B |
3
assets/adobe-photoshop.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M9.85 8.42c-.37-.15-.77-.21-1.18-.2-.26 0-.49 0-.68.01-.2-.01-.34 0-.41.01v3.36c.14.01.27.02.39.02h.53c.39 0 .78-.06 1.15-.18.32-.09.6-.28.82-.53.21-.25.31-.59.31-1.03.01-.31-.07-.62-.23-.89a1.45 1.45 0 0 0-.7-.57zM19.75.3H4.25C1.9.3 0 2.2 0 4.55v14.899c0 2.35 1.9 4.25 4.25 4.25h15.5c2.35 0 4.25-1.9 4.25-4.25V4.55C24 2.2 22.1.3 19.75.3zm-7.391 11.65c-.399.56-.959.98-1.609 1.22-.68.25-1.43.34-2.25.34-.24 0-.4 0-.5-.01s-.24-.01-.43-.01v3.209c.01.07-.04.131-.11.141H5.52c-.08 0-.12-.041-.12-.131V6.42c0-.07.03-.11.1-.11.17 0 .33 0 .56-.01.24-.01.49-.01.76-.02s.56-.01.87-.02c.31-.01.61-.01.91-.01.82 0 1.5.1 2.06.31.5.17.96.45 1.34.82.32.32.57.71.73 1.14.149.42.229.85.229 1.3.001.86-.199 1.57-.6 2.13zm7.091 3.89c-.28.4-.671.709-1.12.891-.49.209-1.09.318-1.811.318-.459 0-.91-.039-1.359-.129-.35-.061-.7-.17-1.02-.32-.07-.039-.121-.109-.111-.189v-1.74c0-.029.011-.07.041-.09.029-.02.06-.01.09.01.39.23.8.391 1.24.49.379.1.779.15 1.18.15.38 0 .65-.051.83-.141.16-.07.27-.24.27-.42 0-.141-.08-.27-.24-.4-.16-.129-.489-.279-.979-.471-.51-.18-.979-.42-1.42-.719a2.625 2.625 0 0 1-.761-.85 2.158 2.158 0 0 1-.229-1.021c0-.43.12-.84.341-1.21.25-.4.619-.72 1.049-.92.469-.239 1.059-.349 1.769-.349.41 0 .83.03 1.24.09.3.04.59.12.86.23.039.01.08.05.1.09.01.04.02.08.02.12v1.63c0 .04-.02.08-.05.1-.09.02-.14.02-.18 0-.3-.16-.62-.27-.96-.34-.37-.08-.74-.13-1.12-.13-.2-.01-.41.02-.601.07-.129.03-.24.1-.31.2-.05.08-.08.18-.08.27s.04.18.101.26c.09.11.209.2.34.27.229.12.47.23.709.33.541.18 1.061.43 1.541.73.33.209.6.49.789.83.16.318.24.67.23 1.029.011.471-.129.94-.389 1.331z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
2
assets/adobe-xd.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 230 225">
|
||||
<path fill="currentColor" d="M191.816406,0 C212.904623,-3.87384253e-15 230,17.0953772 230,38.1835938 L230,186.066406 C230,207.154623 212.904623,224.25 191.816406,224.25 L38.1835938,224.25 C17.0953772,224.25 2.58256169e-15,207.154623 0,186.066406 L0,38.1835938 C-2.58256169e-15,17.0953772 17.0953772,3.87384253e-15 38.1835938,0 L191.816406,0 Z M195.077284,49.091346 L194.968125,49.0996094 L175.526836,49.0996094 C174.910508,49.0996094 174.601445,49.4607813 174.601445,50.1795313 L174.601445,80.5754688 L173.781172,80.5035938 L172.659922,80.41375 L171.669844,80.3436719 L171.080469,80.3095313 L170.550391,80.2861719 L170.077813,80.2708984 L169.664531,80.2664063 C160.200391,80.2664063 152.125234,82.1180859 145.440859,85.8214453 L144.91168,86.1089453 C138.763421,89.5141795 133.664216,94.5369517 130.166523,100.633086 C126.671624,106.792265 124.861878,113.763817 124.919648,120.845234 L124.923242,121.532539 C125.011289,129.971563 126.759648,137.020703 130.165625,142.677266 C133.543408,148.383655 138.57396,152.930169 144.591836,155.715391 C151.05183,158.667646 158.088508,160.143302 165.190313,160.035078 L166.254063,160.023398 C170.866829,159.944136 175.465136,159.483464 180.001953,158.646094 C185.345985,157.661087 190.569912,156.10972 195.585352,154.018242 C196.182744,153.743842 196.550536,153.130974 196.511641,152.474727 L196.358906,150.159453 L196.071406,146.156914 C195.952813,144.392383 195.893516,142.742852 195.893516,141.211914 L195.893516,50.025 C195.930082,49.7701021 195.844423,49.5128727 195.662338,49.3307875 C195.480252,49.1487023 195.223023,49.0630429 194.968125,49.0996094 Z M121.116289,57.8451797 C120.918558,57.505081 120.519883,57.3365583 120.138164,57.4317187 L99.9260156,57.4317187 C99.5008674,57.3901695 99.0726792,57.4705716 98.6915625,57.6635156 C98.4049609,57.9411328 98.1929297,58.2861328 98.0743359,58.6670703 C95.989605,62.7301089 93.855056,66.7673925 91.6711719,70.7780078 C89.4592187,74.8407422 87.2984766,78.8792187 85.1916406,82.8907422 C83.046362,86.9730975 80.9632439,91.0878173 78.9430078,95.2334766 L78.7884766,95.2334766 C76.817187,91.0868307 74.6810973,87.0205574 72.3853125,83.044375 C70.0538061,79.0056478 67.7650584,74.9423869 65.5194531,70.8552734 C63.2562891,66.7422266 61.1988672,62.6273828 59.3471875,58.5125391 C59.1073047,58.1630469 58.7901562,57.8728516 58.4217969,57.6635156 C57.9815263,57.4848886 57.5072287,57.4053935 57.0328125,57.4317187 L35.2780469,57.4317187 C34.9257161,57.4076934 34.5826053,57.5507949 34.3517578,57.8180469 C34.1469141,58.0767969 34.198125,58.4110156 34.5062891,58.8207031 L63.5132422,107.884375 L33.7354297,156.795312 C33.5281595,157.114603 33.4456497,157.499009 33.5036328,157.875234 C33.5359766,158.128594 33.6366016,158.164531 33.8046094,158.154648 L34.1064844,158.127695 L34.198125,158.125 L55.3356641,158.125 L55.6860547,158.119609 C56.5278906,158.091758 57.1325391,157.921055 57.4964062,157.103477 C59.7587305,153.094326 61.9702615,149.056724 64.1304687,144.991641 C66.2894141,140.929805 68.4753125,136.840117 70.6881641,132.725273 C72.8822374,128.642268 75.0168509,124.527589 77.0913281,120.382539 L77.2458594,120.382539 C79.492198,124.571384 81.7809354,128.737353 84.1117187,132.879805 L84.9724219,134.419727 C86.9211424,137.916516 88.8200324,141.440844 90.6685156,144.991641 C92.7350026,148.972723 94.7924298,152.958502 96.8407813,156.948945 C97.3645703,157.824023 98.224375,157.994727 99.4175,158.026172 L99.8523438,158.033359 L121.989844,158.033359 C122.132695,158.01 122.261172,158.004609 122.376172,158.004609 L122.588203,158.01 L122.7625,158.012695 C122.919727,158.006406 123.022148,157.965078 123.069766,157.797969 C123.167695,157.40625 123.112891,156.992969 122.915234,156.640781 L92.2111328,106.341758 L120.909922,58.9734375 L120.99168,58.8997656 C121.263231,58.6151174 121.314021,58.1852783 121.116289,57.8451797 Z M168.892773,98.1641797 C169.949193,98.1613542 171.005057,98.212933 172.056172,98.3187109 C172.916134,98.4008331 173.7676,98.5556177 174.601445,98.7814063 L174.601445,140.902852 L174.125273,141.034922 C173.169038,141.283616 172.192412,141.445986 171.207148,141.520078 C169.971797,141.623398 168.634922,141.675787 167.195625,141.675787 C164.498244,141.68816 161.81606,141.271154 159.249844,140.440156 C156.820509,139.673501 154.602403,138.353156 152.770312,136.583164 C150.855907,134.659039 149.381532,132.342646 148.448828,129.793672 C147.303124,126.630834 146.753878,123.282959 146.828945,119.919844 L146.832539,119.401445 C146.901719,114.600195 147.955586,110.709961 149.992344,107.730742 C152.03261,104.703627 154.823739,102.257983 158.092656,100.633086 C161.448702,98.9729615 165.148754,98.1271298 168.892773,98.1641797 Z"/></svg>
|
After Width: | Height: | Size: 4.6 KiB |
3
assets/android-studio.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M19.27 10.337a.604.604 0 0 0-.603.603v9.832h-1.738l-3.336-6.94c.476-.538.68-1.285.525-2a2.286 2.286 0 0 0-1.29-1.625v-.812a.847.847 0 0 0-.844-.864.848.848 0 0 0-.432.118.86.86 0 0 0-.412.766v.72a2.3 2.3 0 0 0-1.487 2.52 2.282 2.282 0 0 0 .591 1.21l-3.21 6.907h-2.94a1.996 1.996 0 0 1-1.983-1.99V5.017c-.006 1.102.883 2 1.986 2.006a2.024 2.024 0 0 0 .132-.004h14.745s2.535-.218 2.862 1.54a.495.495 0 0 0-.445.489c0 .711-.579 1.29-1.302 1.29h-.819zm-2.048 12.2a.973.973 0 0 1-.45 1.3.965.965 0 0 1-.402.093.974.974 0 0 1-.32-.045c-.024-.008-.046-.021-.07-.031a.97.97 0 0 1-.227-.132c-.025-.02-.05-.038-.072-.06a.96.96 0 0 1-.21-.276l-1.256-2.614-1.558-3.245a.772.772 0 0 0-.7-.444h-.002a.792.792 0 0 0-.709.444l-1.51 3.245-1.233 2.646a.972.972 0 0 1-.798.58c-.063.005-.124-.002-.185-.009-.034-.003-.069-.005-.103-.012-.048-.01-.095-.028-.142-.045-.03-.012-.06-.02-.09-.034a.987.987 0 0 1-.14-.09c-.021-.015-.045-.027-.066-.044a.986.986 0 0 1-.169-.185.979.979 0 0 1-.07-.985l.846-1.822 3.268-7.031a1.796 1.796 0 0 1-.708-1.164c-.155-.98.513-1.9 1.493-2.056V9.395a.354.354 0 0 1 .168-.316.347.347 0 0 1 .354 0 .354.354 0 0 1 .167.316v1.159l.013.006a1.803 1.803 0 0 1 1.288 1.378 1.784 1.784 0 0 1-.644 1.784l3.389 7.05.848 1.765zm-4.238-10.231a1.1 1.1 0 0 0-1.093-1.109 1.12 1.12 0 0 0-.786.322 1.101 1.101 0 0 0-.323.772 1.1 1.1 0 0 0 1.093 1.108h.008a1.1 1.1 0 0 0 1.101-1.093zm-1.027 5.277a.287.287 0 0 0-.257.155l-1.413 3.034h3.374l-1.457-3.033a.274.274 0 0 0-.247-.156zm8.143-6.746h-.83a.103.103 0 0 0-.103.103v12.91a.103.103 0 0 0 .096.103h.844a1.79 1.79 0 0 0 1.783-1.79V9.047a1.79 1.79 0 0 1-1.79 1.79zM2.61 5.017v.018a1.5 1.5 0 0 0 1.487 1.487 12.061 12.061 0 0 1 .131-.003h1.129a6.598 6.598 0 0 1 1.638-3.486H4.099A1.992 1.992 0 0 0 2.18 4.53c.242.036.43.235.43.486zm6.338-2.899L7.91.328a.219.219 0 0 1 0-.218.238.238 0 0 1 .187-.11.219.219 0 0 1 .187.11l1.05 1.815a6.49 6.49 0 0 1 5.318 0L15.696.11a.219.219 0 0 1 .373.22l-1.03 1.79a6.122 6.122 0 0 1 3.098 4.401L5.85 6.52a6.122 6.122 0 0 1 3.097-4.4zm5.377 2.62a.515.515 0 0 0 .527.503.515.515 0 0 0 .516-.515.521.521 0 0 0-.889-.367.515.515 0 0 0-.154.38zm-5.717-.006a.515.515 0 0 0 .52.51.509.509 0 0 0 .367-.149.521.521 0 1 0-.734-.734.515.515 0 0 0-.153.373z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
3
assets/firefox.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M503.52 241.48c-.12-1.56-.24-3.12-.24-4.68v-.12l-.36-4.68v-.12a245.86 245.86 0 0 0-7.32-41.15c0-.12 0-.12-.12-.24l-1.08-4c-.12-.24-.12-.48-.24-.6-.36-1.2-.72-2.52-1.08-3.72-.12-.24-.12-.6-.24-.84-.36-1.2-.72-2.4-1.08-3.48-.12-.36-.24-.6-.36-1-.36-1.2-.72-2.28-1.2-3.48l-.36-1.08c-.36-1.08-.84-2.28-1.2-3.36a8.27 8.27 0 0 0-.36-1c-.48-1.08-.84-2.28-1.32-3.36-.12-.24-.24-.6-.36-.84-.48-1.2-1-2.28-1.44-3.48 0-.12-.12-.24-.12-.36-1.56-3.84-3.24-7.68-5-11.4l-.36-.72c-.48-1-.84-1.8-1.32-2.64-.24-.48-.48-1.08-.72-1.56-.36-.84-.84-1.56-1.2-2.4-.36-.6-.6-1.2-1-1.8s-.84-1.44-1.2-2.28c-.36-.6-.72-1.32-1.08-1.92s-.84-1.44-1.2-2.16a18.07 18.07 0 0 0-1.2-2c-.36-.72-.84-1.32-1.2-2s-.84-1.32-1.2-2-.84-1.32-1.2-1.92-.84-1.44-1.32-2.16a15.63 15.63 0 0 0-1.2-1.8L463.2 119a15.63 15.63 0 0 0-1.2-1.8c-.48-.72-1.08-1.56-1.56-2.28-.36-.48-.72-1.08-1.08-1.56l-1.8-2.52c-.36-.48-.6-.84-1-1.32-1-1.32-1.8-2.52-2.76-3.72a248.76 248.76 0 0 0-23.51-26.64A186.82 186.82 0 0 0 412 62.46c-4-3.48-8.16-6.72-12.48-9.84a162.49 162.49 0 0 0-24.6-15.12c-2.4-1.32-4.8-2.52-7.2-3.72a254 254 0 0 0-55.43-19.56c-1.92-.36-3.84-.84-5.64-1.2h-.12c-1-.12-1.8-.36-2.76-.48a236.35 236.35 0 0 0-38-4h-10.63a234.62 234.62 0 0 0-45.48 5c-33.59 7.08-63.23 21.24-82.91 39-1.08 1-1.92 1.68-2.4 2.16l-.48.48h.13l-.12.12.12-.12a.12.12 0 0 0 .12-.12l-.12.12a.42.42 0 0 1 .24-.12c14.64-8.76 34.92-16 49.44-19.56l5.88-1.44c.36-.12.84-.12 1.2-.24 1.68-.36 3.36-.72 5.16-1.08.24 0 .6-.12.84-.12C250.94 20.94 319.34 40.14 367 85.61a171.49 171.49 0 0 1 26.88 32.76c30.36 49.2 27.48 111.11 3.84 147.59-34.44 53-111.35 71.27-159 24.84a84.19 84.19 0 0 1-25.56-59 74.05 74.05 0 0 1 6.24-31c1.68-3.84 13.08-25.67 18.24-24.59-13.08-2.76-37.55 2.64-54.71 28.19-15.36 22.92-14.52 58.2-5 83.28a132.85 132.85 0 0 1-12.12-39.24c-12.24-82.55 43.31-153 94.31-170.51-27.48-24-96.47-22.31-147.71 15.36-29.88 22-51.23 53.16-62.51 90.36 1.68-20.88 9.6-52.08 25.8-83.88-17.16 8.88-39 37-49.8 62.88-15.6 37.43-21 82.19-16.08 124.79.36 3.24.72 6.36 1.08 9.6 19.92 117.11 122 206.38 244.78 206.38C392.77 503.42 504 392.19 504 255c-.12-4.52-.24-9.08-.48-13.52Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
8
assets/flask.svg
Normal file
After Width: | Height: | Size: 7.2 KiB |
3
assets/github.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 1984 2048" height="1em" width="1em">
|
||||
<path d="M663.6 1589.6c0 8-9.2 14.4-20.8 14.4-13.2 1.2-22.4-5.2-22.4-14.4 0-8 9.2-14.4 20.8-14.4 12-1.2 22.4 5.2 22.4 14.4zm-124.4-18c-2.8 8 5.2 17.2 17.2 19.6 10.4 4 22.4 0 24.8-8s-5.2-17.2-17.2-20.8c-10.4-2.8-22 1.2-24.8 9.2zm176.8-6.8c-11.6 2.8-19.6 10.4-18.4 19.6 1.2 8 11.6 13.2 23.6 10.4 11.6-2.8 19.6-10.4 18.4-18.4-1.2-7.6-12-12.8-23.6-11.6zM979.2 32C424.4 32 0 453.2 0 1008c0 443.6 279.2 823.2 678 956.8 51.2 9.2 69.2-22.4 69.2-48.4 0-24.8-1.2-161.6-1.2-245.6 0 0-280 60-338.8-119.2 0 0-45.6-116.4-111.2-146.4 0 0-91.6-62.8 6.4-61.6 0 0 99.6 8 154.4 103.2 87.6 154.4 234.4 110 291.6 83.6 9.2-64 35.2-108.4 64-134.8-223.6-24.8-449.2-57.2-449.2-442 0-110 30.4-165.2 94.4-235.6-10.4-26-44.4-133.2 10.4-271.6 83.6-26 276 108 276 108 80-22.4 166-34 251.2-34s171.2 11.6 251.2 34c0 0 192.4-134.4 276-108 54.8 138.8 20.8 245.6 10.4 271.6 64 70.8 103.2 126 103.2 235.6 0 386-235.6 416.8-459.2 442 36.8 31.6 68 91.6 68 185.6 0 134.8-1.2 301.6-1.2 334.4 0 26 18.4 57.6 69.2 48.4 400-132.8 671.2-512.4 671.2-956 0-554.8-450-976-1004.8-976zM388.8 1411.6c-5.2 4-4 13.2 2.8 20.8 6.4 6.4 15.6 9.2 20.8 4 5.2-4 4-13.2-2.8-20.8-6.4-6.4-15.6-9.2-20.8-4zm-43.2-32.4c-2.8 5.2 1.2 11.6 9.2 15.6 6.4 4 14.4 2.8 17.2-2.8 2.8-5.2-1.2-11.6-9.2-15.6-8-2.4-14.4-1.2-17.2 2.8zm129.6 142.4c-6.4 5.2-4 17.2 5.2 24.8 9.2 9.2 20.8 10.4 26 4 5.2-5.2 2.8-17.2-5.2-24.8-8.8-9.2-20.8-10.4-26-4zm-45.6-58.8c-6.4 4-6.4 14.4 0 23.6 6.4 9.2 17.2 13.2 22.4 9.2 6.4-5.2 6.4-15.6 0-24.8-5.6-9.2-16-13.2-22.4-8z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
9
assets/gitlab.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 236" height="1em" width="1em">
|
||||
<path d="m128.075 236.075 47.104-144.97H80.97l47.104 144.97z" fill="#E24329"/>
|
||||
<path d="M128.075 236.074 80.97 91.104H14.956l113.119 144.97z" fill="#FC6D26"/>
|
||||
<path d="M14.956 91.104.642 135.16a9.752 9.752 0 0 0 3.542 10.903l123.891 90.012-113.12-144.97z" fill="#FCA326"/>
|
||||
<path d="M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0l-28.37 87.315z" fill="#E24329"/>
|
||||
<path d="m128.075 236.074 47.104-144.97h66.015l-113.12 144.97z" fill="#FC6D26"/>
|
||||
<path d="m241.194 91.104 14.314 44.056a9.752 9.752 0 0 1-3.543 10.903l-123.89 90.012 113.119-144.97z" fill="#FCA326"/>
|
||||
<path d="M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0l28.37 87.315z" fill="#E24329"/>
|
||||
</svg>
|
After Width: | Height: | Size: 798 B |
3
assets/google-chrome.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 512 512" height="1em" width="1em">
|
||||
<path d="M0 256c0-46.6 12.47-90.4 34.27-128.9L144.1 318.3C166 357.5 207.9 384 256 384c14.3 0 27.1-2.3 40.8-6.6l-76.3 132.2C95.9 492.3 0 385.3 0 256zm365.1 65.6c12.3-19.2 18.9-42.5 18.9-65.6 0-38.2-16.8-72.5-43.3-96h152.7c12 29.6 18.6 62.1 18.6 96 0 141.4-114.6 255.1-256 256l109.1-190.4zM477.8 128H256c-62.9 0-113.7 44.1-125.5 102.7L54.19 98.47C101 38.53 174 0 256 0c94.8 0 177.5 51.48 221.8 128zM168 256c0-48.6 39.4-88 88-88s88 39.4 88 88-39.4 88-88 88-88-39.4-88-88z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 589 B |
3
assets/intelli-j-idea.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 32 32" height="1em" width="1em">
|
||||
<path d="M0 0v32h32V0zm4.964 4.145h6.667v2.448H9.776v8.371h1.855v2.443H4.964v-2.443h1.927V6.593H4.964zm14.739 0h2.964v8.667c0 .819-.073 1.485-.297 2.079a4.002 4.002 0 0 1-.963 1.479c-.371.371-.885.745-1.48.891a5.192 5.192 0 0 1-1.927.371c-1.036 0-1.927-.224-2.593-.595a6.403 6.403 0 0 1-1.704-1.405l1.855-2.073c.369.443.74.74 1.109.964.369.219.812.369 1.26.369.521 0 .959-.151 1.333-.521.292-.369.443-.891.443-1.703zM2.964 26h12v2h-12z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 554 B |
3
assets/jquery.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M1.525 5.87c-2.126 3.054-1.862 7.026-.237 10.269.037.079.078.154.118.229.023.052.049.1.077.15.013.027.031.056.047.082.026.052.054.102.081.152l.157.266c.03.049.057.097.09.146.056.094.12.187.178.281.026.04.05.078.079.117a6.368 6.368 0 0 0 .31.445c.078.107.156.211.24.315.027.038.058.076.086.115l.22.269c.028.03.055.067.084.099.098.118.202.233.306.35l.005.006a3.134 3.134 0 0 0 .425.44c.08.083.16.165.245.245l.101.097c.111.105.223.209.34.309.002 0 .003.002.005.003l.057.05c.102.089.205.178.31.26l.125.105c.085.068.174.133.26.2l.137.105c.093.07.192.139.287.207.035.025.07.05.106.073l.03.023.28.185.12.08c.148.094.294.184.44.272.041.02.084.044.123.068.108.062.22.125.329.183.06.034.122.063.184.094.075.042.153.083.234.125a.324.324 0 0 1 .056.023c.033.015.064.031.096.047.12.06.245.118.375.175.024.01.05.02.076.034.144.063.289.123.438.182.034.01.07.027.105.04.135.051.274.103.411.152l.05.018c.154.052.305.102.46.15.036.01.073.023.111.033.16.048.314.105.474.137 10.273 1.872 13.258-6.177 13.258-6.177-2.508 3.266-6.958 4.127-11.174 3.169-.156-.036-.312-.086-.47-.132a13.539 13.539 0 0 1-.567-.182l-.062-.024c-.136-.046-.267-.097-.4-.148a1.615 1.615 0 0 0-.11-.04c-.148-.06-.29-.121-.433-.184-.031-.01-.057-.024-.088-.036a23.44 23.44 0 0 1-.362-.17 1.485 1.485 0 0 1-.106-.052c-.094-.044-.188-.095-.28-.143a3.947 3.947 0 0 1-.187-.096c-.114-.06-.227-.125-.34-.187-.034-.024-.073-.044-.112-.066a15.922 15.922 0 0 1-.439-.27 2.107 2.107 0 0 1-.118-.078 6.01 6.01 0 0 1-.312-.207c-.035-.023-.067-.048-.103-.073a9.553 9.553 0 0 1-.295-.212c-.042-.034-.087-.066-.132-.1-.088-.07-.177-.135-.265-.208l-.118-.095a10.593 10.593 0 0 1-.335-.28.258.258 0 0 0-.037-.031l-.347-.316-.1-.094c-.082-.084-.166-.164-.25-.246l-.098-.1a9.081 9.081 0 0 1-.309-.323l-.015-.016c-.106-.116-.21-.235-.313-.355-.027-.03-.053-.064-.08-.097l-.227-.277a21.275 21.275 0 0 1-.34-.449C2.152 11.79 1.306 7.384 3.177 3.771m4.943-.473c-1.54 2.211-1.454 5.169-.254 7.508a9.111 9.111 0 0 0 .678 1.133c.23.33.484.721.793.988.107.122.223.24.344.36l.09.09c.114.11.232.217.35.325l.016.013a9.867 9.867 0 0 0 .414.342c.034.023.063.05.096.073.14.108.282.212.428.316l.015.009c.062.045.128.086.198.13.028.018.06.042.09.06.106.068.21.132.318.197.017.007.032.016.048.023.09.055.188.108.282.157.033.02.065.035.1.054.066.033.132.068.197.102l.032.014c.135.067.273.129.408.19.034.014.063.025.092.039.111.048.224.094.336.137.05.017.097.037.144.052.102.038.21.073.31.108l.14.045c.147.045.295.104.449.13C22.164 17.206 24 11.098 24 11.098c-1.653 2.38-4.852 3.513-8.261 2.628a8.04 8.04 0 0 1-.449-.13c-.048-.014-.09-.029-.136-.043-.104-.036-.211-.07-.312-.109l-.144-.054c-.113-.045-.227-.087-.336-.135-.034-.015-.065-.025-.091-.04-.14-.063-.281-.125-.418-.192l-.206-.107-.119-.06a5.673 5.673 0 0 1-.265-.15.62.62 0 0 1-.062-.035c-.106-.066-.217-.13-.318-.198-.034-.019-.065-.042-.097-.062l-.208-.136c-.144-.1-.285-.208-.428-.313-.032-.029-.063-.053-.094-.079-1.499-1.178-2.681-2.79-3.242-4.613-.59-1.897-.46-4.023.56-5.75m4.292-.147c-.909 1.334-.996 2.99-.37 4.46.665 1.563 2.024 2.79 3.608 3.37.065.025.128.046.196.07l.088.027c.092.03.185.063.28.084 4.381.845 5.567-2.25 5.886-2.704-1.043 1.498-2.792 1.857-4.938 1.335a4.85 4.85 0 0 1-.516-.16 6.352 6.352 0 0 1-.618-.254 6.53 6.53 0 0 1-1.082-.66c-1.922-1.457-3.113-4.236-1.859-6.5"/>
|
||||
</svg>
|
After Width: | Height: | Size: 3.3 KiB |
5
assets/kubernetes.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" height="1em" width="1em">
|
||||
<path d="m10.013 13.738-2.254.387a4.475 4.475 0 0 0 1.753 2.231l.865-2.095a.27.27 0 0 0 .022-.228c-.022-.18-.204-.295-.386-.295zm.865-2.914c.205 0 .387-.159.387-.364l.114-2.277-.456.091a4.516 4.516 0 0 0-2.118 1.162l1.89 1.343c.069.022.115.045.183.045zm-1.002 1.48a.366.366 0 0 0-.045-.524l-1.685-1.503a4.797 4.797 0 0 0-.661 2.778l2.209-.637c.091-.023.137-.046.182-.114zm1.457.797.616.296.614-.296.16-.661-.433-.546h-.683l-.433.546zm1.344-2.436c.114.159.341.182.5.091l1.867-1.32a4.286 4.286 0 0 0-2.573-1.23l.137 2.3a.215.215 0 0 0 .069.159z"/>
|
||||
<path d="m21.944 14.103-1.73-7.446c-.113-.364-.387-.66-.729-.842L12.541 2.49c-.182-.091-.387-.114-.569-.114s-.387 0-.569.045L4.457 5.769a1.22 1.22 0 0 0-.683.842l-1.708 7.492c-.068.387.023.774.25 1.093l4.805 5.943c.273.273.66.456 1.047.479h7.651c.41.045.797-.137 1.048-.479l4.805-5.943c.227-.319.318-.706.272-1.093zm-2.845.501c-.046 0-.068 0-.114-.023-.022-.023-.022-.023-.045-.023-.046 0-.068-.022-.092-.022-.091-.023-.159-.068-.25-.114a.32.32 0 0 1-.137-.045h-.022a3.91 3.91 0 0 0-.729-.205h-.022a.26.26 0 0 0-.182.068s0 .023-.023.023l-.183-.024a5.628 5.628 0 0 1-2.46 3.097l.068.182s-.022 0-.022.022a.264.264 0 0 0-.022.228c.091.228.205.455.364.66v.045a.396.396 0 0 1 .091.114.81.81 0 0 1 .159.228c.023.022.046.045.046.068 0 0 .022 0 .022.022a.582.582 0 0 1 .023.342.38.38 0 0 1-.205.25c-.068.022-.114.045-.183.045a.511.511 0 0 1-.433-.273c-.022 0-.022-.022-.022-.022-.022-.023-.022-.045-.046-.068-.045-.068-.068-.159-.091-.25l-.046-.137v-.022a3.816 3.816 0 0 0-.296-.706.353.353 0 0 0-.182-.137c0-.023 0-.023-.023-.023l-.091-.159c-.228.068-.479.159-.729.205-.41.114-.82.159-1.229.159a5.368 5.368 0 0 1-1.981-.364l-.091.182c0 .023 0 .023-.023.023a.35.35 0 0 0-.182.137c-.114.228-.228.455-.296.706l-.045.137c-.023.091-.068.159-.091.25-.022.023-.045.045-.045.068-.023 0-.023.022-.023.022a.508.508 0 0 1-.433.273.434.434 0 0 1-.159-.045.469.469 0 0 1-.182-.615c.023 0 .023-.023.023-.023.022-.023.022-.045.045-.068.068-.091.114-.182.159-.228s.068-.068.091-.114v-.023a3.73 3.73 0 0 0 .364-.66.268.268 0 0 0-.023-.228s-.022 0-.022-.022l.114-.16a3.578 3.578 0 0 1-.615-.41 5.493 5.493 0 0 1-1.867-2.664l-.205.022s0-.022-.023-.022a.256.256 0 0 0-.182-.068h-.022a4.015 4.015 0 0 0-.751.205h-.024c-.045 0-.091.023-.137.046-.068.022-.159.068-.25.091-.022 0-.091-.022-.091 0 0 .023 0 .023-.023.023-.045.023-.068.023-.114.023a.424.424 0 0 1-.456-.319.445.445 0 0 1 .364-.524c.023-.023.023-.023.046-.023.045 0 .068-.022.091-.022.091 0 .182-.023.273-.023.045-.022.091-.022.137-.022a4.2 4.2 0 0 0 .774-.137c.068-.046.137-.091.16-.16 0 0 .022 0 .022-.022l.182-.046c-.205-1.298.091-2.618.797-3.734.022-.045.045-.068.068-.114l-.131-.132a.106.106 0 0 1-.004.019v-.023l.004.004c.01-.065-.031-.145-.072-.186-.182-.182-.41-.319-.638-.455l-.136-.069a2.587 2.587 0 0 1-.251-.136c-.022 0-.068-.045-.068-.045s0-.023-.022-.023a.49.49 0 0 1-.092-.639c.068-.114.182-.159.319-.159a.54.54 0 0 1 .319.114l.023.023c.022.022.045.022.068.045.068.069.114.137.182.205.023.022.068.045.091.091.159.182.364.364.569.524.045.022.091.045.137.045.045 0 .068-.023.091-.023h.023l.137.091a5.426 5.426 0 0 1 2.801-1.594c.273-.046.523-.091.774-.114l.023-.182v-.045c.068-.045.091-.114.114-.182 0-.273 0-.524-.045-.774v-.023c0-.045 0-.091-.023-.137a1.129 1.129 0 0 1-.045-.273v-.113c0-.114.045-.228.137-.319.114-.114.25-.182.387-.159a.45.45 0 0 1 .387.478v.137c-.023.091-.023.182-.045.273 0 .045-.023.091-.023.136v.023c-.048.273-.048.524-.048.774.023.068.045.136.114.182v-.023l.023.182a5.84 5.84 0 0 1 2.96 1.184c.183.182.387.364.569.546l.183-.114h.022c.022.023.068.023.091.023.046 0 .091-.023.137-.045.205-.137.41-.319.569-.501.022-.023.068-.046.091-.091.046-.068.114-.137.183-.205.022 0 .045-.022.068-.045l.022-.023a.546.546 0 0 1 .318-.114c.114 0 .251.068.319.16.159.205.113.478-.091.637 0 .023.022.023 0 .046-.023.022-.046.022-.068.045-.092.045-.16.091-.251.137l-.137.068a4.104 4.104 0 0 0-.638.455c-.045.046-.068.137-.068.205v.023l-.136.137c.364.569.638 1.207.797 1.867.137.66.182 1.343.091 2.003l.182.046a.278.278 0 0 0 .16.159c.25.068.523.114.773.137h.023a.297.297 0 0 0 .137.022c.091 0 .182 0 .272.023.046 0 .092 0 .092.023 0 .022.022.022.045.022a.537.537 0 0 1 .41.479.49.49 0 0 1-.453.32z"/>
|
||||
<path d="M12.085 14.718a.352.352 0 0 0-.455.091l-1.116 2.027c.456.136.957.228 1.435.228.341 0 .66-.045.979-.114.159-.045.296-.068.433-.091l-1.093-1.981c-.069-.069-.115-.115-.183-.16zm3.644-4.441-1.708 1.548a.36.36 0 0 0-.091.16c-.046.205.068.41.273.455l2.163.615a4.375 4.375 0 0 0-.092-1.435 4.63 4.63 0 0 0-.545-1.343zm-2.073 3.484a.371.371 0 0 0-.205.433l.889 2.141a4.366 4.366 0 0 0 1.366-1.366c.182-.25.318-.547.433-.865l-2.277-.387a.634.634 0 0 0-.206.044z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 4.7 KiB |
3
assets/mongodb.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 120 257" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
|
||||
<path d="M82.323 28.644C71.537 15.847 62.249 2.85 60.35.15c-.2-.2-.5-.2-.7 0-1.897 2.7-11.185 15.697-21.971 28.494C-54.902 146.721 52.26 226.406 52.26 226.406l.9.6C53.958 239.303 55.955 257 55.955 257h7.99s1.998-17.597 2.797-29.994l.899-.7c.1.1 107.263-79.585 14.68-197.662ZM59.95 224.606s-4.793-4.099-6.092-6.198v-.201l5.793-128.574c0-.4.6-.4.6 0l5.792 128.574v.201c-1.299 2.099-6.093 6.198-6.093 6.198Z" fill="currentColor"/>
|
||||
</svg>
|
After Width: | Height: | Size: 537 B |
3
assets/pm2.svg
Normal file
After Width: | Height: | Size: 5.7 KiB |
3
assets/pycharm.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||
<path d="M7.833 6.666v-.055c0-1-.667-1.5-1.778-1.5H4.389v3.055h1.723c1.111 0 1.721-.666 1.721-1.5zM0 0v24h24V0H0zm2.223 3.167h4c2.389 0 3.833 1.389 3.833 3.445v.055c0 2.278-1.778 3.5-4.001 3.5H4.389v2.945H2.223V3.167zM11.277 21h-9v-1.5h9V21zm4.779-7.777c-2.944.055-5.111-2.223-5.111-5.057C10.944 5.333 13.056 3 16.111 3c1.889 0 3 .611 3.944 1.556l-1.389 1.61c-.778-.722-1.556-1.111-2.556-1.111-1.658 0-2.873 1.375-2.887 3.084.014 1.709 1.174 3.083 2.887 3.083 1.111 0 1.833-.445 2.61-1.167l1.39 1.389c-.999 1.112-2.166 1.779-4.054 1.779z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 656 B |
4
assets/reactrouter.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg viewBox="0 0 256 140" fill="currentColor" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
|
||||
<path d="M78.066 92.588c12.818 0 23.209-10.391 23.209-23.21 0-12.817-10.391-23.208-23.21-23.208-12.817 0-23.208 10.39-23.208 23.209 0 12.818 10.391 23.209 23.209 23.209Zm-54.857 46.417c12.818 0 23.209-10.39 23.209-23.209 0-12.817-10.391-23.208-23.21-23.208C10.392 92.588 0 102.978 0 115.796c0 12.818 10.39 23.21 23.209 23.21Zm209.582 0c12.818 0 23.209-10.39 23.209-23.209 0-12.817-10.39-23.208-23.209-23.208-12.818 0-23.209 10.39-23.209 23.208 0 12.818 10.391 23.21 23.21 23.21Z"/>
|
||||
<path d="M156.565 70.357c-.742-7.754-1.12-14.208-7.06-18.744-7.522-5.744-16.044-2.017-26.54-5.806C112.65 43.312 105 34.155 105 23.24 105 10.405 115.578 0 128.626 0c9.665 0 17.974 5.707 21.634 13.883 5.601 10.64 1.96 21.467 8.998 26.921 8.333 6.458 19.568 1.729 32.104 7.848a23.614 23.614 0 0 1 9.84 8.425A22.858 22.858 0 0 1 205 69.718c0 10.915-7.65 20.073-17.964 22.568-10.497 3.789-19.019.062-26.541 5.806-8.46 6.46-3.931 17.267-10.826 28.682-3.913 7.518-11.867 12.663-21.043 12.663-13.048 0-23.626-10.405-23.626-23.24 0-9.323 5.582-17.364 13.638-21.066 12.536-6.12 23.77-1.39 32.104-7.848 4.807-3.726 5.823-9.473 5.823-16.926Z" fill="currentColor"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
11
assets/redis.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<svg viewBox="0 0 256 220" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
|
||||
<path d="M245.97 168.943c-13.662 7.121-84.434 36.22-99.501 44.075-15.067 7.856-23.437 7.78-35.34 2.09-11.902-5.69-87.216-36.112-100.783-42.597C3.566 169.271 0 166.535 0 163.951v-25.876s98.05-21.345 113.879-27.024c15.828-5.679 21.32-5.884 34.79-.95 13.472 4.936 94.018 19.468 107.331 24.344l-.006 25.51c.002 2.558-3.07 5.364-10.024 8.988" fill="#912626"/>
|
||||
<path d="M245.965 143.22c-13.661 7.118-84.431 36.218-99.498 44.072-15.066 7.857-23.436 7.78-35.338 2.09-11.903-5.686-87.214-36.113-100.78-42.594-13.566-6.485-13.85-10.948-.524-16.166 13.326-5.22 88.224-34.605 104.055-40.284 15.828-5.677 21.319-5.884 34.789-.948 13.471 4.934 83.819 32.935 97.13 37.81 13.316 4.881 13.827 8.9.166 16.02" fill="#C6302B"/>
|
||||
<path d="M245.97 127.074c-13.662 7.122-84.434 36.22-99.501 44.078-15.067 7.853-23.437 7.777-35.34 2.087-11.903-5.687-87.216-36.112-100.783-42.597C3.566 127.402 0 124.67 0 122.085V96.206s98.05-21.344 113.879-27.023c15.828-5.679 21.32-5.885 34.79-.95C162.142 73.168 242.688 87.697 256 92.574l-.006 25.513c.002 2.557-3.07 5.363-10.024 8.987" fill="#912626"/>
|
||||
<path d="M245.965 101.351c-13.661 7.12-84.431 36.218-99.498 44.075-15.066 7.854-23.436 7.777-35.338 2.087-11.903-5.686-87.214-36.112-100.78-42.594-13.566-6.483-13.85-10.947-.524-16.167C23.151 83.535 98.05 54.148 113.88 48.47c15.828-5.678 21.319-5.884 34.789-.949 13.471 4.934 83.819 32.933 97.13 37.81 13.316 4.88 13.827 8.9.166 16.02" fill="#C6302B"/>
|
||||
<path d="M245.97 83.653c-13.662 7.12-84.434 36.22-99.501 44.078-15.067 7.854-23.437 7.777-35.34 2.087-11.903-5.687-87.216-36.113-100.783-42.595C3.566 83.98 0 81.247 0 78.665v-25.88s98.05-21.343 113.879-27.021c15.828-5.68 21.32-5.884 34.79-.95C162.142 29.749 242.688 44.278 256 49.155l-.006 25.512c.002 2.555-3.07 5.361-10.024 8.986" fill="#912626"/>
|
||||
<path d="M245.965 57.93c-13.661 7.12-84.431 36.22-99.498 44.074-15.066 7.854-23.436 7.777-35.338 2.09C99.227 98.404 23.915 67.98 10.35 61.497-3.217 55.015-3.5 50.55 9.825 45.331 23.151 40.113 98.05 10.73 113.88 5.05c15.828-5.679 21.319-5.883 34.789-.948 13.471 4.935 83.819 32.934 97.13 37.811 13.316 4.876 13.827 8.897.166 16.017" fill="#C6302B"/>
|
||||
<path d="m159.283 32.757-22.01 2.285-4.927 11.856-7.958-13.23-25.415-2.284 18.964-6.839-5.69-10.498 17.755 6.944 16.738-5.48-4.524 10.855 17.067 6.391m-28.251 57.518L89.955 73.238l58.86-9.035-17.783 26.072m-56.95-50.928c17.375 0 31.46 5.46 31.46 12.194 0 6.736-14.085 12.195-31.46 12.195s-31.46-5.46-31.46-12.195c0-6.734 14.085-12.194 31.46-12.194" fill="#FFF"/>
|
||||
<path d="m185.295 35.998 34.836 13.766-34.806 13.753-.03-27.52" fill="#621B1C"/>
|
||||
<path d="m146.755 51.243 38.54-15.245.03 27.519-3.779 1.478-34.791-13.752" fill="#9A2928"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
3
assets/tailwindcss.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
|
||||
<path d="M7.5 2.5c-1.026 0-1.908.277-2.6.87-.688.59-1.137 1.447-1.387 2.516a.5.5 0 0 0 .897.4c.316-.452.632-.723.936-.863.294-.135.611-.162.975-.065.366.098.65.386 1.095.87l.015.016c.336.365.745.81 1.305 1.156.582.359 1.305.6 2.264.6 1.026 0 1.908-.277 2.6-.87.688-.59 1.138-1.447 1.387-2.516a.5.5 0 0 0-.897-.4c-.316.452-.632.723-.936.863-.294.135-.611.162-.975.065-.366-.098-.65-.386-1.095-.87l-.015-.016c-.336-.365-.745-.81-1.305-1.156-.582-.359-1.305-.6-2.264-.6ZM4 7c-1.026 0-1.908.277-2.6.87C.712 8.46.263 9.317.013 10.386a.5.5 0 0 0 .897.4c.316-.452.632-.723.936-.863.294-.135.611-.162.975-.065.366.098.65.386 1.095.87l.015.016c.336.365.745.81 1.305 1.156.582.359 1.305.6 2.264.6 1.026 0 1.908-.277 2.6-.87.688-.59 1.138-1.447 1.387-2.516a.5.5 0 0 0-.897-.4c-.316.452-.632.723-.936.863-.294.135-.611.162-.975.065-.366-.098-.65-.386-1.095-.87l-.015-.016c-.335-.365-.745-.81-1.305-1.156C5.682 7.24 4.959 7 4 7Z" fill="currentColor"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
381
docs/adb.md
Normal file
@ -0,0 +1,381 @@
|
||||
Android ADB 备忘清单
|
||||
===
|
||||
|
||||
[ADB](https://developer.android.com/studio/command-line/adb.html),Android Debug Bridge,包含在 Google 的 Android SDK 中,可用于从计算机控制您的 Android 设备。以下是您可以与 [ADB](https://developer.android.com/studio/command-line/adb.html) 一起使用的一些最常见的命令及其用法
|
||||
|
||||
入门
|
||||
----
|
||||
|
||||
### 设备基础
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb devices` | 列出连接的设备
|
||||
`adb devices -l` | 列出连接的设备和种类
|
||||
`adb root` | 以 `root` 权限重新启动 `adbd`
|
||||
`adb start-server` | 启动 `adb` 服务器
|
||||
`adb kill-server` | 杀死 `adb` 服务器
|
||||
`adb remount` | 重新挂载具有读/写访问权限的文件系统
|
||||
`adb reboot` | 重启设备
|
||||
`adb reboot bootloader` | 将设备重新启动到快速启动
|
||||
`adb disable-verity` | 将设备重新启动到快速启动
|
||||
<!--rehype:className=left-align code-nowrap-->
|
||||
|
||||
---
|
||||
|
||||
- `wait-for-device` 可以在 `adb` 之后指定,以确保该命令在设备连接后运行
|
||||
- `-s` 可用于在多个连接时将命令发送到特定设备
|
||||
|
||||
#### 示例
|
||||
|
||||
```bash
|
||||
$ adb wait-for-device devices
|
||||
List of devices attached
|
||||
somedevice-1234 device
|
||||
someotherdevice-1234 device
|
||||
```
|
||||
|
||||
```bash
|
||||
$ adb -s somedevice-1234 root
|
||||
```
|
||||
|
||||
### Logcat
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb logcat` | 开始将日志消息打印到标准输出
|
||||
`adb logcat -g` | 显示当前日志缓冲区大小
|
||||
`adb logcat -G <size>` | 设置缓冲区大小(K 或 M)
|
||||
`adb logcat -c` | 清除日志缓冲区
|
||||
`adb logcat *:V` | 启用所有日志消息(详细)
|
||||
`adb logcat -f <filename>` | 转储到指定文件
|
||||
<!--rehype:className=left-align code-nowrap-->
|
||||
|
||||
#### 示例
|
||||
|
||||
```bash
|
||||
$ adb logcat -G 16M
|
||||
$ adb logcat *:V > output.log
|
||||
```
|
||||
|
||||
#### 过滤日志输出
|
||||
|
||||
- `V` 详细(最低优先级)
|
||||
- `D` 调试
|
||||
- `I` 信息
|
||||
- `W` 警告
|
||||
- `E` 错误
|
||||
- `F` 严重错误
|
||||
- `S` 静默(最高优先级)
|
||||
<!--rehype:className=cols-2 shortcuts style-none-->
|
||||
|
||||
过滤器表达式显示了优先级不低于 `警告` 的所有标记的所有日志消息:
|
||||
|
||||
```bash
|
||||
$ adb logcat *:W
|
||||
```
|
||||
|
||||
### 文件管理
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb push <local> <remote>` | 将本地复制到远程设备
|
||||
`adb pull <remote> <local>` | 将远程设备从设备复制到本地
|
||||
<!--rehype:className=left-align code-nowrap-->
|
||||
|
||||
#### 示例
|
||||
|
||||
```bash
|
||||
$ echo "This is a test" > test.txt
|
||||
$ adb push test.txt /sdcard/test.txt
|
||||
$ adb pull /sdcard/test.txt pulledTest.txt
|
||||
```
|
||||
|
||||
### 远程 Shell
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb shell <command>` | 在设备上运行指定的命令(大多数 unix 命令在这里工作)
|
||||
`adb shell wm size` | 显示当前屏幕分辨率
|
||||
`adb shell wm size WxH` | 将分辨率设置为 WxH
|
||||
`adb shell pm list packages` | 列出所有已安装的包
|
||||
`adb shell pm list packages -3` | 列出所有已安装的 3rd 方包
|
||||
`adb shell monkey -p app.package.name` | 启动指定包
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### 包安装
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb shell install <apk>` | 安装应用程序
|
||||
`adb shell install <path>` | 手机路径安装应用
|
||||
`adb shell install -r <path>` | 手机路径安装应用
|
||||
`adb shell uninstall <name>` | 删除应用程序
|
||||
<!--rehype:className=left-align code-nowrap-->
|
||||
|
||||
### Paths
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`/data/data/<package>/databases` | 应用程序数据库
|
||||
`/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 卡
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
---
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb shell ls` | 列出目录内容
|
||||
`adb shell ls -s` | 每个文件的打印尺寸
|
||||
`adb shell ls -R` | 递归列出子目录
|
||||
<!--rehype:className=left-align code-nowrap-->
|
||||
|
||||
### 手机信息
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb get-statе` | 打印设备状态
|
||||
`adb get-serialno` | 获取序列号
|
||||
`adb shell dumpsys iphonesybinfo` | 获取 IMEI
|
||||
`adb shell netstat` | 列出 TCP 连接
|
||||
`adb shell pwd` | 打印当前工作目录
|
||||
`adb shell dumpsys battery` | 电池状态
|
||||
`adb shell pm list features` | 列出电话功能
|
||||
`adb shell service list` | 列出所有服务
|
||||
`adb shell dumpsys activity <package>/<activity>` | 活动信息
|
||||
`adb shell ps` | 打印进程状态
|
||||
`adb shell wm size` | 显示当前屏幕分辨率
|
||||
`dumpsys window windows` \| `grep -E 'mCurrentFocus\|mFocusedApp'` | 打印当前应用程序的打开活动
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### 包信息
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb shell list packages` | 列出包名称
|
||||
`adb shell list packages -r` | 列出包名 + apks 的路径
|
||||
`adb shell list packages -3` | 列出第三方包名称
|
||||
`adb shell list packages -s` | 仅列出系统包
|
||||
`adb shell list packages -u` | 列出包名称 + 已卸载
|
||||
`adb shell dumpsys package packages` | 列出所有应用程序的信息
|
||||
`adb shell dump <name>` | 列出一个包裹的信息
|
||||
`adb shell path <package>` | apk文件的路径
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### 设备相关命令
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb reboot-recovery` | 重启设备进入恢复模式
|
||||
`adb reboot fastboot` | 重启设备进入恢复模式
|
||||
`adb shell screencap -p "/path/to/screenshot.png"` | 截图
|
||||
`adb shell screenrecord "/path/to/record.mp4"` | 录制设备屏幕
|
||||
`adb backup -apk -all -f backup.ab` | 备份设置和应用程序
|
||||
`adb backup -apk -shared -all -f backup.ab` | 备份设置、应用程序和共享存储
|
||||
`adb backup -apk -nosystem -all -f backup.ab` | 仅备份非系统应用程序
|
||||
`adb restore backup.ab` | 恢复以前的备份
|
||||
`adb shell am start -a android.intent.action.VIEW -d URL` | 打开网址
|
||||
`adb shell am start -t image/* -a android.intent.action.VIEW` | 打开画廊
|
||||
<!--rehype:className=code-nowrap left-align-->
|
||||
|
||||
### 权限
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb shell permissions groups` | 列出权限组定义
|
||||
`adb shell list permissions -g -r` | 列出权限详细信息
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### Logs
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`adb logcat [options] [filter] [filter]` | 查看设备日志
|
||||
`adb bugreport` | 打印错误报告
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
常见的 ADB 命令
|
||||
---
|
||||
|
||||
### 将文件推送到 Android 设备的下载文件夹
|
||||
|
||||
```bash
|
||||
$ adb push example.apk /mnt/Download/
|
||||
```
|
||||
|
||||
### 列出所有已安装的包并获取完整路径
|
||||
|
||||
```bash
|
||||
$ adb shell pm list packages -f
|
||||
```
|
||||
|
||||
### 从安卓设备中提取文件
|
||||
|
||||
```bash
|
||||
$ adb pull /mnt/Download/example.apk
|
||||
```
|
||||
|
||||
### 从主机安装 apk 到 Android 设备
|
||||
|
||||
```bash
|
||||
$ adb shell install example.apk
|
||||
```
|
||||
|
||||
### 从 Android 设备存储安装 apk
|
||||
|
||||
```bash
|
||||
$ adb shell install /mnt/Download/example.apk
|
||||
```
|
||||
|
||||
### 设置网络代理
|
||||
|
||||
```bash
|
||||
$ adb shell settings put global http_proxy <address>:<port>
|
||||
```
|
||||
|
||||
### 禁用网络代理
|
||||
|
||||
```bash
|
||||
$ adb shell settings put global http_proxy :0
|
||||
```
|
||||
|
||||
### 显示连接的设备并选择一个设备和外壳
|
||||
|
||||
```bash
|
||||
$ adb devices
|
||||
$ adb -s 7f1c864e shell
|
||||
```
|
||||
|
||||
`7f1c864e` 是设备 `ID`
|
||||
|
||||
### 通过 ip 地址无线连接到设备
|
||||
|
||||
```bash
|
||||
$ adb connect 192.168.56.101:5555
|
||||
```
|
||||
|
||||
### adb 通过 wifi
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
我们可以通过 `wifi` 或专门使用 `tcp` 连接使用 `adb`。 要通过 `wifi` 使用 `adb`,首先通过 `usb` 连接手机并启用 `usb` 调试。然后列出所有设备:
|
||||
|
||||
```bash
|
||||
$ adb devices
|
||||
# 这应该给出这样的输出:
|
||||
# device_id device
|
||||
```
|
||||
|
||||
现在检查 `android` 设备的 `ip`:
|
||||
|
||||
```bash
|
||||
$ adb shell ifconfig
|
||||
# 输出:
|
||||
|
||||
wlan0 Link encap:UNSPEC Driver icnss
|
||||
inet addr:XXX.XXX.X.XX Bcast:XXX.XXX.X.XXX
|
||||
```
|
||||
|
||||
记下 `inet addr` 后面的 `ip` 地址。我们稍后会需要它。现在在某个端口重新启动 `tcpip`:
|
||||
|
||||
```bash
|
||||
$ adb tcpip $port
|
||||
```
|
||||
|
||||
例如 5555:
|
||||
|
||||
```bash
|
||||
$ adb tcpip 5555
|
||||
```
|
||||
|
||||
您现在可以断开使用。 现在连接到设备只需给出以下命令:
|
||||
|
||||
```bash
|
||||
$ adb connect $ip:$port
|
||||
```
|
||||
|
||||
like:
|
||||
|
||||
```bash
|
||||
$ adb connect 192.168.1.4:5555
|
||||
```
|
||||
|
||||
### 从计算机上的 apk 文件安装应用程序
|
||||
|
||||
```bash
|
||||
$ adb install /Users/dev/projects/myapp.apk
|
||||
```
|
||||
|
||||
### 查找应用的 apk 路径
|
||||
|
||||
```bash
|
||||
$ adb shell pm path com.example.myapp
|
||||
```
|
||||
|
||||
将 `com.example.myapp` 替换为您自己的应用程序包名称
|
||||
|
||||
### 按名称查找应用的包名
|
||||
|
||||
```bash
|
||||
$ adb shell pm list package | grep app_name
|
||||
```
|
||||
|
||||
### 将 apk 从设备提取到您的计算机
|
||||
|
||||
```bash
|
||||
$ adb pull /data/app/com.example.myapp.apk ./
|
||||
```
|
||||
|
||||
### 将文件从计算机复制到设备
|
||||
|
||||
```bash
|
||||
$ adb push path/to/local/file /sdcard/foo.txt
|
||||
```
|
||||
|
||||
### 滚动屏幕
|
||||
|
||||
```bash
|
||||
$ adb shell input swipe 300 300 500 1000 # 上
|
||||
$ adb shell input swipe 500 1000 300 300 # 下
|
||||
```
|
||||
|
||||
### 发文本
|
||||
|
||||
使用虚拟键盘发送文本:
|
||||
|
||||
```bash
|
||||
$ adb shell input text "Hello World"
|
||||
```
|
||||
|
||||
### 发送按键事件
|
||||
|
||||
```bash
|
||||
$ adb shell input keyevent 66
|
||||
# 66 是回车键码
|
||||
```
|
||||
|
||||
### 发送点击
|
||||
|
||||
点击又名点击屏幕:
|
||||
|
||||
```bash
|
||||
$ adb shell input tap x y
|
||||
```
|
||||
|
||||
### 查看包的日志
|
||||
|
||||
```bash
|
||||
$ adb shell 'logcat --pid=$(pidof -s <package_name>)'
|
||||
```
|
||||
|
||||
查看特定包的日志
|
354
docs/adobe-lightroom.md
Normal file
@ -0,0 +1,354 @@
|
||||
Adobe Lightroom 键盘快捷键
|
||||
===
|
||||
|
||||
Adobe Lightroom CC 中 251 个键盘快捷键的可视化备忘单
|
||||
|
||||
键盘快捷键
|
||||
--------
|
||||
|
||||
### 使用面板
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Tab` | 显示/隐藏侧面板
|
||||
`Shift` `Tab` | 显示/隐藏所有面板
|
||||
`T` | 显示/隐藏工具栏
|
||||
`F5` | 显示/隐藏模块选择器
|
||||
`F6` | 显示/隐藏胶片
|
||||
`F7` | 显示/隐藏左侧面板
|
||||
`F8` | 显示/隐藏右侧面板
|
||||
`Alt` `(click a panel)` | 切换独奏模式
|
||||
`Shift` `(click a panel)` | 在不关闭单独面板的情况下打开一个新面板
|
||||
`Ctrl` `(click a panel)` | 打开/关闭所有面板
|
||||
`Ctrl` `Shift` `0-5` | 打开/关闭左侧面板,从上到下
|
||||
`Ctrl` `0-9` | 打开/关闭右侧面板、库和开发模块,从上到下
|
||||
`Ctrl` `1-7` | 从上到下打开/关闭右面板、幻灯片、打印和 Web 模块
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 导航模块
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Alt` `1` | 转到库模块
|
||||
`Ctrl` `Alt` `2` | 转到开发模块
|
||||
`Ctrl` `Alt` `3` | 转到幻灯片模块
|
||||
`Ctrl` `Alt` `4` | 转到打印模块
|
||||
`Ctrl` `Alt` `5` | 转到网络模块
|
||||
`Ctrl` `Alt` `Left/Right` | 返回/前进
|
||||
`Ctrl` `Alt` `Up` | 返回上一个模块
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用辅助窗口
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`F11` | 打开辅助窗口
|
||||
`Shift` `G` | 进入网格视图
|
||||
`Shift` `E` | 进入正常的放大镜视图
|
||||
`Ctrl` `Shift` `Enter` | 进入锁定的放大镜视图
|
||||
`Shift` `C` | 进入比较视图
|
||||
`Shift` `N` | 进入调查视图
|
||||
`Ctrl` `Alt` `Shift` `Enter` | 进入幻灯片视图
|
||||
`Shift` `F11` | 进入全屏模式(需要第二台显示器)
|
||||
`Shift` `\` | 显示/隐藏过滤栏
|
||||
`Ctrl` `Shift` `+/-` | 放大/缩小
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 在开发模块中工作
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`V` | 转换为灰度
|
||||
`Ctrl` `U` | 自动音调
|
||||
`Ctrl` `Shift` `U` | 自动白平衡
|
||||
`Ctrl` `E` | 在 Photoshop 中编辑
|
||||
`Ctrl` `Shift` `C/V` | 复制/粘贴开发设置
|
||||
`Ctrl` `Alt` `V` | 粘贴上一张照片的设置
|
||||
`Ctrl` `Alt` `Shift` `Left` | 将之后的设置复制到之前
|
||||
`Ctrl` `Alt` `Shift` `Right` | 将之前的设置复制到之后
|
||||
`Ctrl` `Alt` `Shift` `Up` | 交换前后设置
|
||||
`Up/Down` | 以小增量增加/减少选定的滑块
|
||||
`Shift` `Up/Down` | 以较大的增量增加/减少选定的滑块
|
||||
`./,` | 循环浏览基本面板设置(向前/向后)
|
||||
`(double-click slider name)` | 重置滑块
|
||||
`Alt` `(click group name)` | 重置一组滑块
|
||||
`Ctrl` `Shift` `R` | 重置所有设置
|
||||
`Ctrl` `Shift` `S` | 同步设置
|
||||
`Ctrl` `Alt` `S` | 绕过同步设置对话框同步设置
|
||||
`Ctrl` `(click Sync button)` | 切换自动同步
|
||||
`Ctrl` `Alt` `Shift` `A` | 启用自动同步
|
||||
`Ctrl` `Alt` `Shift` `M` | 匹配总曝光量
|
||||
`W` | 选择白平衡工具(来自任何模块)
|
||||
`R` | 选择裁剪工具(来自任何模块)
|
||||
`A` | 选择裁剪工具时限制纵横比
|
||||
`Shift` `A` | 裁剪为与上一次裁剪相同的纵横比
|
||||
`Alt` `(drag)` | 从照片中心裁剪
|
||||
`O` | 循环作物网格覆盖
|
||||
`Shift` `O` | 循环裁剪网格叠加方向
|
||||
`X` | 在纵向和横向之间切换裁剪
|
||||
`Ctrl` `Alt` `R` | 重置作物
|
||||
`Shift` `T` | 选择 Guided Upright 工具
|
||||
`Q` | 选择 Sopt 删除工具
|
||||
`Shift` `T` | 选择污点去除工具时在克隆和修复模式之间切换笔刷
|
||||
`K` | 选择调整画笔工具(来自任何模块)
|
||||
`M` | 选择渐变滤镜工具
|
||||
`Shift` `T` | 选择渐变/径向滤镜时在编辑和画笔模式之间切换蒙版
|
||||
`]/[` | 增大/减小画笔大小
|
||||
`Shift` `]/[` | 增加/减少笔刷羽化
|
||||
`/` | 在局部调整刷A和B之间切换
|
||||
`Alt` `(drag)` | 暂时从画笔 A 或 B 切换到橡皮擦
|
||||
`Shift` `(drag)` | 绘制水平线或垂直线
|
||||
`H` | 显示/隐藏局部调整引脚
|
||||
`O` | 显示/隐藏局部调整蒙版覆盖
|
||||
`Shift` `O` | 循环局部调整蒙版叠加颜色
|
||||
`Ctrl` `Alt` `Shift` `T` | 选择目标调整工具以应用色调曲线调整
|
||||
`Ctrl` `Alt` `Shift` `H` | 选择目标调整工具以应用色相调整
|
||||
`Ctrl` `Alt` `Shift` `S` | 选择目标调整工具以应用饱和度调整
|
||||
`Ctrl` `Alt` `Shift` `L` | 选择目标调整工具以应用亮度调整
|
||||
`Ctrl` `Alt` `Shift` `G` | 选择目标调整工具以应用灰度混合调整
|
||||
`Ctrl` `Alt` `Shift` `N` | 取消选择目标调整工具
|
||||
`J` | 显示剪辑
|
||||
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||
`Space/Z` | 在放大镜和 1:1 缩放预览之间切换
|
||||
`Ctrl` `+/-` | 放大/缩小
|
||||
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||
`Y` | 查看左/右之前和之后
|
||||
`Alt` `Y` | 查看顶部/底部之前和之后
|
||||
`Shift` `Y` | 在分屏中查看之前和之后
|
||||
`\` | 仅查看之前
|
||||
`Ctrl` `N` | 创建新快照
|
||||
`Ctrl` `Shift` `N` | 创建新预设
|
||||
`Ctrl` `Alt` `N` | 创建一个新的预设文件夹
|
||||
`Ctrl` `J` | 打开开发视图选项
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 更改视图和屏幕模式
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`E` | 进入图书馆放大镜视图
|
||||
`G` | 进入库网格视图
|
||||
`C` | 进入图书馆比较视图
|
||||
`N` | 进入图书馆调查视图
|
||||
`D` | 在修改照片模块中打开选定的照片
|
||||
`L` | 通过 Lights Out 模式向前循环
|
||||
`Shift` `L` | 通过 Lights Out 模式向后循环
|
||||
`Ctrl` `Shift` `L` | 切换灯光昏暗模式
|
||||
`F` | 循环屏幕模式
|
||||
`Ctrl` `Shift` `F` | 在普通和全屏之间切换,隐藏面板
|
||||
`Ctrl` `Alt` `F` | 进入普通屏幕模式
|
||||
`I` | 循环信息叠加
|
||||
`Ctrl` `I` | 显示/隐藏信息覆盖
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 管理照片和目录
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `I` | 从磁盘导入照片
|
||||
`Ctrl` `O` | 打开目录
|
||||
`Ctrl` `,` | 打开首选项
|
||||
`Ctrl` `Alt` `,` | 打开目录设置
|
||||
`Ctrl` `Shift` `T` | 创建新的子文件夹(分段联机捕获)
|
||||
`Ctrl` `T` | 隐藏/显示系绳捕获栏
|
||||
`Ctrl` `Shift` `N` | 在库模块中创建一个新文件夹
|
||||
`Ctrl` `'` | 创建虚拟副本(仅限库和开发模块)
|
||||
`Ctrl` `R` | 在资源管理器/Finder 中显示(仅限库和开发模块)
|
||||
`Right/Left` | 转到胶片中的下一张/上一张照片
|
||||
`Shift/Ctrl` `Click` | 选择多个文件夹或集合(在库、幻灯片、打印和 Web 模块中)
|
||||
`F2` | 重命名照片(在图库模块中)
|
||||
`Delete` | 删除所选照片
|
||||
`Alt` `Backspace` | 从目录中删除所选照片
|
||||
`Ctrl` `Alt` `Shift` `Backspace` | 删除所选照片并移至废纸篓
|
||||
`Ctrl` `Backspace` | 删除被拒绝的照片
|
||||
`Ctrl` `E` | 在 Photoshop 中编辑
|
||||
`Ctrl` `Alt` `E` | 在其他编辑器中打开
|
||||
`Ctrl` `Shift` `E` | 导出所选照片
|
||||
`Ctrl` `Alt` `Shift` `E` | 使用以前的设置导出
|
||||
`Ctrl` `Alt` `Shift` `,` | 打开插件管理器
|
||||
`Ctrl` `P` | 打印所选照片
|
||||
`Ctrl` `Shift` `P` | 打开页面设置对话框
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 比较图库模块中的照片
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`E/Enter` | 切换到放大视图
|
||||
`G/Esc` | 切换到网格视图
|
||||
`C` | 切换到比较视图
|
||||
`N` | 切换到调查视图
|
||||
`Space/E` | 从网格切换到放大视图
|
||||
`Down` | 在比较视图中交换选择和候选照片
|
||||
`Up` | 在比较视图中选择下一张照片和候选照片
|
||||
`Z` | 切换缩放视图
|
||||
`Ctrl` `+/-` | 在放大镜视图中放大/缩小
|
||||
`PgUp/PgDown` | 在放大视图中向上/向下滚动放大的照片
|
||||
`Home/End` | 转到网格视图的开头/结尾
|
||||
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||
`=/-` | 增加/减少网格缩略图大小
|
||||
`PgUp/PgDown` | 向上/向下滚动网格缩略图
|
||||
`Ctrl` `Shift` `H` | 切换单元格附加功能
|
||||
`Ctrl` `Alt` `Shift` `H` | 显示/隐藏徽章
|
||||
`J` | 循环网格视图
|
||||
`Ctrl` `J` | 打开库视图选项
|
||||
`Ctrl` `(click)` | 选择多张离散照片
|
||||
`Shift` `(click)` | 选择多张连续照片
|
||||
`Ctrl` `A` | 选择所有照片
|
||||
`Ctrl` `D` | 取消选择所有照片
|
||||
`Ctrl` `Shift` `D` | 仅选择活动照片
|
||||
`/` | 取消选择现用照片
|
||||
`Shift` `Left/Right` | 将上一张/下一张照片添加到选择
|
||||
`Ctrl` `Alt` `A` | 选择标记的照片
|
||||
`Ctrl` `Alt` `Shift` `D` | 取消选择未标记的照片
|
||||
`Ctrl` `G` | 分组入栈
|
||||
`Ctrl` `Shift` `G` | 拆叠
|
||||
`S` | 切换堆栈
|
||||
`Shift` `S` | 移动到堆栈顶部
|
||||
`Shift` `[` | 在堆栈中向上移动
|
||||
`Shift` `]` | 在堆栈中向下移动
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 评级和过滤照片
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`1-5` | 设置星级
|
||||
`Shift` `1-5` | 设置星级并转到下一张照片
|
||||
`0` | 删除星级
|
||||
`Shift` `0` | 删除星级并转到下一张照片
|
||||
`]/[` | 将评分提高/降低一颗星
|
||||
`6` | 分配一个红色标签
|
||||
`7` | 分配黄色标签
|
||||
`8` | 分配一个绿色标签
|
||||
`9` | 分配一个蓝色标签
|
||||
`Shift` `6-9` | 分配颜色标签并转到下一张照片
|
||||
`P` | 将照片标记为精选
|
||||
`Shift` `P` | 将照片标记为精选并转到下一张照片
|
||||
`X` | 将照片标记为拒绝
|
||||
`Shift` `X` | 将照片标记为拒绝并转到下一张照片
|
||||
`U` | 取消标记照片
|
||||
`Shift` `U` | 取消标记照片并转到下一张照片
|
||||
`Ctrl` `Up/Down` | 增加/减少标志状态
|
||||
<code>\`</code> | 循环标志设置
|
||||
`Ctrl` `Alt` `R` | 优化照片
|
||||
`\` | 显示/隐藏库过滤器栏
|
||||
`Shift` `(click filter labels)` | 在过滤器栏中打开多个过滤器
|
||||
`Shift` `L` | 打开/关闭过滤器
|
||||
`Ctrl` `F` | 在图库模块中查找照片
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用集合
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `N` | 在 Library 模块中创建一个新的集合
|
||||
`B` | 添加到快速收藏
|
||||
`Shift` `B` | 添加到快速收藏并转到下一张照片
|
||||
`Ctrl` `B` | 显示快速收藏
|
||||
`Ctrl` `Alt` `B` | 保存快速收藏
|
||||
`Ctrl` `Shift` `B` | 清除快速收藏
|
||||
`Ctrl` `Alt` `Shift` `B` | 设为目标集合
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 在库模块中使用元数据和关键字
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `K` | 添加关键字
|
||||
`Ctrl` `Shift` `K` | 修改关键字
|
||||
`Ctrl` `Alt` `Shift` `K` | 设置关键字快捷方式
|
||||
`Shift` `K` | 从所选照片中添加/删除关键字快捷方式
|
||||
`Ctrl` `Alt` `K` | 启用绘画
|
||||
`Alt` `1-9` | 将关键字集中的关键字添加到所选照片
|
||||
`Alt` `0` | 通过关键字集向前循环
|
||||
`Alt` `Shift` `0` | 通过关键字集循环反向词
|
||||
`Ctrl` `Alt` `Shift` `C/V` | 复制/粘贴元数据
|
||||
`Ctrl` `S` | 将元数据保存到文件
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 在幻灯片模块中工作
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Enter` | 播放幻灯片
|
||||
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||
`Space` | 暂停幻灯片放映
|
||||
`Alt` `Enter` | 预览幻灯片
|
||||
`Esc` | 结束幻灯片放映
|
||||
`Right` | 转到下一张幻灯片
|
||||
`Left` | 转到上一张幻灯片
|
||||
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||
`Ctrl` `Shift` `H` | 显示/隐藏指南
|
||||
`Ctrl` `J` | 导出 PDF 幻灯片放映
|
||||
`Ctrl` `Shift` `J` | 导出 JPEG 幻灯片放映
|
||||
`Ctrl` `Alt` `J` | 导出视频幻灯片
|
||||
`Ctrl` `N` | 创建新的幻灯片放映模板
|
||||
`Ctrl` `Shift` `N` | 创建新的幻灯片放映模板文件夹
|
||||
`Ctrl` `S` | 保存幻灯片放映设置
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 在打印模块中工作
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `P` | 打印
|
||||
`Ctrl` `Alt` `P` | 打印一份
|
||||
`Ctrl` `Shift` `P` | 打开页面设置对话框
|
||||
`Ctrl` `Alt` `Shift` `P` | 打开打印设置对话框
|
||||
`Ctrl` `Shift` `Left` | 转到第一页
|
||||
`Ctrl` `Shift` `Right` | 转到最后一页
|
||||
`Ctrl` `Left` | 转到上一页
|
||||
`Ctrl` `Right` | 转到下一页
|
||||
`Ctrl` `Shift` `H` | 显示/隐藏指南
|
||||
`Ctrl` `R` | 显示/隐藏标尺
|
||||
`Ctrl` `Shift` `J` | 显示/隐藏页面出血
|
||||
`Ctrl` `Shift` `M` | 显示/隐藏边距和装订线
|
||||
`Ctrl` `Shift` `K` | 显示/隐藏图像单元格
|
||||
`Ctrl` `Shift` `U` | 显示/隐藏尺寸
|
||||
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||
`Ctrl` `N` | 创建一个新的打印模板
|
||||
`Ctrl` `Shift` `N` | 创建一个新的打印模板文件夹
|
||||
`Ctrl` `S` | 保存打印设置
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 在 Web 模块中工作
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `R` | 重新加载网络画廊
|
||||
`Ctrl` `Alt` `P` | 在浏览器中预览
|
||||
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||
`Ctrl` `J` | 导出网络画廊
|
||||
`Ctrl` `N` | 创建新的 Web 画廊模板
|
||||
`Ctrl` `Shift` `N` | 创建新的 Web 画廊模板文件夹
|
||||
`Ctrl` `S` | 保存 Web 画廊设置
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用帮助
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `/` | 显示当前模块快捷方式
|
||||
`(click)` | 隐藏当前模块快捷方式
|
||||
`Ctrl` `Alt` `/` | 转到当前模块帮助
|
||||
`F1` | 打开社区帮助
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
--------
|
||||
|
||||
- [Keyboard shortcuts for Adobe Lightroom CC](https://helpx.adobe.com/lightroom/help/keyboard-shortcuts.html) _(helpx.adobe.com)_
|
433
docs/adobe-photoshop.md
Normal file
@ -0,0 +1,433 @@
|
||||
Adobe Photoshop 键盘快捷键 备忘清单
|
||||
===
|
||||
|
||||
Adobe Photoshop 中 283 个[键盘快捷键](https://helpx.adobe.com/photoshop/using/default-keyboard-shortcuts.html)的可视化备忘单
|
||||
|
||||
键盘快捷键
|
||||
---------
|
||||
|
||||
### 热门快捷方式
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `T` | 自由变换
|
||||
`[` | 减小画笔大小
|
||||
`]` | 增加画笔大小
|
||||
`Shift` `[` | 降低画笔硬度
|
||||
`Shift` `]` | 增加笔刷硬度
|
||||
`D` | 默认前景/背景颜色
|
||||
`X` | 切换前景/背景颜色
|
||||
`Ctrl` `J` | 通过复制新建图层
|
||||
`Ctrl` `Shift` `J` | 通过剪切新建图层
|
||||
`Esc` | 取消任何模态对话框窗口(包括启动工作区)
|
||||
`Enter` | 选择工具栏的第一个编辑字段
|
||||
`Tab` | 在字段之间导航
|
||||
`Shift` `Tab` | 在相反方向的字段之间导航
|
||||
`Alt` | 更改取消重置
|
||||
`Ctrl` `F` | 调用搜索体验
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用功能键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`F1` | 开始帮助
|
||||
`F2` | 剪切
|
||||
`F3` | 复制
|
||||
`F4` | 粘贴
|
||||
`F5` | 显示/隐藏笔刷面板
|
||||
`F6` | 显示/隐藏颜色面板
|
||||
`F7` | 显示/隐藏图层面板
|
||||
`F8` | 显示/隐藏信息面板
|
||||
`F9` | 显示/隐藏操作面板
|
||||
`F12` | 恢复
|
||||
`Shift` `F5` | 充满
|
||||
`Shift` `F6` | 羽毛选择
|
||||
`Shift` `F7` | 反向选择
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 选择工具
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`V` | 移动工具
|
||||
`M` | 矩形选框工具
|
||||
`L` | 套索工具
|
||||
`W` | 魔棒工具 > 快速选择工具
|
||||
`C` | 裁剪工具 > 切片工具 > 切片选择工具
|
||||
`I` | 吸管工具 > 标尺工具 > 注释工具
|
||||
`J` | 斑点修复笔刷工具 > 修复笔刷工具 > 补丁工具 > 红眼工具
|
||||
`B` | 画笔工具 > 铅笔工具 > 颜色替换工具 > 混合器画笔工具
|
||||
`S` | 克隆图章工具 > 图案图章工具
|
||||
`Y` | 历史画笔工具 > 艺术史画笔工具
|
||||
`E` | 橡皮擦工具 > 背景橡皮擦工具 > 魔术橡皮擦工具
|
||||
`G` | 渐变工具>油漆桶工具
|
||||
`O` | 减淡工具 > 加深工具 > 海绵工具
|
||||
`P` | 钢笔工具 > 自由钢笔工具
|
||||
`T` | 横版工具 > 竖版工具 > 横版蒙版工具 > 竖版蒙版工具
|
||||
`A` | 路径选择工具 > 直接选择工具
|
||||
`U` | 矩形工具 > 圆角矩形工具 > 椭圆工具 > 多边形工具 > 直线工具
|
||||
`H` | 手工具
|
||||
`R` | 旋转视图工具
|
||||
`Z` | 缩放工具
|
||||
`D` | 默认前景/背景颜色
|
||||
`X` | 切换前景/背景颜色
|
||||
`Q` | 切换标准/快速蒙版模式
|
||||
`J` | 内容感知移动工具
|
||||
`C` | 透视裁剪工具
|
||||
`V` | 画板工具
|
||||
`R` | 旋转视图工具
|
||||
`/` | 切换保持透明度
|
||||
`,` | 上一刷
|
||||
`.` | 下一刷
|
||||
`Shift` `,` | 先刷
|
||||
`Shift` `.` | 最后刷
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 查看图片
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Tab` | 循环浏览打开的文档
|
||||
`Ctrl` `Shift` `Tab` | 切换到上一个文档
|
||||
`Ctrl` `Shift` `W` | 在 Photoshop 中关闭文件并打开 Bridge
|
||||
`F` | 在标准屏幕 > 带菜单栏的全屏 > 全屏模式之间向前切换
|
||||
`Shift` `F` | 在标准屏幕 > 带菜单栏的全屏 > 全屏模式之间向后切换
|
||||
`Space` `F` | 向前切换画布颜色
|
||||
`Shift` `Space` `F` | 向后切换画布颜色
|
||||
`Space` | 切换到手动工具(当不在文本编辑模式时)
|
||||
`Ctrl` `Space` | 切换到放大工具
|
||||
`Alt` `Space` | 切换到缩小工具
|
||||
`Shift` `Enter` | 应用缩放百分比,并保持缩放百分比框处于活动状态
|
||||
`PgUp/PgDn` | 向上或向下滚动 1 屏
|
||||
`Shift` `PgUp/PgDn` | 向上或向下滚动 10 个单位
|
||||
`Home` | 将视图移动到左上角
|
||||
`End` | 将视图移动到右下角
|
||||
`\` | 将图层蒙版打开/关闭为红宝石(必须选择图层蒙版)
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用木偶变形
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Esc` | 完全取消
|
||||
`Ctrl` `Z` | 撤消最后一次引脚调整
|
||||
`Ctrl` `A` | 选择所有引脚
|
||||
`Ctrl` `D` | 取消选择所有引脚
|
||||
`H` | 暂时隐藏图钉
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用优化边缘
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Alt` `R` | 打开优化边缘对话框
|
||||
`F` | 通过预览模式向前循环
|
||||
`Shift` `F` | 通过预览模式向后循环
|
||||
`X` | 在原始图像和选区预览之间切换
|
||||
`P` | 在原始选择和优化版本之间切换
|
||||
`J` | 打开和关闭半径预览
|
||||
`Shift` `E` | 在 Refine Radius 和 Erase Refinement 工具之间切换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用滤镜库
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Alt` `F` | 重新应用上次使用的过滤器
|
||||
`Ctrl` | 将取消按钮更改为默认值
|
||||
`Alt` | 将取消按钮更改为重置
|
||||
`Ctrl` `Z` | 撤销重做
|
||||
`Ctrl` `Shift` `Z` | 向前一步
|
||||
`Ctrl` `Alt` `Z` | 向后退一步
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用液化滤镜
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`W` | 向前扭曲工具
|
||||
`R` | 重构工具
|
||||
`C` | 顺时针旋转工具
|
||||
`S` | 皱褶工具
|
||||
`B` | 膨胀工具
|
||||
`O` | 向左推工具
|
||||
`M` | 镜像工具
|
||||
`T` | 湍流工具
|
||||
`F` | 冻结蒙版工具
|
||||
`D` | 解冻蒙版工具
|
||||
`Alt` `(tool)` | 反转膨胀、褶皱、向左推和镜像工具的方向
|
||||
`Tab` | 从右上角循环浏览控件
|
||||
`Shift` `Tab` | 从右下角循环浏览控件
|
||||
`Alt` | 更改取消重置
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用消失点
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`X` | 缩放 2 倍(临时)
|
||||
`Ctrl` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 适合视图
|
||||
`Ctrl` `Z` | 撤消上次操作
|
||||
`Ctrl` `Shift` `Z` | 重做上一个动作
|
||||
`Ctrl` `D` | 取消全选
|
||||
`Ctrl` `H` | 隐藏选择和窗格
|
||||
`Arrows` | 将选区移动 1 个像素
|
||||
`Shift` `Arrows` | 将选区移动 10 个像素
|
||||
`Ctrl` `C` | 复制
|
||||
`Ctrl` `V` | 粘贴
|
||||
`Ctrl` `Shift` `T` | 重复最后一个副本并移动
|
||||
`Ctrl` `Alt` `T` | 从当前选区创建浮动选区
|
||||
`Alt` `Shift` | 将选择限制为 15 度旋转
|
||||
`Backspace` | 创建平面时删除最后一个节点
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用 Camera Raw 对话框
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Z` | 缩放工具
|
||||
`H` | 手工具
|
||||
`I` | 白平衡工具
|
||||
`S` | 颜色取样器工具
|
||||
`C` | 裁剪工具
|
||||
`A` | 拉直工具
|
||||
`B` | 污点去除工具
|
||||
`E` | 红眼消除工具
|
||||
`Ctrl` `Alt` `1` | 基本面板
|
||||
`Ctrl` `Alt` `2` | 色调曲线面板
|
||||
`Ctrl` `Alt` `3` | 详情面板
|
||||
`Ctrl` `Alt` `4` | HSL/灰度面板
|
||||
`Ctrl` `Alt` `5` | 分离调色板
|
||||
`Ctrl` `Alt` `6` | 镜头校正面板
|
||||
`Ctrl` `Alt` `7` | 相机校准面板
|
||||
`Ctrl` `Alt` `8` | 预设面板
|
||||
`Ctrl` `Alt` `9` | 打开快照面板
|
||||
`Ctrl` `Alt` `Shift` `T` | 参数化曲线针对性调整工具
|
||||
`Ctrl` `Alt` `Shift` `H` | 色相针对性调整工具
|
||||
`Ctrl` `Alt` `Shift` `S` | 饱和度针对性调整工具
|
||||
`Ctrl` `Alt` `Shift` `L` | 亮度针对性调整工具
|
||||
`Ctrl` `Alt` `Shift` `G` | 灰度混合针对性调整工具
|
||||
`T` | 最后使用的针对性调整工具
|
||||
`K` | 调整笔刷工具
|
||||
`G` | 分级过滤工具
|
||||
`Alt` | 暂时从调整画笔工具的添加模式切换到擦除模式,或从擦除模式切换到添加模式
|
||||
`Alt` `]/[` | 增加/减少临时调整画笔工具大小
|
||||
`Alt` `Shift` `]/[` | 增加/减少临时调整笔刷工具羽化
|
||||
`Alt` `=/-` | 以 10 为增量增加/减少临时调整画笔工具大小流
|
||||
`N` | 从调整画笔工具或渐变滤镜的添加或擦除模式切换到新建模式
|
||||
`M` | 为调整画笔工具切换自动蒙版
|
||||
`Y` | 切换调整画笔工具的显示蒙版
|
||||
`V` | 调整画笔工具的切换销
|
||||
`L` | 向左旋转图像
|
||||
`R` | 向右旋转图像
|
||||
`Ctrl` | 暂时切换到放大工具
|
||||
`Alt` | 暂时切换为缩小工具,图片打开按钮改为打开复制
|
||||
`P` | 切换预览
|
||||
`F` | 全屏模式
|
||||
`Shift` | 暂时激活白平衡工具并将打开图像按钮更改为打开对象
|
||||
`Arrows` | 将曲线面板中的选定点移动 1 个像素
|
||||
`Shift` `Arrows` | 将曲线面板中的选定点移动 10 像素
|
||||
`Ctrl` `R` | 从 Bridge 打开 Camera Raw 对话框中的选定图像
|
||||
`O` | 高亮剪裁警告
|
||||
`U` | 阴影剪切警告
|
||||
`Ctrl` `1-5` | 添加 1-5 星级(幻灯片模式)
|
||||
`Ctrl` `./,` | 增加/减少评分(幻灯片模式)
|
||||
`Ctrl` `6` | 添加红色标签(幻灯片模式)
|
||||
`Ctrl` `7` | 添加黄色标签(幻灯片模式)
|
||||
`Ctrl` `8` | 添加绿色标签(幻灯片模式)
|
||||
`Ctrl` `9` | 添加蓝色标签(幻灯片模式)
|
||||
`Ctrl` `Shift` `0` | 添加紫色标签(幻灯片模式)
|
||||
`Ctrl` `K` | Camera Raw 首选项
|
||||
`Ctrl` `Alt` | 删除 Adobe Camera Raw 首选项(打开时)
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用黑白对话框
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `Alt` `B` | 打开黑白对话框
|
||||
`Up/Down` | 将所选值增加/减少 1%
|
||||
`Shift` `Up/Down` | 将所选值增加/减少 10%
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 编辑路径
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` | 从路径选择、笔、添加锚点、删除锚点或将点工具转换为直接选择工具
|
||||
`Alt` | 当指针位于锚点或方向点上时,从钢笔工具切换到自由钢笔工具以转换点工具
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 变换选区、选区边框和路径
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Alt` | 从中心变换或反射
|
||||
`Shift` | 约束
|
||||
`Ctrl` | 歪曲
|
||||
`Enter` | 申请
|
||||
`Ctrl` `.` | 取消
|
||||
`Ctrl` `Alt` `T` | 具有重复数据的自由变换
|
||||
`Ctrl` `Shift` `Alt` `T` | 用重复数据再次转换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用曲线
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `M` | 打开曲线对话框
|
||||
`+` | 选择曲线上的下一个点
|
||||
`-` | 选择曲线上的前一点
|
||||
`Ctrl` `D` | 取消选择一个点
|
||||
`Del` | 删除曲线上的一个点
|
||||
`Arrows` | 将所选点移动 1 个像素
|
||||
`Shift` `Arrows` | 将所选点移动 10 个像素
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 用于绘画
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Alt` `Shift` `0-9` | 混合器画笔更改混合设置
|
||||
`0-9` | 混合刷改变湿设置
|
||||
`00` | 搅拌刷变湿并混合至零
|
||||
`Shift` `+/-` | 循环混合模式
|
||||
`Backspace` | 在背景或标准图层上打开填充对话框
|
||||
`Alt` `Backspace` | 填充前景色
|
||||
`Ctrl` `Backspace` | 填充背景色
|
||||
`Ctrl` `Alt` `Backspace` | 从历史中填充
|
||||
`Shift` `Backspace` | 显示填充对话框
|
||||
`/` | 打开/关闭锁定透明像素
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 用于混合模式
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `-/+` | 循环混合模式
|
||||
`Shift` `Alt` `N` | 普通的
|
||||
`Shift` `Alt` `I` | 溶解
|
||||
`Shift` `Alt` `Q` | 背后(仅限画笔工具)
|
||||
`Shift` `Alt` `R` | 清除(仅限画笔工具)
|
||||
`Shift` `Alt` `K` | 变暗
|
||||
`Shift` `Alt` `M` | 乘
|
||||
`Shift` `Alt` `B` | 烧色
|
||||
`Shift` `Alt` `A` | 线性燃烧
|
||||
`Shift` `Alt` `G` | 减轻
|
||||
`Shift` `Alt` `S` | 屏幕
|
||||
`Shift` `Alt` `D` | 颜色减淡
|
||||
`Shift` `Alt` `W` | 直线闪避
|
||||
`Shift` `Alt` `O` | 覆盖
|
||||
`Shift` `Alt` `F` | 柔光
|
||||
`Shift` `Alt` `H` | 强光
|
||||
`Shift` `Alt` `V` | 鲜艳的光
|
||||
`Shift` `Alt` `J` | 线性光
|
||||
`Shift` `Alt` `Z` | 针灯
|
||||
`Shift` `Alt` `L` | 硬混
|
||||
`Shift` `Alt` `E` | 区别
|
||||
`Shift` `Alt` `X` | 排除
|
||||
`Shift` `Alt` `U` | 色调
|
||||
`Shift` `Alt` `T` | 饱和
|
||||
`Shift` `Alt` `C` | 颜色
|
||||
`Shift` `Alt` `Y` | 亮度
|
||||
`Shift` `Alt` `N` | 将位图图像的混合模式设置为阈值<br/>所有其他图像的混合模式设置为正常
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 格式类型
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `L/C/R` | 左对齐、居中或右对齐
|
||||
`Ctrl` `Shift` `X` | 选择 100% 水平比例
|
||||
`Ctrl` `Shift` `Alt` `X` | 选择 100% 垂直比例
|
||||
`Ctrl` `Shift` `Alt` `A` | 选择自动行进
|
||||
`Ctrl` `Shift` `Q` | 选择 0 进行跟踪
|
||||
`Ctrl` `Shift` `J` | 对齐段落,左对齐最后一行
|
||||
`Ctrl` `Shift` `F` | 证明段落,证明所有
|
||||
`Ctrl` `Shift` `Alt` `H` | 打开/关闭段落断字
|
||||
`Ctrl` `Shift` `Alt` `T` | 打开/关闭单个/每行作曲家
|
||||
`Ctrl` `Shift` `</>` | 将所选文本的字号减小或增大 2 磅或像素
|
||||
`Alt` `Up/Down` | 减少或增加前导 2 点或像素
|
||||
`Shift` `Alt` `Up/Down` | 减少或增加基线偏移 2 个点或像素
|
||||
`Alt` `Left/Right` | 减少或增加字距调整/字距调整 20/1000 em
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用面板
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Shift` `Enter` | 应用值并保持文本框处于活动状态
|
||||
`Tab` | 显示/隐藏所有面板
|
||||
`Shift` `Tab` | 显示/隐藏除工具箱和选项栏之外的所有面板
|
||||
`Enter` | 高亮选项栏(先选择工具)
|
||||
`Shift` `Up/Down` | 将所选值增加/减少 10
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用调整图层
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Alt` `3` | 选择红色通道进行调整
|
||||
`Alt` `4` | 选择绿色通道进行调整
|
||||
`Alt` `5` | 选择蓝色通道进行调整
|
||||
`Alt` `2` | 选择复合通道进行调整
|
||||
`Backspace` | 删除调整图层
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用画笔面板
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`,/.` | 选择上一个/下一个画笔大小
|
||||
`Shift` `,/.` | 选择第一个/最后一个画笔
|
||||
`Caps Lock` | 显示画笔的精确十字线
|
||||
`Shift` `Alt` `P` | 切换喷枪选项
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用克隆源面板
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Alt` `Shift` | 显示克隆源(覆盖 iamge)
|
||||
`Alt` `Shift` `(arrows)` | 轻推克隆源
|
||||
`Alt` `Shift` `</>` | 旋转克隆源
|
||||
`Alt` `Shift` `[/]` | 缩放(增加或减小大小)克隆源
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用图层面板
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `N` | 新层
|
||||
`Ctrl` `J` | 通过复制新建图层
|
||||
`Ctrl` `Shift` `J` | 通过剪切新建图层
|
||||
`Ctrl` `G` | 图层组
|
||||
`Ctrl` `Shift` `G` | 取消组合图层
|
||||
`Ctrl` `Alt` `G` | 创建/释放剪贴蒙版
|
||||
`Ctrl` `Alt` `A` | 选择所有图层
|
||||
`Ctrl` `Shift` `E` | 合并可见层
|
||||
`Alt` `.` | 选择顶层
|
||||
`Alt` `.` | 选择底层
|
||||
`Shift` `Alt` `[/]` | 添加到图层面板中的图层选择
|
||||
`Alt` `[/]` | 向下/向上选择下一层
|
||||
`Ctrl` `[/]` | 向下/向上移动目标图层
|
||||
`Ctrl` `Shift` `Alt` `E` | 将所有可见图层的副本合并到目标图层中
|
||||
`Ctrl` `E` | 合并图层(当图层突出显示时)
|
||||
`Ctrl` `Shift` `[/]` | 将层移动到底部或顶部
|
||||
`/` | 切换目标图层的锁定透明度或上次应用的锁定
|
||||
`\` | 打开/关闭图层蒙版的 rubylith 模式
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
--------
|
||||
|
||||
- [Keyboard shortcuts for Adobe Photoshop](https://helpx.adobe.com/photoshop/using/default-keyboard-shortcuts.html) _(helpx.adobe.com)_
|
194
docs/adobe-xd.md
Normal file
@ -0,0 +1,194 @@
|
||||
Adobe XD 键盘快捷键
|
||||
===
|
||||
|
||||
Adobe XD 中 97 个键盘快捷键的可视化备忘单
|
||||
|
||||
键盘快捷键
|
||||
--------
|
||||
|
||||
### 编辑菜单键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Z` | 撤消
|
||||
`Ctrl` `Shift` `Z` | 重做
|
||||
`Ctrl` `X` | 剪切
|
||||
`Ctrl` `C` | 复制
|
||||
`Ctrl` `V` | 粘贴
|
||||
`Ctrl` `Alt` `V` | 粘贴外观(设计模式)或粘贴交互(原型模式)
|
||||
`Ctrl` `D` | 复制
|
||||
`Del` | 删除
|
||||
`Ctrl` `A` | 全选
|
||||
`Ctrl` `Shift` `A` | 取消全选
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 文件菜单键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `N` | 新的
|
||||
`Ctrl` `Shift` `O` | 打开...
|
||||
`Alt` `F4` | 关闭
|
||||
`Ctrl` `S` | 节省...
|
||||
`Ctrl` `Shift` `S` | 另存为...
|
||||
`Ctrl` `Shift` `E` | 出口批量
|
||||
`Ctrl` `E` | 导出选择
|
||||
`Ctrl` `Shift` `I` | 进口
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 笔/路径键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`P` | 切换到钢笔工具
|
||||
`Alt` | 不对称控制点
|
||||
`Shift` | 捕捉控制点角度
|
||||
`Shift` | 捕捉锚点角度
|
||||
`Ctrl` `Alt` `U` | 添加
|
||||
`Ctrl` `Alt` `S` | 减去
|
||||
`Ctrl` `Alt` `I` | 相交
|
||||
`Ctrl` `Alt` `X` | 排除重叠
|
||||
`Ctrl` `8` | 转换为路径
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 图层(对象)、组和画板的键
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `G` | 图层组
|
||||
`Ctrl` `Shift` `G` | 取消组合图层
|
||||
`Ctrl` `K` | 制作组件
|
||||
`Ctrl` `L` | 锁定/解锁图层
|
||||
`Ctrl` `,` | 隐藏/显示图层
|
||||
`Ctrl` `Shift` `M` | 有形状的面具
|
||||
`Ctrl` `R` | 制作重复网格
|
||||
`1-9` | 更改图层不透明度
|
||||
`Ctrl` `;` | 显示/隐藏画板指南
|
||||
`Ctrl` `Shift` `;` | 锁定画板指南
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 对齐键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `Left` | 左边
|
||||
`Shift` `C` | 中心(水平)
|
||||
`Ctrl` `Shift` `Right` | 正确的
|
||||
`Ctrl` `Shift` `Up` | 顶部
|
||||
`Shift` `M` | 中间(垂直)
|
||||
`Ctrl` `Shift` `Down` | 底部
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 排列键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `]` | 置于最前面
|
||||
`Ctrl` `]` | 向前进
|
||||
`Ctrl` `[` | 向后发送
|
||||
`Ctrl` `Shift` `[` | 发送到后台
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 分发键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `H` | 水平的
|
||||
`Ctrl` `Shift` `V` | 竖的
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 文本键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `B` | 粗体
|
||||
`Ctrl` `I` | 斜体
|
||||
`Ctrl` `Shift` `.` | 增加字体大小
|
||||
`Ctrl` `Shift` `,` | 减小字体大小
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 操作菜单键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Alt` | 从中心
|
||||
`Shift` | 约束
|
||||
`Enter` | 编辑文字
|
||||
`Shift` | 约束旋转(15 度)
|
||||
`Shift` | 线约束旋转(45 度)
|
||||
`Shift` `Alt` | 从中心约束
|
||||
`Ctrl` | 直接选择
|
||||
`Ctrl` `Tab` | 在设计和原型模式之间切换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 工具菜单键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`V` | 选择
|
||||
`R` | 长方形
|
||||
`E` | 椭圆
|
||||
`Y` | 多边形
|
||||
`L` | 线
|
||||
`P` | 笔
|
||||
`T` | 文本
|
||||
`A` | 画板
|
||||
`Z` | 快速移动
|
||||
`Ctrl` `3` | 缩放到所选内容
|
||||
`I` | 滴管
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 界面和查看选项的键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 缩放以适合
|
||||
`Ctrl` `1` | 缩放至 `100%`
|
||||
`Ctrl` `2` | 缩放至 `200%`
|
||||
`Space` | 平底锅
|
||||
`Ctrl` `Shift` `Y` | 资产
|
||||
`Ctrl` `Y` | 图层
|
||||
`Ctrl` `Shift` `'` | 显示布局网格
|
||||
`Ctrl` `'` | 显示方形网格
|
||||
`Ctrl` `Tab` | 在设计和原型模式之间切换
|
||||
`Up/Down` | 将字段中的值增加或减少 `1`
|
||||
`Shift` `Up/Down` | 将字段中的值增加或减少 `10`
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 设计规范要点
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `+/-` | 快速移动
|
||||
`Ctrl` `0` | 重置缩放
|
||||
`(arrows)` | 平底锅
|
||||
`Shift` `(arrows)` | 更快的锅
|
||||
`Esc` | 从规范视图转到用户体验流程视图
|
||||
`Esc` | 在 UX 流视图中从画板上移除焦点
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 矢量编辑键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Enter` | 开始编辑选定的矢量对象
|
||||
`Esc` | 停止编辑选定的矢量对象
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 原型制作的关键
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `A` | 查看原型模式下的所有连接
|
||||
`Ctrl` `Enter` | 预览
|
||||
`Ctrl` `Shift` `E` | 在线分享原型
|
||||
`Left/Right` | 在预览或共享原型中浏览画板
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
--------
|
||||
|
||||
- [Keyboard shortcuts for Adobe XD](https://helpx.adobe.com/xd/help/keyboard-shortcuts.html) _(helpx.adobe.com)_
|
205
docs/android-studio.md
Normal file
@ -0,0 +1,205 @@
|
||||
Android Studio 键盘快捷键
|
||||
====
|
||||
|
||||
Android Studio 软件中 130 个键盘快捷键的可视化备忘单
|
||||
|
||||
键盘快捷键
|
||||
--------
|
||||
|
||||
### 一般的
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Ctrl` `S` | 保存全部
|
||||
`Ctrl` `Alt` `Y` | 同步
|
||||
`Ctrl` `Shift` `F12` | 最小化或最大化编辑器
|
||||
`Alt` `Shift` `F` | 添加到收藏夹
|
||||
`Alt` `Shift` `I` | 使用当前配置文件检查当前文件
|
||||
`Ctrl` <code>\`</code> | 快速切换方案
|
||||
`Ctrl` `Alt` `S` | 打开设置对话框
|
||||
`Ctrl` `Alt` `Shift` `S` | 打开项目结构对话框
|
||||
`Ctrl` `Tab` | 在选项卡和工具窗口之间切换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 导航和搜索
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Shift` `Shift` | 搜索所有内容,包括代码和菜单
|
||||
`Ctrl` `F` | 寻找
|
||||
`F3` | 找下一个
|
||||
`Shift` `F3` | 查找上一个
|
||||
`Ctrl` `R` | 代替
|
||||
`Ctrl` `Shift` `A` | 查找操作
|
||||
`Ctrl` `Alt` `Shift` `N` | 按交易品种名称搜索
|
||||
`Ctrl` `N` | 查找班级
|
||||
`Ctrl` `Shift` `N` | 查找文件,而不是类
|
||||
`Ctrl` `Shift` `F` | 在路径中查找
|
||||
`Ctrl` `F12` | 打开文件结构弹出窗口
|
||||
`Alt` `Right/Left` | 在打开的编辑器选项卡之间导航
|
||||
`Ctrl` `Enter` | 跳转到源
|
||||
`Shift` `F4` | 在新窗口中打开当前编辑器选项卡
|
||||
`Ctrl` `E` | 最近打开的文件弹出窗口
|
||||
`Ctrl` `Shift` `E` | 最近编辑的文件弹出窗口
|
||||
`Ctrl` `Shift` `Backspace` | 转到上次编辑位置
|
||||
`Ctrl` `F4` | 关闭活动编辑器选项卡
|
||||
`Esc` | 从工具窗口返回到编辑器窗口
|
||||
`Shift` `Esc` | 隐藏活动或最后活动的工具窗口
|
||||
`Ctrl` `G` | 去线
|
||||
`Ctrl` `H` | 开放式层次结构
|
||||
`Ctrl` `Shift` `H` | 打开方法层次结构
|
||||
`Ctrl` `Alt` `H` | 开放调用层级
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 编写代码
|
||||
<!--rehype:wrap-class=row-span-6-->
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Alt` `Insert` | 生成代码,例如getters、setters、构造函数、新类
|
||||
`Ctrl` `O` | 覆盖方法
|
||||
`Ctrl` `I` | 实现方法
|
||||
`Ctrl` `Alt` `T` | 用 if...else、try...catch 等包围
|
||||
`Ctrl` `Y` | 删除插入符处的行
|
||||
`Ctrl` `-` | 折叠当前代码块
|
||||
`Ctrl` `+` | 展开当前代码块
|
||||
`Ctrl` `Shift` `-` | 折叠所有代码块
|
||||
`Ctrl` `Shift` `+` | 展开所有代码块
|
||||
`Ctrl` `D` | 复制当前行或选择
|
||||
`Ctrl` `Space` | 基本代码完成
|
||||
`Ctrl` `Shift` `Space` | 智能代码完成,按预期类型过滤方法和变量列表
|
||||
`Ctrl` `Shift` `Enter` | 完整声明
|
||||
`Ctrl` `Q` | 快速文档查找
|
||||
`Ctrl` `P` | 显示所选方法的参数
|
||||
`Ctrl` `B` | 直接去报关
|
||||
`Ctrl` `Alt` `B` | 转到实施
|
||||
`Ctrl` `U` | 转到超方法或超类
|
||||
`Ctrl` `Shift` `I` | 打开快速定义查找
|
||||
`Alt` `1` | 切换项目工具窗口可见性
|
||||
`F11` | 切换书签
|
||||
`Ctrl` `F11` | 使用助记符切换书签
|
||||
`Ctrl` `/` | 注释或取消注释行注释
|
||||
`Ctrl` `Shift` `/` | 使用块评论评论或取消评论
|
||||
`Ctrl` `W` | 选择连续递增的代码块
|
||||
`Ctrl` `Shift` `W` | 将当前选择减少到以前的状态
|
||||
`Ctrl` `[` | 移动到代码块开始
|
||||
`Ctrl` `]` | 移动到代码块末尾
|
||||
`Ctrl` `Shift` `[` | 选择到代码块开始
|
||||
`Ctrl` `Shift` `]` | 选择到代码块结束
|
||||
`Ctrl` `Del` | 删除到一个词的末尾
|
||||
`Ctrl` `Backspace` | 删除到单词的开头
|
||||
`Ctrl` `Alt` `O` | 优化导入
|
||||
`Alt` `Enter` | 项目快速修复、显示意图操作和快速修复
|
||||
`Ctrl` `Alt` `L` | 重新格式化代码
|
||||
`Ctrl` `Alt` `I` | 自动缩进行
|
||||
`Tab` | 缩进线
|
||||
`Shift` `Tab` | 不缩进线
|
||||
`Ctrl` `Shift` `J` | 智能线路加入
|
||||
`Ctrl` `Enter` | 智能分线
|
||||
`Shift` `Enter` | 开始新行
|
||||
`F2` | 下一个突出显示的错误
|
||||
`Shift` `F2` | 上一个突出显示的错误
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 查看布局
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Ctrl` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 适应屏幕
|
||||
`Ctrl` `Shift` `1` | 实际尺寸
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 布局编辑器
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`B` | 在设计和蓝图模式之间切换
|
||||
`O` | 在人像和风景模式之间切换
|
||||
`D` | 切换设备
|
||||
`R` | 强制刷新
|
||||
`E` | 切换渲染错误面板
|
||||
`Del` | 删除约束
|
||||
`Ctrl` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 缩放以适合
|
||||
`Ctrl` `B` | 转到 XML
|
||||
`Ctrl` `A` | 选择所有组件
|
||||
`Shift` `(click)` | 选择多个组件
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 导航编辑器
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Ctrl` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 缩放以适合
|
||||
`Ctrl` `B` | 转到 XML
|
||||
`E` | 切换渲染错误面板
|
||||
`Ctrl` `G` | 分组为嵌套图
|
||||
`Tab` | 循环浏览目的地
|
||||
`Ctrl` `A` | 选择所有目的地
|
||||
`Ctrl` `(click)` | 选择多个目的地
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 构建并运行
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Ctrl` `F9` | 建造
|
||||
`Shift` `F10` | 构建并运行
|
||||
`Ctrl` `F10` | 应用更改并重新启动活动
|
||||
`Ctrl` `Alt` `F10` | 应用代码更改
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 版本控制
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Ctrl` `K` | 提交项目到 VCS
|
||||
`Ctrl` `T` | 从 VCS 更新项目
|
||||
`Alt` `Shift` `C` | 查看最近的更改
|
||||
`Alt` <code>\`</code> | 打开 VCS 弹出窗口
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 调试
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`Shift` `F9` | 调试
|
||||
`F8` | 跨过
|
||||
`F7` | 踏入
|
||||
`Shift` `F7` | 智能步入
|
||||
`Shift` `F8` | 走出去
|
||||
`Alt` `F9` | 运行到光标处
|
||||
`Alt` `F8` | 评估表达
|
||||
`F9` | 恢复程序
|
||||
`Ctrl` `F8` | 切换断点
|
||||
`Ctrl` `Shift` `F8` | 查看断点
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 重构
|
||||
|
||||
快捷键 | 说明
|
||||
---|---
|
||||
`F5` | 复制
|
||||
`F6` | 移动
|
||||
`Alt` `Del` | 安全删除
|
||||
`Shift` `F6` | 改名
|
||||
`Ctrl` `F6` | 更改签名
|
||||
`Ctrl` `Alt` `N` | 排队
|
||||
`Ctrl` `Alt` `M` | 提取方法
|
||||
`Ctrl` `Alt` `V` | 提取变量
|
||||
`Ctrl` `Alt` `F` | 提取字段
|
||||
`Ctrl` `Alt` `C` | 提取常量
|
||||
`Ctrl` `Alt` `P` | 提取参数
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
--------
|
||||
|
||||
- [Keyboard shortcuts for Android Studio](https://developer.android.com/studio/intro/keyboard-shortcuts) _(developer.android.com)_
|
249
docs/aspect-ratio.md
Normal file
@ -0,0 +1,249 @@
|
||||
Aspect Ratio 备忘清单
|
||||
===
|
||||
|
||||
此备忘单列出了一些常见的宽高比及其像素分辨率
|
||||
|
||||
入门
|
||||
----
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 介绍
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
- 宽高比是屏幕或图像的宽度和高度之间的比率
|
||||
- 它通常写成由冒号或“x”分隔的两个数字,例如:16:9 或 16x9
|
||||
- 这被解释为宽度为 W 像素,高度为每个 H 像素。
|
||||
- 分辨率是像素数(颜色的各个点)
|
||||
<!--rehype:className=style-round-->
|
||||
|
||||
宽高比列表
|
||||
--------
|
||||
|
||||
### 1080p
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 864 x 1080
|
||||
1.25 (5:4) | 1350 x 1080
|
||||
1.33 (4:3) | 1440 x 1080
|
||||
1.66 (5:3) | 1800 x 1080
|
||||
1.78 (16:9) | 1920 x 1080
|
||||
1.85 | 1920 x 1038
|
||||
1.90 | 1920 x 1011
|
||||
2.00 | 1920 x 960
|
||||
2.35 | 1920 x 817
|
||||
2.37 | 1920 x 810
|
||||
2.39 | 1920 x 803
|
||||
2.40 | 1920 x 800
|
||||
2.44 | 1920 x 787
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 720p
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 576 x 720
|
||||
1.25 (5:4) | 900 x 720
|
||||
1.33 (4:3) | 960 x 720
|
||||
1.66 (5:3) | 1200 x 720
|
||||
1.78 (16:9) | 1280 x 720
|
||||
1.85 | 1280 x 692
|
||||
1.90 | 1280 x 674
|
||||
2.00 | 1280 x 640
|
||||
2.35 | 1280 x 545
|
||||
2.37 | 1280 x 540
|
||||
2.39 | 1280 x 536
|
||||
2.40 | 1280 x 533
|
||||
2.44 | 1280 x 525
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### Cinema DCP 4K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
Flat (1.85) | 3996 x 2160
|
||||
Scope (2.39) | 4096 x 1716
|
||||
Full Container (1.90) | 4096 x 2160
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### Cinema DCP 2K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
Flat (1.85) | 1998 x 1080
|
||||
Scope (2.39) | 2048 x 858
|
||||
Full Container (1.90) | 2048 x 1080
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 8K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 3686 x 4608
|
||||
1.25 (5:4) | 5760 x 4608
|
||||
1.33 (4:3) | 6144 x 4608
|
||||
1.66 (5:3) | 7680 x 4608
|
||||
1.78 (16:9) | 8192 x 4608
|
||||
1.85 | 8192 x 4428
|
||||
1.90 | 8192 x 4320
|
||||
2.00 | 8192 x 4096
|
||||
2.35 | 8192 x 3486
|
||||
2.37 | 8192 x 3456
|
||||
2.39 | 8192 x 3428
|
||||
2.40 | 8192 x 3413
|
||||
2.44 | 8192 x 3357
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 6K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 2765 x 3456
|
||||
1.25 (5:4) | 4320 x 3456
|
||||
1.33 (4:3) | 4608 x 3456
|
||||
1.66 (5:3) | 5760 x 3456
|
||||
1.78 (16:9) | 6144 x 3456
|
||||
1.85 | 6144 x 3321
|
||||
1.90 | 6144 x 3234
|
||||
2.00 | 6144 x 3072
|
||||
2.35 | 6144 x 2614
|
||||
2.37 | 6144 x 2592
|
||||
2.39 | 6144 x 2571
|
||||
2.40 | 6144 x 2560
|
||||
2.44 | 6144 x 2518
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 4K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 2765 x 3456
|
||||
1.25 (5:4) | 4320 x 3456
|
||||
1.33 (4:3) | 4608 x 3456
|
||||
1.66 (5:3) | 5760 x 3456
|
||||
1.78 (16:9) | 6144 x 3456
|
||||
1.85 | 6144 x 3321
|
||||
1.90 | 6144 x 3234
|
||||
2.00 | 6144 x 3072
|
||||
2.35 | 6144 x 2614
|
||||
2.37 | 6144 x 2592
|
||||
2.39 | 6144 x 2571
|
||||
2.40 | 6144 x 2560
|
||||
2.44 | 6144 x 2518
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 3K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 1382 x 1728
|
||||
1.25 (5:4) | 2160 x 1728
|
||||
1.33 (4:3) | 2304 x 1728
|
||||
1.66 (5:3) | 2880 x 1728
|
||||
1.78 (16:9) | 3072 x 1728
|
||||
1.85 | 3072 x 1661
|
||||
1.90 | 3072 x 1620
|
||||
2.00 | 3072 x 1536
|
||||
2.35 | 3072 x 1307
|
||||
2.37 | 3072 x 1296
|
||||
2.39 | 3072 x 1285
|
||||
2.40 | 3072 x 1280
|
||||
2.44 | 3072 x 1259
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 2K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 922 x 1152
|
||||
1.25 (5:4) | 1440 x 1152
|
||||
1.33 (4:3) | 1536 x 1152
|
||||
1.66 (5:3) | 1920 x 1152
|
||||
1.78 (16:9) | 2048 x 1152
|
||||
1.85 | 2048 x 1107
|
||||
1.90 | 2048 x 1078
|
||||
2.00 | 2048 x 1024
|
||||
2.35 | 2048 x 871
|
||||
2.37 | 2048 x 864
|
||||
2.39 | 2048 x 858
|
||||
2.40 | 2048 x 853
|
||||
2.44 | 2048 x 838
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 8K UHD
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 2765 x 3456
|
||||
1.25 (5:4) | 5400 x 3456
|
||||
1.33 (4:3) | 5760 x 3456
|
||||
1.66 (5:3) | 7200 x 3456
|
||||
1.78 (16:9) | 7680 x 4320
|
||||
1.85 | 7680 x 4151
|
||||
1.90 | 7680 x 4042
|
||||
2.00 | 7680 x 3840
|
||||
2.35 | 7680 x 3268
|
||||
2.37 | 7680 x 3240
|
||||
2.39 | 7680 x 3213
|
||||
2.40 | 7680 x 3200
|
||||
2.44 | 7680 x 3148
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 5K
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 2304 x 2880
|
||||
1.25 (5:4) | 3600 x 2880
|
||||
1.33 (4:3) | 3840 x 2880
|
||||
1.66 (5:3) | 4800 x 2880
|
||||
1.78 (16:9) | 5120 x 2880
|
||||
1.85 | 5120 x 2768
|
||||
1.90 | 5120 x 2700
|
||||
2.00 | 5120 x 2560
|
||||
2.35 | 5120 x 2179
|
||||
2.37 | 5120 x 2160
|
||||
2.39 | 5120 x 2142
|
||||
2.40 | 5120 x 2133
|
||||
2.44 | 5120 x 2098
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 4K UHD
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 1728 x 2160
|
||||
1.25 (5:4) | 2700 x 2160
|
||||
1.33 (4:3) | 2880 x 2160
|
||||
1.66 (5:3) | 3600 x 2160
|
||||
1.78 (16:9) | 3840 x 2160
|
||||
1.85 | 3840 x 2076
|
||||
1.90 | 3840 x 2021
|
||||
2.00 | 3840 x 1920
|
||||
2.35 | 3840 x 1634
|
||||
2.37 | 3840 x 1620
|
||||
2.39 | 3840 x 1607
|
||||
2.40 | 3840 x 1600
|
||||
2.44 | 3840 x 1574
|
||||
<!--rehype:className=show-header-->
|
||||
|
||||
### 3K UHD
|
||||
|
||||
纵横比 | 分辨率
|
||||
:-- | --
|
||||
0.80 (4:5) | 1296 x 1620
|
||||
1.25 (5:4) | 2025 x 1620
|
||||
1.33 (4:3) | 2160 x 1620
|
||||
1.66 (5:3) | 2700 x 1620
|
||||
1.78 (16:9) | 2880 x 1620
|
||||
1.85 | 2880 x 1557
|
||||
1.90 | 2880 x 1516
|
||||
2.00 | 2880 x 1440
|
||||
2.35 | 2880 x 1226
|
||||
2.37 | 2880 x 1215
|
||||
2.39 | 2880 x 1205
|
||||
2.40 | 2880 x 1200
|
||||
2.44 | 2880 x 1180
|
||||
<!--rehype:className=show-header-->
|
79
docs/bash.md
@ -4,7 +4,7 @@ Bash 备忘清单
|
||||
这是开始使用 linux bash shell 脚本的快速参考备忘单。
|
||||
|
||||
入门
|
||||
---------------
|
||||
-----
|
||||
|
||||
### hello.sh
|
||||
|
||||
@ -837,7 +837,6 @@ if [[ "$1" == '--' ]]; then shift; fi
|
||||
```
|
||||
|
||||
### 检查命令的结果
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
if ping -c 1 google.com; then
|
||||
@ -845,6 +844,73 @@ if ping -c 1 google.com; then
|
||||
fi
|
||||
```
|
||||
|
||||
### grep 检查
|
||||
|
||||
```bash
|
||||
if grep -q 'foo' ~/.bash_history; then
|
||||
echo "您过去似乎输入过“foo”"
|
||||
fi
|
||||
```
|
||||
|
||||
### 写入文件
|
||||
<!--rehype:wrap-class=row-span-6-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`cat` | 用于显示文本文件内容,全部输出
|
||||
`EOF` | `end of file`,表示文本结束符
|
||||
|
||||
---
|
||||
|
||||
```bash
|
||||
cat > output.txt <<EOF
|
||||
this is test eof
|
||||
this is test eof2
|
||||
EOF
|
||||
```
|
||||
|
||||
输出 `cat output.txt`
|
||||
|
||||
```
|
||||
this is test eof
|
||||
this is test eof2
|
||||
```
|
||||
|
||||
追加内容
|
||||
|
||||
```bash
|
||||
cat >>2.txt <<EOF
|
||||
456
|
||||
789
|
||||
EOF
|
||||
```
|
||||
|
||||
`$` 等特殊字符时,须利用转义字符 `\`
|
||||
|
||||
```bash
|
||||
cat > file <<EOF
|
||||
export ORACLE_SID=yqpt
|
||||
export PATH=\$PATH:\$ORACLE_HOME/bin
|
||||
EOF
|
||||
```
|
||||
|
||||
取消变量替换,`EOF` 被加上双引号或者单引号,即可取消变量的替换
|
||||
|
||||
```bash
|
||||
cat << "EOF" > output.sh
|
||||
echo "This is output"
|
||||
echo $1
|
||||
EOF
|
||||
```
|
||||
|
||||
所有TAB键将全部忽略[不能是空格]
|
||||
|
||||
```bash
|
||||
cat << -EOF
|
||||
echo "This is output"
|
||||
EOF
|
||||
```
|
||||
|
||||
### 特殊变量
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
@ -857,15 +923,6 @@ fi
|
||||
|
||||
见[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)。
|
||||
|
||||
### grep 检查
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
if grep -q 'foo' ~/.bash_history; then
|
||||
echo "您过去似乎输入过“foo”"
|
||||
fi
|
||||
```
|
||||
|
||||
### 反斜杠转义
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
|
410
docs/cpp.md
@ -545,6 +545,416 @@ int main() {
|
||||
}
|
||||
```
|
||||
|
||||
### Lambda 表达式
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
Lambda 表达式可以在函数内定义,可以理解为在函数内定义的临时函数。格式:
|
||||
|
||||
```cpp
|
||||
auto func = []() -> return_type { };
|
||||
```
|
||||
|
||||
- `[]`为捕获列表,能够捕获其所在函数的局部变量
|
||||
- 一个空的捕获列表代表Lambda表达式不捕获任何的变量
|
||||
- 对于值捕获,直接在中括号中填写要捕获的变量即可:
|
||||
|
||||
```cpp
|
||||
int val = 5;
|
||||
auto func = [val]() -> return_type { };
|
||||
```
|
||||
|
||||
- 对于引用捕获,需要在捕获的变量前添加`&`:
|
||||
|
||||
```cpp
|
||||
string str("hello world!");
|
||||
auto func = [&str]() -> return_type { };
|
||||
```
|
||||
|
||||
- 如果变量太多,需要编译器根据我们编写的代码自动捕获,可以采用隐式捕获的方式。
|
||||
|
||||
- 全部值捕获:
|
||||
|
||||
```cpp
|
||||
int val1, val2;
|
||||
auto func = [=]() -> int
|
||||
{
|
||||
return val1 + val2;
|
||||
};
|
||||
```
|
||||
|
||||
- 全部引用捕获:
|
||||
|
||||
```cpp
|
||||
string str1("hello"), str2("word!");
|
||||
auto func = [&]() -> string
|
||||
{
|
||||
return str1 + str2;
|
||||
};
|
||||
```
|
||||
|
||||
- 混合隐式捕获:
|
||||
|
||||
如果希望对一部分变量采用值捕获,对其他变量采用引用捕获,可以混合使用:
|
||||
|
||||
```cpp
|
||||
int val1 = 123, val2 = 456;
|
||||
string str1("123"), str2(456);
|
||||
|
||||
auto func1 = [=, &str1]() -> int
|
||||
{
|
||||
return val1 == std::stoi(str1)
|
||||
? val1 : val2;
|
||||
};
|
||||
|
||||
auto func2 = [&, val1]() -> int
|
||||
{
|
||||
return str1 == std::to_string(val1)
|
||||
? str1 : str2;
|
||||
};
|
||||
```
|
||||
|
||||
- `()` 是参数列表,我们只需要按照普通函数的使用方法来使用即可
|
||||
- `return_type` 是函数的返回类型,`-> return_type` 可以不写,编译器会自动推导
|
||||
- `{}` 中的内容就是函数体,依照普通函数的使用方法使用即可
|
||||
<!--rehype:className=style-timeline-->
|
||||
|
||||
此处给出一个 Lambda 表达式的实际使用例子(当然可以使用 `str::copy`):
|
||||
|
||||
```cpp
|
||||
// vec中包含1, 2, 3, 4, 5
|
||||
std::vector<int> vec({1, 2, 3, 4, 5});
|
||||
std::for_each(vec.begin(), vec.end(),
|
||||
[](int& ele) -> void
|
||||
{
|
||||
std::cout << ele
|
||||
<< " ";
|
||||
});
|
||||
```
|
||||
|
||||
## C++多线程
|
||||
|
||||
### 多线程介绍
|
||||
|
||||
g++编译选项:`-std=c++11`。包含头文件:
|
||||
|
||||
- `#include <thread>`:C++多线程库
|
||||
- `#include <mutex>`:C++互斥量库
|
||||
- `#include <future>`:C++异步库
|
||||
|
||||
### 线程的创建
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
以普通函数作为线程入口函数:
|
||||
|
||||
```cpp
|
||||
void entry_1() { }
|
||||
void entry_2(int val) { }
|
||||
|
||||
std::thread my_thread_1(entry_1);
|
||||
std::thread my_thread_2(entry_2, 5);
|
||||
```
|
||||
|
||||
以类对象作为线程入口函数:
|
||||
|
||||
```cpp
|
||||
class Entry
|
||||
{
|
||||
void operator()() { }
|
||||
void entry_function() { }
|
||||
};
|
||||
|
||||
Entry entry;
|
||||
// 调用operator()()
|
||||
std::thread my_thread_1(entry);
|
||||
// 调用Entry::entry_function
|
||||
std::thread my_thread_2(&Entry::entry_function, &entry);
|
||||
```
|
||||
|
||||
以lambda表达式作为线程入口函数:
|
||||
|
||||
```cpp
|
||||
std::thread my_thread([]() -> void
|
||||
{
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
### 线程的销毁
|
||||
|
||||
```cpp
|
||||
thread my_thread;
|
||||
// 阻塞
|
||||
my_thread.join();
|
||||
// 非阻塞
|
||||
my_thread.detach();
|
||||
```
|
||||
|
||||
### `this_thread`
|
||||
|
||||
```cpp
|
||||
// 获取当前线程ID
|
||||
std::this_thread::get_id();
|
||||
// 使当前线程休眠一段指定时间
|
||||
std::this_thread::sleep_for();
|
||||
// 使当前线程休眠到指定时间
|
||||
std::this_thread::sleep_until();
|
||||
// 暂停当前线程的执行,让别的线程执行
|
||||
std::this_thread::yield();
|
||||
```
|
||||
|
||||
### 锁
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
> `#include <mutex>`
|
||||
|
||||
#### 锁的基本操作
|
||||
|
||||
创建锁
|
||||
|
||||
```cpp
|
||||
std::mutex m;
|
||||
```
|
||||
|
||||
上锁
|
||||
|
||||
```cpp
|
||||
m.lock();
|
||||
```
|
||||
|
||||
解锁
|
||||
|
||||
```cpp
|
||||
m.unlock();
|
||||
```
|
||||
|
||||
尝试上锁:成功返回`true`,失败返回`false`
|
||||
|
||||
```cpp
|
||||
m.try_lock();
|
||||
```
|
||||
|
||||
解锁
|
||||
|
||||
```cpp
|
||||
m.unlock();
|
||||
```
|
||||
|
||||
#### 更简单的锁 —— `std::lock_guard<Mutex>`
|
||||
|
||||
构造时上锁,析构时解锁
|
||||
|
||||
```cpp
|
||||
std::mutex m;
|
||||
std::lock_guard<std::mutex> lock(m);
|
||||
```
|
||||
|
||||
额外参数:`std::adopt_lock`:只需解锁,无需上锁
|
||||
|
||||
```cpp
|
||||
// 手动上锁
|
||||
m.lock();
|
||||
std::lock_guard<mutex> lock(m,
|
||||
std::adopt_lock);
|
||||
```
|
||||
|
||||
#### `unique_lock<Mutex>`
|
||||
|
||||
构造上锁,析构解锁
|
||||
|
||||
```cpp
|
||||
std::mutex m;
|
||||
std::unique_lock<mutex> lock(m);
|
||||
```
|
||||
|
||||
##### `std::adopt_lock`
|
||||
|
||||
只需解锁,无需上锁
|
||||
|
||||
```cpp
|
||||
// 手动上锁
|
||||
m.lock();
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::adopt_lock);
|
||||
```
|
||||
|
||||
##### `std::try_to_lock`
|
||||
|
||||
尝试上锁,可以通过`std::unique_lock<Mutex>::owns_lock()`查看状态
|
||||
|
||||
```cpp
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::try_to_lock);
|
||||
if (lock.owns_lock())
|
||||
{
|
||||
// 拿到了锁
|
||||
}
|
||||
else
|
||||
{
|
||||
// 没有
|
||||
}
|
||||
```
|
||||
|
||||
##### `std::defer_lock`
|
||||
|
||||
绑定锁,但不上锁
|
||||
|
||||
```cpp
|
||||
std::unique_lock<mutex> lock(m,
|
||||
std::defer_lock);
|
||||
lock.lock();
|
||||
lock.unlock();
|
||||
```
|
||||
|
||||
##### `std::unique_lock<Mutex>::release`
|
||||
|
||||
返回所管理的`mutex`对象指针,**释放所有权。**一旦释放了所有权,那么如果原来互斥量处于互斥状态,程序员有责任手动解锁。
|
||||
|
||||
#### `std::call_once`
|
||||
|
||||
当多个线程通过这个函数调用一个可调用对象时,只会有一个线程成功调用。
|
||||
|
||||
```cpp
|
||||
std::once_flag flag;
|
||||
|
||||
void foo() { }
|
||||
|
||||
std::call_once(flag, foo);
|
||||
```
|
||||
|
||||
### `std::condition_variable`
|
||||
|
||||
#### 创建条件变量
|
||||
|
||||
```cpp
|
||||
std::condition_variable cond;
|
||||
```
|
||||
|
||||
#### 等待条件变量被通知
|
||||
|
||||
```cpp
|
||||
std::unique_lock<std::mutex>
|
||||
lock;
|
||||
extern bool predicate();
|
||||
|
||||
// 调用方式 1
|
||||
cond.wait(lock);
|
||||
// 调用方式 2
|
||||
cond.wait(lock, predicate);
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
- `wait`不断地尝试重新获取并加锁该互斥量,如果获取不到,它就卡在这里并反复尝试重新获取,如果获取到了,执行流程就继续往下走
|
||||
- `wait`在获取到互斥量并加锁了互斥量之后:
|
||||
- 如果`wait`被提供了可调用对象,那么就执行这个可调用对象:
|
||||
- 如果返回值为`false`,那么`wait`继续加锁,直到再次被 notified
|
||||
- 如果返回值为`true`,那么`wait`返回,继续执行流程
|
||||
- 如果`wait`没有第二个参数,那么直接返回,继续执行
|
||||
|
||||
#### `std::condition_variable::notify_one`
|
||||
|
||||
`notify_one` 唤醒一个调用 `wait` 的线程。注意在唤醒之前要解锁,否则调用 `wait` 的线程也会因为无法加锁而阻塞。
|
||||
|
||||
#### `std::condition_variable::notify_all`
|
||||
|
||||
唤醒所有调用 `wait` 的线程。
|
||||
|
||||
### 获取线程的运行结果
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
> `#include <future>`
|
||||
|
||||
#### 创建异步任务
|
||||
|
||||
```cpp
|
||||
double func(int val);
|
||||
|
||||
// 使用std::async创建异步任务
|
||||
// 使用std::future获取结果
|
||||
// future模板中存放返回值类型
|
||||
std::future<double> result =
|
||||
std::async(func, 5);
|
||||
```
|
||||
|
||||
#### 获取异步任务的返回值
|
||||
|
||||
等待异步任务结束,但是不获取返回值:
|
||||
|
||||
```cpp
|
||||
result.wait();
|
||||
```
|
||||
|
||||
获取异步任务的返回值:
|
||||
|
||||
```cpp
|
||||
int val = result.get();
|
||||
```
|
||||
|
||||
注:
|
||||
|
||||
- `get()`返回右值,因此只可调用一次
|
||||
- 只要调用上述任意函数,线程就会一直阻塞到返回值可用(入口函数运行结束)
|
||||
|
||||
#### `std::async` 的额外参数
|
||||
|
||||
额外参数可以被放在 `std::async` 的第一个参数位置,用于设定 `std::async` 的行为:
|
||||
|
||||
- `std::launch::deferred`:入口函数的运行会被推迟到`std::future<T>::get()`或者`std::future<T>::wait()`被调用时。此时调用线程会直接运行线程入口函数,换言之,**不会创建子线程**
|
||||
- `std::launch::async`:立即创建子线程,并运行线程入口函数
|
||||
- `std::launch::deferred | std::launch::async`:默认值,由系统自行决定
|
||||
|
||||
#### 返回值的状态
|
||||
|
||||
让当前线程等待一段时间(等待到指定时间点),以期待返回值准备好:
|
||||
|
||||
```cpp
|
||||
extern double foo(int val) {}
|
||||
|
||||
std::future<double> result =
|
||||
async(foo, 5);
|
||||
|
||||
//返回值类型
|
||||
std::future_status status;
|
||||
// 等待一段时间
|
||||
status = result.wait_for(
|
||||
std::chrono::seconds(1)
|
||||
);
|
||||
// 等待到某一时间点
|
||||
status = result.wait_for(
|
||||
std::chrono::now() +
|
||||
std::chrono::seconds(1)
|
||||
);
|
||||
```
|
||||
|
||||
在指定的时间过去后,可以获取等待的结果:
|
||||
|
||||
```cpp
|
||||
// 返回值已经准备好
|
||||
if (status ==
|
||||
std::future_status::ready)
|
||||
{
|
||||
|
||||
}
|
||||
// 超时:尚未准备好
|
||||
else if (status ==
|
||||
std::future_status::timeout)
|
||||
{ }
|
||||
// 尚未启动: std::launch::deferred
|
||||
else if (status ==
|
||||
std::future_status::deferred)
|
||||
{ }
|
||||
```
|
||||
|
||||
#### 多个返回值
|
||||
|
||||
```cpp
|
||||
std::shared_future<T> result;
|
||||
```
|
||||
|
||||
如果要多次获取结果,可以使用`std::shared_future`,其会返回结果的一个**拷贝**。
|
||||
|
||||
对于不可拷贝对象,可以在`std::shared_future`中存储对象的指针,而非指针本身。
|
||||
|
||||
C++ 预处理器
|
||||
------------
|
||||
|
||||
|
185
docs/css.md
@ -13,8 +13,6 @@ CSS 功能丰富,不仅仅是布局页面
|
||||
|
||||
#### 外部样式表 `<link>`
|
||||
|
||||
`
|
||||
|
||||
```html
|
||||
<link
|
||||
href="./path/to/stylesheet/style.css"
|
||||
@ -1487,6 +1485,7 @@ br + br {
|
||||
```
|
||||
|
||||
### CSS 重置
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```css
|
||||
html {
|
||||
@ -1501,6 +1500,62 @@ html {
|
||||
|
||||
有助于在不同的浏览器之间强制样式一致性,并为样式元素提供干净的盒子
|
||||
|
||||
### 设置光标样式
|
||||
|
||||
```css
|
||||
body {
|
||||
caret-color: red;
|
||||
}
|
||||
```
|
||||
|
||||
### 设置整个页面灰色
|
||||
<!--rehype:wrap-style=-webkit-filter: grayscale(.95);-->
|
||||
|
||||
```css
|
||||
html {
|
||||
-webkit-filter: grayscale(.95);
|
||||
}
|
||||
```
|
||||
|
||||
上面示例设置了当前卡片灰色
|
||||
|
||||
### 使用 unset 而不是重置所有属性
|
||||
|
||||
使用 `all` 速记来指定元素的所有属性。将值设置为 `unset` 会将元素的属性更改为其初始值:
|
||||
|
||||
```css
|
||||
button {
|
||||
all: unset;
|
||||
}
|
||||
```
|
||||
|
||||
注意:`IE11` 不支持 `all` 和 `unset` 速记
|
||||
|
||||
### 超出显示省略号
|
||||
|
||||
```css
|
||||
p {
|
||||
overflow: hidden;/*超出部分隐藏*/
|
||||
/* 超出部分显示省略号 */
|
||||
text-overflow:ellipsis;
|
||||
/* 规定段落中的文本不进行换行 */
|
||||
white-space: nowrap;
|
||||
width: 250px;/*需要配合宽度来使用*/
|
||||
}
|
||||
```
|
||||
|
||||
### 给正文添加行高
|
||||
|
||||
您不需要为每个 `<p>`、`<h*>` 等添加行高。相反,将其添加到正文:
|
||||
|
||||
```css
|
||||
body {
|
||||
line-height: 1.5;
|
||||
}
|
||||
```
|
||||
|
||||
这样文本元素可以很容易地从 `body` 继承
|
||||
|
||||
### 使用图像作为光标
|
||||
|
||||
```css
|
||||
@ -1624,7 +1679,7 @@ div {
|
||||
|
||||
### 定义容器的长宽比
|
||||
|
||||
```
|
||||
```css
|
||||
div {
|
||||
aspect-ratio: 1/1
|
||||
}
|
||||
@ -1632,6 +1687,130 @@ div {
|
||||
|
||||
属性 [aspect-ratio](https://developer.mozilla.org/zh-CN/docs/Web/CSS/aspect-ratio) 可以非常容易的定义一个容器的长宽比
|
||||
|
||||
### 等宽表格单元格
|
||||
|
||||
尝试使用 `table-layout: fixed` 以保持单元格宽度相等:
|
||||
|
||||
```css
|
||||
table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
```
|
||||
|
||||
### 利用属性选择器来选择空链接
|
||||
|
||||
当 `<a>` 元素没有文本内容,但有 `href` 属性的时候,显示它的 `href` 属性:
|
||||
|
||||
```css
|
||||
a[href^="http"]:empty::before {
|
||||
content: attr(href);
|
||||
}
|
||||
```
|
||||
|
||||
### 给 “默认” 链接定义样式
|
||||
|
||||
给 “默认” 链接定义样式:
|
||||
|
||||
```css
|
||||
a[href]:not([class]) {
|
||||
color: #008000;
|
||||
text-decoration: underline;
|
||||
}
|
||||
```
|
||||
|
||||
通常没有 `class` 属性,以上样式可以甄别它们,而且不会影响其它样式
|
||||
|
||||
### 用 rem 调整全局大小;用 em 调整局部大小
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
在根元素设置基本字体大小后 (`html { font-size: 100%; }`), 使用 em 设置文本元素的字体大小:
|
||||
|
||||
```css
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
}
|
||||
p {
|
||||
font-size: 1em;
|
||||
}
|
||||
```
|
||||
|
||||
然后设置模块的字体大小为 rem:
|
||||
|
||||
```css
|
||||
article {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
aside .module {
|
||||
font-size: .9rem;
|
||||
}
|
||||
```
|
||||
|
||||
现在,每个模块变得独立,更容易、灵活的样式便于维护
|
||||
|
||||
### 隐藏没有静音、自动播放的影片
|
||||
|
||||
这是一个自定义用户样式表的不错的技巧。避免在加载页面时自动播放。如果没有静音,则不显示视频:
|
||||
|
||||
```css
|
||||
video[autoplay]:not([muted]) {
|
||||
display: none;
|
||||
}
|
||||
```
|
||||
|
||||
再次,我们利用了 `:not()` 的优点
|
||||
|
||||
### 为更好的移动体验,为表单元素设置字体大小
|
||||
|
||||
当触发 `<select>` 的下拉列表时,为了避免表单元素在移动浏览器(iOS Safari 和其它)上的缩放,加上font-size:
|
||||
|
||||
```css
|
||||
input[type="text"],
|
||||
input[type="number"],
|
||||
select,
|
||||
textarea {
|
||||
font-size: 16px;
|
||||
}
|
||||
```
|
||||
|
||||
### 使用指针事件来控制鼠标事件
|
||||
|
||||
指针事件允许您指定鼠标如何与其触摸的元素进行交互。要禁用按钮上的默认指针事件,例如:
|
||||
|
||||
```css
|
||||
button:disabled {
|
||||
opacity: .5;
|
||||
pointer-events: none;
|
||||
}
|
||||
```
|
||||
|
||||
就这么简单
|
||||
|
||||
### 在用作间距的换行符上设置 `display: none`
|
||||
|
||||
用户使用额外的换行符
|
||||
|
||||
```css
|
||||
br + br {
|
||||
display: none;
|
||||
}
|
||||
```
|
||||
|
||||
### 子元素选中父元素
|
||||
|
||||
```css
|
||||
div:has(img) {
|
||||
background: black;
|
||||
}
|
||||
```
|
||||
|
||||
设置包含子元素 `img` 的 `div` 元素样式,还可以嵌套:
|
||||
|
||||
```css
|
||||
div:has(h2):has(ul) {
|
||||
background: black;
|
||||
}
|
||||
```
|
||||
|
||||
另见
|
||||
---------
|
||||
|
||||
|
@ -281,7 +281,7 @@ $ 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 rmi -f $(docker images -q)` | 删除所有镜像
|
||||
|
||||
### 卷 volume
|
||||
|
||||
@ -307,10 +307,10 @@ $ docker volume prune
|
||||
`docker-compose down` | 停止和删除容器、网络、映像和卷
|
||||
`docker-compose logs` | 查看容器的输出
|
||||
`docker-compose restart` | 重启所有服务
|
||||
`docker-compose pull` | 拉取所有图片服务
|
||||
`docker-compose build` | 构建所有图像服务
|
||||
`docker-compose pull` | 拉取所有服务的镜像
|
||||
`docker-compose build` | 构建所有服务的镜像
|
||||
`docker-compose config` | 验证并查看 Compose 文件
|
||||
`docker-compose scale <service_name>=<replica>` | 规模特殊服务
|
||||
`docker-compose scale <service_name>=<replica>` | 为服务指定容器个数
|
||||
`docker-compose top` | 显示正在运行的进程
|
||||
`docker-compose run -rm -p 2022:22 web bash` | 启动 Web 服务并运行 bash 作为其命令,删除旧容器。
|
||||
|
||||
@ -361,35 +361,35 @@ $ docker volume prune
|
||||
:- | :-
|
||||
`attach` | 将本地标准输入、输出和错误流附加到正在运行的容器
|
||||
`build` | 从 Dockerfile 构建镜像
|
||||
`commit` | 从容器的更改创建新图像
|
||||
`commit` | 从容器的更改创建新镜像
|
||||
`cp` | 在容器和本地文件系统之间复制文件/文件夹
|
||||
`create` | 创建一个新容器
|
||||
`diff` | 检查容器文件系统上文件或目录的更改
|
||||
`events` | 从服务器获取实时事件
|
||||
`exec` | 在正在运行的容器中运行命令
|
||||
`export` | 将容器的文件系统导出为 tar 存档
|
||||
`history` | 显示图像的历史
|
||||
`images` | 列出图像
|
||||
`history` | 显示镜像的历史
|
||||
`images` | 列出镜像
|
||||
`import` | 从 tarball 导入内容以创建文件系统映像
|
||||
`info` | 显示系统范围的信息
|
||||
`inspect` | 返回有关 Docker 对象的低级信息
|
||||
`kill` | 杀死一个或多个正在运行的容器
|
||||
`load` | 从 tar 存档或 STDIN 加载图像
|
||||
`load` | 从 tar 存档或 STDIN 加载镜像
|
||||
`login` | 登录到 Docker 注册表
|
||||
`logout` | 从 Docker 注册表中注销
|
||||
`logs` | 获取容器的日志
|
||||
`pause` | 暂停一个或多个容器内的所有进程
|
||||
`port` | 列出容器的端口映射或特定映射
|
||||
`ps` | 列出容器
|
||||
`pull` | 从注册表中提取图像或存储库
|
||||
`push` | 将图像或存储库推送到注册表
|
||||
`pull` | 从注册表中提取镜像或存储库
|
||||
`push` | 将镜像或存储库推送到注册表
|
||||
`rename` | 重命名容器
|
||||
`restart` | 重启一个或多个容器
|
||||
`rm` | 移除一个或多个容器
|
||||
`rmi` | 移除一张或多张图片
|
||||
`rmi` | 移除一张或多张镜像
|
||||
`run` | 在新容器中运行命令
|
||||
`save` | 将一个或多个图像保存到 tar 存档(默认流式传输到 STDOUT)
|
||||
`search` | 在 `Docker Hub` 中搜索图像
|
||||
`save` | 将一个或多个镜像保存到 tar 存档(默认流式传输到 STDOUT)
|
||||
`search` | 在 `Docker Hub` 中搜索镜像
|
||||
`start` | 启动一个或多个停止的容器
|
||||
`stats` | 显示容器资源使用统计的实时流
|
||||
`stop` | 停止一个或多个正在运行的容器
|
||||
@ -431,12 +431,12 @@ $ docker volume prune
|
||||
--device-read-iops list # 限制设备的读取速率(每秒 IO)(默认 [])
|
||||
--device-write-bps list # 限制设备的写入速率(每秒字节数)(默认 [])
|
||||
--device-write-iops list # 限制设备的写入速率(每秒 IO)(默认 [])
|
||||
--disable-content-trust # 跳过图像验证(默认为 true)
|
||||
--disable-content-trust # 跳过镜像验证(默认为 true)
|
||||
--dns list # 设置自定义 DNS 服务器
|
||||
--dns-option list # 设置 DNS 选项
|
||||
--dns-search list # 设置自定义 DNS 搜索域
|
||||
--domainname string # 容器 NIS 域名
|
||||
--entrypoint string # 覆盖图像的默认入口点
|
||||
--entrypoint string # 覆盖镜像的默认入口点
|
||||
-e, --env list # 设置环境变量
|
||||
--env-file list # 读入环境变量文件
|
||||
--expose list # 公开一个端口或一系列端口
|
||||
@ -480,7 +480,7 @@ $ docker volume prune
|
||||
--privileged # 授予此容器扩展权限
|
||||
-p, --publish list # 将容器的端口发布到主机
|
||||
-P, --publish-all # 将所有暴露的端口发布到随机端口
|
||||
--pull string # 创建前拉取图像("always"|"missing"|"never")(默认"missing")
|
||||
--pull string # 创建前拉取镜像("always"|"missing"|"never")(默认"missing")
|
||||
--read-only # 将容器的根文件系统挂载为只读
|
||||
--restart string # 容器退出时应用的重启策略(默认“否”)
|
||||
--rm # 容器退出时自动移除
|
||||
@ -533,7 +533,7 @@ $ docker volume prune
|
||||
`docker config` | 管理 Docker 配置
|
||||
`docker container` | 管理容器
|
||||
`docker context` | 管理上下文
|
||||
`docker image` | 管理图像
|
||||
`docker image` | 管理镜像
|
||||
`docker manifest` | 管理 Docker 镜像清单和清单列表
|
||||
`docker network` | 管理网络
|
||||
`docker node` | 管理 Swarm 节点
|
||||
@ -550,12 +550,12 @@ $ docker volume prune
|
||||
### docker images
|
||||
|
||||
```bash
|
||||
-a, --all 显示所有图像(默认隐藏中间图像)
|
||||
-a, --all 显示所有镜像(默认隐藏中间镜像)
|
||||
--digests 显示摘要
|
||||
-f, --filter filter 根据提供的条件过滤输出
|
||||
--format string 使用 Go 模板打印漂亮的图像
|
||||
--format string 使用 Go 模板打印漂亮的镜像
|
||||
--no-trunc 不要截断输出
|
||||
-q, --quiet 仅显示图像 ID
|
||||
-q, --quiet 仅显示镜像 ID
|
||||
```
|
||||
|
||||
Docker 示例
|
||||
|
@ -215,7 +215,7 @@ Dockerfile 示例
|
||||
|
||||
```dockerfile
|
||||
FROM lipanski/docker-static-website:latest
|
||||
# 使用 .dockerignore 文件来控制图像中的内容!
|
||||
# 使用 .dockerignore 文件来控制镜像中的内容!
|
||||
# 复制当前目录内容,到容器中
|
||||
COPY ./ .
|
||||
```
|
||||
|
@ -1,7 +1,13 @@
|
||||
Electron 备忘清单
|
||||
====
|
||||
|
||||
此快速参考备忘单提供了 Electron v21 API 说明和使用示例。
|
||||
[](https://www.npmjs.com/package/electron)
|
||||
[](https://www.npmjs.com/package/electron)
|
||||
[](https://github.com/electron/electron/network/dependents)
|
||||
[](https://github.com/electron/electron)
|
||||
|
||||
此快速参考备忘单提供了 Electron v21 API 说明和使用示例
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
----
|
||||
|
@ -1,7 +1,13 @@
|
||||
Express 备忘清单
|
||||
===
|
||||
|
||||
这是用于 Node.js 的快速、不拘一格、极简主义的 Web 框架,包含 [Express.js](http://expressjs.com/) 的 API 参考列表和一些示例。
|
||||
[](https://npmjs.org/package/express)
|
||||
[](https://www.npmjs.com/package/express)
|
||||
[](https://github.com/expressjs/express/network/dependents)
|
||||
[](https://github.com/expressjs/express)
|
||||
|
||||
这是用于 Node.js 的快速、不拘一格、极简主义的 Web 框架,包含 [Express.js](http://expressjs.com/) 的 API 参考列表和一些示例
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
---
|
||||
|
156
docs/feds.md
Normal file
@ -0,0 +1,156 @@
|
||||
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-->
|
||||
[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-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
构建工具
|
||||
---
|
||||
|
||||
[Webpack](http://webpack.github.io/)<!--rehype:target=_blank&style=background: rgb(107 148 216/var(\-\-bg\-opacity));-->
|
||||
[NPM](https://www.npmjs.com/)<!--rehype:target=_blank&style=background: rgb(203 8 1/var(\-\-bg\-opacity));-->
|
||||
[Yarn](https://yarnpkg.com/zh-Hans/)<!--rehype:target=_blank&style=background: rgb(33 136 182/var(\-\-bg\-opacity));-->
|
||||
[pnpm](https://pnpm.io/)<!--rehype:target=_blank&style=background: rgb(246 146 32/var(\-\-bg\-opacity));-->
|
||||
[Lerna](https://lerna.js.org/)<!--rehype:target=_blank&style=background: rgb(147 51 234/var(\-\-bg\-opacity));-->
|
||||
[Vitejs](https://cn.vitejs.dev/)<!--rehype:target=_blank&style=background: rgb(188 52 254/var(\-\-bg\-opacity));-->
|
||||
[Gulp](https://gulpjs.com/)<!--rehype:target=_blank&style=background: rgb(207 70 71/var(\-\-bg\-opacity));-->
|
||||
[Parcel](https://en.parceljs.org/)<!--rehype:target=_blank&style=background: rgb(192 145 99/var(\-\-bg\-opacity));-->
|
||||
[Rollup](https://rollupjs.org/guide/en/)<!--rehype:target=_blank&style=background: rgb(239 51 53/var(\-\-bg\-opacity));-->
|
||||
[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-->
|
||||
[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-->
|
||||
<!--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-->
|
||||
[W3C 标准](http://w3help.org/)<!--rehype:target=_blank-->
|
||||
<!--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-->
|
||||
[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-->
|
||||
[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-->
|
||||
[Prettier](https://prettier.io/)<!--rehype:target=_blank&style=background: rgb(197 149 199/var(\-\-bg\-opacity));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
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-->
|
||||
[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));-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
CSS 工具
|
||||
---
|
||||
|
||||
[30秒CSS](https://atomiks.github.io/30-seconds-of-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-->
|
||||
[Grid.Guide](http://grid.guide/)<!--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-->
|
||||
[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-->
|
||||
[Stylus](http://stylus-lang.com/)<!--rehype:target=_blank&style=background: rgb(126 194 66/var(\-\-bg\-opacity));-->
|
||||
[Stylelint](https://stylelint.io/)<!--rehype:target=_blank-->
|
||||
<!--rehype:class=home-card-->
|
||||
|
||||
框架类库
|
||||
---
|
||||
|
||||
[React](https://facebook.github.io/react/)<!--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-->
|
||||
[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-->
|
||||
<!--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-->
|
||||
<!--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-->
|
||||
<!--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-->
|
||||
<!--rehype:class=home-card-->
|
@ -581,6 +581,7 @@ $ ffmpeg -f concat -i mylist.txt -c:v copy -c:a flac -strict -2 output.mp4
|
||||
|
||||
视频过滤器
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 格式
|
||||
|
||||
@ -631,7 +632,6 @@ ffmpeg -i 1.mp4 -b:v 548k -vf delogo=x=10:y=10:w=120:h=45:show=1 output.mp4
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
### 创建缩略图
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
在 10 秒时创建一个缩略图
|
||||
|
||||
@ -686,6 +686,7 @@ $ ffmpeg -i 1.mp4 -i test.mp3 \
|
||||
|
||||
音频过滤器
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 调节音量
|
||||
|
||||
@ -720,6 +721,7 @@ $ ffmpeg -i input.mp3 -af "channelmap=1-0|1-1" output.mp3
|
||||
|
||||
流处理
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 拉流
|
||||
|
||||
@ -736,6 +738,7 @@ $ ffmpeg -re -i test.mp4 -f flv rtmp://127.0.0.1/test
|
||||
```
|
||||
|
||||
### 转发
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
# 拉取流并转发
|
||||
|
197
docs/firefox.md
Normal file
@ -0,0 +1,197 @@
|
||||
Firefox 键盘快捷键备忘清单
|
||||
===
|
||||
|
||||
Firefox 中 116 个键盘快捷键的可视化备忘单
|
||||
|
||||
火狐浏览器键盘快捷键
|
||||
------------------
|
||||
|
||||
### 导航
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Left` | 后退
|
||||
`Ctrl` `Right` | 向前
|
||||
`Alt` `Home` | 家
|
||||
`Ctrl` `O` | 打开文件
|
||||
`Ctrl` `R` | 重新加载
|
||||
`Ctrl` `Shift` `R` | 重新加载(覆盖缓存)
|
||||
`Ctrl` `.` | 停止
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 当前页面
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Tab` | 聚焦下一个链接或输入字段
|
||||
`Shift` `Tab` | 聚焦上一个链接或输入字段
|
||||
`Space` | 下一个屏幕
|
||||
`Shift` `Space` | 上一个屏幕
|
||||
`Ctrl` `Down` | 转到页面底部
|
||||
`Ctrl` `Up` | 转到页面顶部
|
||||
`F6` | 移动到下一帧
|
||||
`Shift` `F6` | 移至上一帧
|
||||
`Ctrl` `P` | 打印
|
||||
`Ctrl` `S` | 将页面另存为
|
||||
`Ctrl` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 缩放重置
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 编辑
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `C` | 复制
|
||||
`Ctrl` `X` | 剪切
|
||||
`Backspace` | 删除
|
||||
`Home` | 转到行首
|
||||
`End` | 转到行尾
|
||||
`Ctrl` `V` | 粘贴
|
||||
`Ctrl` `Shift` `V` | 粘贴(作为纯文本)
|
||||
`Ctrl` `Shift` `Z` | 重做
|
||||
`Ctrl` `A` | 全选
|
||||
`Ctrl` `Z` | 撤消
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 历史
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `H` | 历史边栏
|
||||
`Ctrl` `Shift` `Delete` | 最近清除历史记录
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 搜索
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `F` | 查询
|
||||
`Ctrl` `G` | 再找
|
||||
`Ctrl` `Shift` `G` | 查找上一个
|
||||
`'` | 仅在链接文本中快速查找
|
||||
`/` | 快速查找
|
||||
`Esc` | 关闭查找或快速查找栏
|
||||
`Ctrl` `K` | 焦点搜索栏
|
||||
`Ctrl` `Up/Down` | 更改默认搜索引擎
|
||||
`Alt` `Up/Down` | 查看菜单以切换、添加或管理搜索引擎
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 窗口和选项卡
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `W` | 关闭标签
|
||||
`Ctrl` `Shift` `W` | 关闭窗口
|
||||
`Ctrl` `Tab` | 按最近使用的顺序循环浏览选项卡
|
||||
`Ctrl` `Q` | 退出
|
||||
`Ctrl` `Alt` `Left` | 向左移动一个标签
|
||||
`Ctrl` `Alt` `Right` | 向右移动一个标签
|
||||
`Ctrl` `Shift` `PgUp` | 向左移动制表符
|
||||
`Ctrl` `Shift` `PgDown` | 向右移动选项卡
|
||||
`Ctrl` `Shift` `Home` | 将 Tab 移动到焦点以开始
|
||||
`Ctrl` `Shift` `End` | 将 Tab 移动到焦点结束
|
||||
`Ctrl` `M` | 静音/取消静音音频
|
||||
`Ctrl` `T` | 新标签
|
||||
`Ctrl` `N` | 新窗户
|
||||
`Ctrl` `Shift` `P` | 新建私人窗口
|
||||
`Alt` `Enter` | 在新前台选项卡中打开地址
|
||||
`Enter` | 在当前选项卡中打开重点书签或链接
|
||||
`Ctrl` `Enter` | 在新的前景选项卡中打开重点书签
|
||||
`Ctrl` `Shift` `Enter` | 在新背景选项卡中打开重点书签
|
||||
`Ctrl` `Enter` | 在新背景选项卡中打开焦点链接
|
||||
`Shift` `Enter` | 在新窗口中打开重点书签或链接
|
||||
`Ctrl` `Shift` `T` | 撤消关闭选项卡
|
||||
`Ctrl` `Shift` `N` | 撤消关闭窗口
|
||||
`Ctrl` `1-8` | 选择选项卡 1-8
|
||||
`Ctrl` `9` | 选择最后一个标签
|
||||
`Ctrl` `Shift` `X` | 向左或向右移动 URL
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 书签
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `D` | 为所有标签添加书签
|
||||
`Ctrl` `D` | 收藏此页
|
||||
`Ctrl` `B` | 书签侧边栏
|
||||
`Ctrl` `Shift` `S` | 库窗口(书签)
|
||||
`(search field in Library)` `Space` | 搜索所有书签
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 工具
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `J` | 下载
|
||||
`Ctrl` `Shift` `A` | 插件
|
||||
`Ctrl` `Alt` `I` | 切换开发者工具
|
||||
`Ctrl` `Alt` `K` | 网络控制台
|
||||
`Ctrl` `Alt` `C` | 检查员
|
||||
`Ctrl` `Alt` `S` | 调试器
|
||||
`Shift` `F7` | 样式编辑器
|
||||
`Shift` `F5` | 剖析器
|
||||
`Ctrl` `Alt` `E` | 网络
|
||||
`Shift` `F2` | 开发者工具栏
|
||||
`Ctrl` `Alt` `M` | 响应式设计视图
|
||||
`Shift` `F4` | 便笺
|
||||
`Ctrl` `U` | 页面源
|
||||
`Ctrl` `Shift` `J` | 浏览器控制台
|
||||
`Ctrl` `I` | 页面信息
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### PDF 查看器
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`N/J/Right` | 下一页
|
||||
`P/K/Left` | 上一页
|
||||
`Ctrl` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 自动缩放
|
||||
`R` | 顺时针旋转文档
|
||||
`Ctrl` `R` | 逆时针旋转
|
||||
`Ctrl` `Alt` `P` | 切换到演示模式
|
||||
`S` | 选择文本选择工具
|
||||
`H` | 选择手形工具
|
||||
`Ctrl` `Alt` `G` | 聚焦页码输入框
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 各种各样的
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Enter` | 完整的 .com 地址
|
||||
`Shift` `Enter` | 完整的 .net 地址
|
||||
`Ctrl` `Shift` `Enter` | 完整的 .org 地址
|
||||
`Shift` `Delete` | 删除选定的自动完成条目
|
||||
`Ctrl` `Shift` `F` | 切换全屏
|
||||
`Ctrl` `Alt` `R` | 切换阅读器模式
|
||||
`F7` | 插入符浏览
|
||||
`Ctrl` `L` | 选择地址栏
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 媒体快捷方式
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Space` | 切换播放/暂停
|
||||
`Down` | 降低音量
|
||||
`Up` | 增加音量
|
||||
`Ctrl` `Down` | 静音
|
||||
`Ctrl` `Up` | 取消静音
|
||||
`Left` | 后退 15 秒
|
||||
`Ctrl` `Left` | 追回 10%
|
||||
`Right` | 快进 15 秒
|
||||
`Ctrl` `Right` | 向前寻求 10%
|
||||
`Home` | 追寻至始
|
||||
`End` | 求到底
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
--------
|
||||
|
||||
- [Keyboard shortcuts for Firefox](https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly) _(support.mozilla.org)_
|
255
docs/flask.md
Normal file
@ -0,0 +1,255 @@
|
||||
Flask 备忘清单
|
||||
===
|
||||
|
||||
本清单对 Flask 的入门进行了简要的概述,以及其常用示例。需要有 `HTML` 和 `Python` 基础。
|
||||
|
||||
入门
|
||||
-----
|
||||
|
||||
### 相关链接
|
||||
|
||||
- [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) _(developer.mozilla.org)_
|
||||
- [Python](https://www.python.org/) _(python.org)_
|
||||
- [Flask](https://flask.palletsprojects.com/) _(flask.palletsprojects.com)_
|
||||
- [Python 备忘清单](./python.md) _(jaywcjlove.github.io)_
|
||||
|
||||
### Hello World
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
#### hello.py
|
||||
|
||||
```python
|
||||
# 导入 Flask 类
|
||||
from flask import Flask
|
||||
|
||||
# 创建应用实例
|
||||
app = Flask(__name__) # 'Flask' 参数是 应用程序模块 或 包 的名称
|
||||
# __name__是适用于大多数情况的便捷快捷方式
|
||||
|
||||
# 路由 (装饰器)
|
||||
@app.route('/') # route()装饰器告诉 Flask 什么路径触发下面的功能
|
||||
def hello():
|
||||
# 该函数返回我们想要在浏览器中显示的消息内容
|
||||
return 'Hello World!'
|
||||
# 默认类型 HTML, 因此字符串中的 HTML 将被浏览器渲染
|
||||
# 启动服务
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
```
|
||||
|
||||
### 运行 `hello.py` 程序
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```shell
|
||||
$ python hello.py
|
||||
* Serving Flask app 'hello'
|
||||
* Running on http://127.0.0.1:5000
|
||||
* Press CTRL+C to quit
|
||||
```
|
||||
|
||||
#### 或
|
||||
|
||||
```shell
|
||||
$ flask --app hello run
|
||||
* Serving Flask app 'hello'
|
||||
* Running on http://127.0.0.1:5000
|
||||
* Press CTRL+C to quit
|
||||
$ flask run --host=0.0.0.0
|
||||
```
|
||||
|
||||
启用调试模式,使用 `--debug` 选项
|
||||
|
||||
```bash
|
||||
$ flask --app hello --debug run
|
||||
```
|
||||
|
||||
### HTML 转义
|
||||
|
||||
```py
|
||||
from markupsafe import escape
|
||||
|
||||
@app.route("/<name>")
|
||||
def hello(name):
|
||||
return f"Hello, {escape(name)}!"
|
||||
```
|
||||
|
||||
### 路由
|
||||
|
||||
```py
|
||||
@app.route('/')
|
||||
def index():
|
||||
return 'Index Page'
|
||||
|
||||
@app.route('/hello')
|
||||
def hello():
|
||||
return 'Hello, World'
|
||||
```
|
||||
|
||||
### 变量规则
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```py
|
||||
from markupsafe import escape
|
||||
|
||||
@app.route('/user/<username>')
|
||||
def show_user_profile(username):
|
||||
# 显示该用户的用户个人资料
|
||||
return f'User {escape(username)}'
|
||||
|
||||
@app.route('/post/<int:post_id>')
|
||||
def show_post(post_id):
|
||||
# 显示给定id的帖子,id是一个整数
|
||||
return f'Post {post_id}'
|
||||
|
||||
@app.route('/path/<path:subpath>')
|
||||
def show_subpath(subpath):
|
||||
# 在 /path/ 之后显示子路径
|
||||
return f'Subpath {escape(subpath)}'
|
||||
```
|
||||
|
||||
转换器类型:
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`string` | (默认)接受任何没有斜杠的文本
|
||||
`int` | 接受正整数
|
||||
`float` | 接受正浮点值
|
||||
`path` | 像字符串但也接受斜线
|
||||
`uuid` | 接受 UUID 字符串
|
||||
|
||||
### 唯一 URL / 重定向行为
|
||||
|
||||
```py
|
||||
@app.route('/projects/')
|
||||
def projects():
|
||||
return 'The project page'
|
||||
|
||||
@app.route('/about')
|
||||
def about():
|
||||
return 'The about page'
|
||||
```
|
||||
|
||||
项目端点的规范 `URL` 有一个尾部斜杠。它类似于文件系统中的文件夹。如果您访问没有尾部斜杠 (`/projects`) 的 `URL`,`Flask` 会将您重定向到带有尾部斜杠 (`/projects/`) 的规范 `URL`
|
||||
|
||||
### URL 建设
|
||||
|
||||
```py
|
||||
from flask import url_for
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return 'index'
|
||||
|
||||
@app.route('/login')
|
||||
def login():
|
||||
return 'login'
|
||||
|
||||
@app.route('/user/<username>')
|
||||
def profile(username):
|
||||
return f'{username}\'s profile'
|
||||
|
||||
with app.test_request_context():
|
||||
print(url_for('index'))
|
||||
print(url_for('login'))
|
||||
print(url_for('login', next='/'))
|
||||
print(url_for('profile', username='John Doe'))
|
||||
```
|
||||
|
||||
### HTTP 方法
|
||||
|
||||
默认路由仅响应 `GET` 请求。可以使用 `route()` 装饰器的方法参数来处理不同的 `HTTP` 方法
|
||||
|
||||
```py
|
||||
from flask import request
|
||||
|
||||
@app.route('/login',methods=['GET','POST'])
|
||||
def login():
|
||||
if request.method == 'POST':
|
||||
return do_the_login()
|
||||
else:
|
||||
return show_the_login_form()
|
||||
```
|
||||
|
||||
您还可以将不同方法的视图分成不同的函数。 `Flask` 为每个常见的 `HTTP` 方法提供了一种快捷方式,用于使用 `get()`、`post()` 等来装饰此类路由
|
||||
|
||||
```py
|
||||
@app.get('/login')
|
||||
def login_get():
|
||||
return show_the_login_form()
|
||||
|
||||
@app.post('/login')
|
||||
def login_post():
|
||||
return do_the_login()
|
||||
```
|
||||
|
||||
### Blueprint
|
||||
|
||||
创建蓝图Bp1
|
||||
|
||||
```py
|
||||
from flask import Blueprint, abort, jsonify
|
||||
|
||||
# 定义Bp1,并定义url前缀为/img
|
||||
Bp1 = Blueprint('imgBlue', __name__, template_folder='templates', url_prefix='/img')
|
||||
|
||||
|
||||
@Bp1.route('/getimg')
|
||||
def getImg():
|
||||
try:
|
||||
return jsonify(name="img", size="100KB")
|
||||
except Exception as e:
|
||||
abort(e)
|
||||
```
|
||||
|
||||
创建蓝图Bp2
|
||||
|
||||
```py
|
||||
from flask import Blueprint, abort, jsonify
|
||||
|
||||
# 定义Bp2,并定义url前缀为/vedio
|
||||
Bp2 = Blueprint('vedioBlue', __name__, template_folder='templates', url_prefix='/vedio')
|
||||
|
||||
|
||||
@Bp2.route('/getvedio')
|
||||
def getVedio():
|
||||
try:
|
||||
return jsonify(name="vedio", size="100GB")
|
||||
except Exception as e:
|
||||
abort(e)
|
||||
```
|
||||
|
||||
在flask app中引用蓝图Bp1和Bp2
|
||||
|
||||
```py
|
||||
from flask import Flask, jsonify
|
||||
from lantu.img import Bp1
|
||||
from lantu.vedio import Bp2
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# 注册蓝图到app
|
||||
app.register_blueprint(Bp1)
|
||||
app.register_blueprint(Bp2)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return jsonify(name='phyger')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host="127.0.0.1", debug=True)
|
||||
```
|
||||
|
||||
简单测试
|
||||
|
||||
```bash
|
||||
curl http://127.0.0.1:5000/
|
||||
>> {"name":"phyger"}
|
||||
|
||||
curl http://127.0.0.1:5000/img/getimg
|
||||
>> {"name": "img", "size": "100KB"}
|
||||
|
||||
curl http://127.0.0.1:5000/vedio/getvedio
|
||||
>> {"name": "vedio", "size": "100GB"}
|
||||
```
|
160
docs/flutter.md
@ -729,6 +729,166 @@ Row(
|
||||
|
||||
例如,需要文本和图标位于一个行的两端,而中间留白时。就可以使用 `Spacer`
|
||||
|
||||
### ListView
|
||||
|
||||
`ListView` 是一个支持滚动的列表组件。该组件默认支持上下滑动。
|
||||
`ListView`的默认构造函数,会立即初始化`children`中的所有子`widget`,无法动态加载。
|
||||
|
||||
```dart
|
||||
ListView(
|
||||
children: [
|
||||
Text('1'),
|
||||
Text('2'),
|
||||
Text('3'),
|
||||
Text('4'),
|
||||
],
|
||||
),
|
||||
```
|
||||
|
||||
需要动态加载,则可以使用 `ListView.builder()`命名构函数。
|
||||
|
||||
```dart
|
||||
// 动态生成4个Text
|
||||
ListView.builder(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Text('$index');
|
||||
},
|
||||
itemCount: 4,
|
||||
),
|
||||
```
|
||||
|
||||
需要在对`ListView`中的`Item`添加分割线,则可以借助`ListView.separated()`。
|
||||
|
||||
```dart
|
||||
// separatorBuilder 函数用于在元素之间插入分割线。
|
||||
// 也可以返回其他widget。该widget会被插入各个元素之间。
|
||||
ListView.separated(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Text('$index');
|
||||
},
|
||||
itemCount: 4,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
// 使用Divider widget 画一条粗为5,颜色为红色的线
|
||||
return const Divider(
|
||||
height: 5,
|
||||
thickness: 5,
|
||||
color: Colors.red,
|
||||
);
|
||||
},
|
||||
),
|
||||
```
|
||||
|
||||
### GridView
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
`GridView`可将元素显示为二维网格状的列表组件,并支持主轴方向滚动。
|
||||
使用GridView() 构造函数,需要传入gridDelegate和children。Flutter中已经提供了两种实现方式,分别是:
|
||||
|
||||
- `SliverGridDelegateWithFixedCrossAxisCount()` 用于交叉轴方向固定数。
|
||||
- `SliverGridDelegateWithMaxCrossAxisExtent()` 用于交叉轴方向限制最大长度。
|
||||
|
||||
```dart
|
||||
// 使用SliverGridDelegateWithFixedCrossAxisCount
|
||||
GridView(
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
|
||||
children: List.generate(
|
||||
8,
|
||||
(index) => Container(
|
||||
color: Colors.red[index % 8 * 100],
|
||||
child: Text("index $index"),
|
||||
)),
|
||||
),
|
||||
|
||||
// 使用SliverGridDelegateWithMaxCrossAxisExtent
|
||||
GridView(
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithMaxCrossAxisExtent(maxCrossAxisExtent: 200),
|
||||
children: List.generate(
|
||||
8,
|
||||
(index) => Container(
|
||||
color: Colors.red[index % 8 * 100],
|
||||
child: Text("index $index"),
|
||||
),
|
||||
),
|
||||
),
|
||||
```
|
||||
|
||||
`GridView.builder()`命名构造可以实现元素的动态加载,与`ListView.builder()`类似
|
||||
|
||||
```dart
|
||||
GridView.builder(
|
||||
itemCount: 8,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4),
|
||||
itemBuilder: (context, index) => Container(
|
||||
color: Colors.red[index % 8 * 100],
|
||||
child: Text("index $index"),
|
||||
),
|
||||
),
|
||||
```
|
||||
|
||||
`Gridview.count()` 一个简单的构造函数,只需要传入`crossAxisCount`(交叉轴元素的个数)和`children`即可。
|
||||
|
||||
```dart
|
||||
GridView.count(
|
||||
crossAxisCount: 4, // 每行固定为4个
|
||||
children: List.generate(
|
||||
8,
|
||||
(index) => Container(
|
||||
color: Colors.red[index % 8 * 100],
|
||||
child: Text("index $index"),
|
||||
)),
|
||||
),
|
||||
```
|
||||
|
||||
`GridView.extent()` 用于设定每个元素在交叉轴方向的最大尺寸。当程序运行在较大屏幕时通常能看到更多的元素,而不是少量元素的放大版。通过传入`maxCrossAxisExtent`,`Gridview`会根据屏幕尺寸自动选择合适的行数量。
|
||||
|
||||
```dart
|
||||
GridView.extent(
|
||||
maxCrossAxisExtent: 200,
|
||||
children: List.generate(
|
||||
8,
|
||||
(index) => Container(
|
||||
color: Colors.red[index % 8 * 100],
|
||||
child: Text("index $index"),
|
||||
)),
|
||||
),
|
||||
```
|
||||
|
||||
`GridView.count()`和GridView.extent()`可以看作GridView的语法糖。
|
||||
|
||||
### PageView
|
||||
|
||||
使用`PageView`可以实现整屏页面滚动,默认为水平方向翻页。与`ListView`类似。
|
||||
|
||||
- `pageSnapping`参数可以设置滑动时`Page`停留在任意位置。
|
||||
- `scrollDirection`参数设置滚动方向(默认为水平方向)。
|
||||
|
||||
```dart
|
||||
PageView(
|
||||
pageSnapping: false, // 取消页面固定
|
||||
scrollDirection: Axis.vertical, // 设置为垂直方向滚动
|
||||
children: [
|
||||
for (int i = 0; i < 4; i++)
|
||||
Container(
|
||||
color: Colors.red[i % 4 * 100],
|
||||
)
|
||||
],
|
||||
),
|
||||
```
|
||||
|
||||
使用`PageView.builder()`命名构造,可以动态加载页面。与`ListView.builder()`类似。
|
||||
|
||||
```dart
|
||||
PageView.builder(
|
||||
pageSnapping: false,
|
||||
scrollDirection: Axis.vertical,
|
||||
itemBuilder: (BuildContext context, int index) => Container(
|
||||
color: Colors.red[index % 4 * 100],
|
||||
),
|
||||
),
|
||||
```
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
|
37
docs/git.md
@ -395,7 +395,7 @@ $ git log --stat -M
|
||||
```bash
|
||||
$ cat ~/.ssh/config
|
||||
Host gitlab.com
|
||||
# 直接使用 shadowsocks 提供的 socks5 代理端口
|
||||
# 直接使用 sh**socks 提供的 socks5 代理端口
|
||||
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p
|
||||
|
||||
Host github.com
|
||||
@ -960,6 +960,41 @@ Host github.com
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
git 代码统计
|
||||
---
|
||||
|
||||
### 查看 git 上的个人代码量
|
||||
|
||||
- `username` 需要改成自己的
|
||||
|
||||
```bash
|
||||
git log --author="username" --pretty=tformat: --numstat | awk \
|
||||
'{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
|
||||
```
|
||||
|
||||
### 统计每个人增删行数
|
||||
|
||||
```bash
|
||||
git log --format='%aN' | sort -u |\
|
||||
while read name; do echo -en "$name\t";\
|
||||
git log --author="$name" --pretty=tformat: --numstat | awk \
|
||||
'{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
|
||||
```
|
||||
|
||||
### 查看仓库提交者排名
|
||||
|
||||
这里是排名前十,也可以更改排名
|
||||
|
||||
```bash
|
||||
git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 10
|
||||
```
|
||||
|
||||
### 提交数统计
|
||||
|
||||
```bash
|
||||
git log --oneline | wc -l
|
||||
```
|
||||
|
||||
Conventional Commmits
|
||||
----
|
||||
|
||||
|
@ -414,7 +414,7 @@ toJSON(job)
|
||||
```yml
|
||||
steps:
|
||||
...
|
||||
- name: The job has succeeded
|
||||
- name: 作业已成功
|
||||
if: ${{ success() }}
|
||||
```
|
||||
|
||||
@ -423,7 +423,7 @@ steps:
|
||||
```yml
|
||||
steps:
|
||||
...
|
||||
- name: The job has failed
|
||||
- name: 作业失败
|
||||
if: ${{ failure() }}
|
||||
```
|
||||
|
||||
@ -829,6 +829,7 @@ steps:
|
||||
[`coverage-badges-cli`](https://github.com/jaywcjlove/coverage-badges-cli) | 生成覆盖率徽章(Badges)图片
|
||||
[`action-ejs`](https://github.com/jaywcjlove/action-ejs) | 基于 ejs 生成 HTML
|
||||
[`github-action-package`](https://github.com/jaywcjlove/github-action-package) | 修改 JSON 文件内容
|
||||
[`github-action-read-file`](https://github.com/jaywcjlove/github-action-read-file) | 读取文件内容
|
||||
[`markdown-to-html-cli`](https://github.com/jaywcjlove/markdown-to-html-cli) | Markdown 转换成 HTML
|
||||
[`ncipollo/release-action`](https://github.com/ncipollo/release-action) | 创建 `Release`
|
||||
[`peaceiris/actions-gh-pages`](https://github.com/peaceiris/actions-gh-pages) | 将文件或文件夹内容提交到 `gh-pages` 分支
|
||||
|
232
docs/github.md
Normal file
@ -0,0 +1,232 @@
|
||||
Github 备忘清单
|
||||
===
|
||||
|
||||
Github.com 上 80 个键盘快捷键和一些搜索技巧的备忘清单
|
||||
|
||||
键盘快捷键
|
||||
--------
|
||||
|
||||
### 站点范围的快捷方式
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`S` | 聚焦搜索栏
|
||||
`G` `N` | 转到您的通知
|
||||
`H` | 打开并关注用户、问题或拉取请求悬浮卡
|
||||
`Esc` | 当专注于上面时,关闭 hovercard
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 资料库
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`G` `C` | 转到 `Code` 选项卡
|
||||
`G` `I` | 转到 `Issues` 选项卡
|
||||
`G` `P` | 转到拉取请求选项卡
|
||||
`G` `B` | 转到 `Projects` 选项卡
|
||||
`G` `W` | 转到 `Wiki` 选项卡
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 源代码编辑
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `F` | 开始在文件编辑器中搜索
|
||||
`Ctrl` `G` | 找下一个
|
||||
`Ctrl` `Shift` `G` | 查找上一个
|
||||
`Ctrl` `Shift` `F` | 代替
|
||||
`Ctrl` `Shift` `R` | 全部替换
|
||||
`Alt` `G` | 跳转到行
|
||||
`Ctrl` `Z` | 撤消
|
||||
`Ctrl` `Y` | 重做
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 源码浏览
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`T` | 激活文件查找器
|
||||
`L` | 跳转到代码中的一行
|
||||
`W` | 切换到新的分支或标签
|
||||
`Y` | 将 URL 扩展为其规范形式
|
||||
`I` | 显示或隐藏对差异的评论
|
||||
`B` | 打开责备视图
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 注释
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `B` | 为粗体文本插入 Markdown 格式
|
||||
`Ctrl` `I` | 插入斜体文本的 Markdown 格式
|
||||
`Ctrl` `K` | 插入 Markdown 格式以创建链接
|
||||
`Ctrl` `Shift` `P` | 在编写和预览评论选项卡之间切换
|
||||
`Ctrl` `Enter` | 提交评论
|
||||
`Ctrl` `.` | 打开已保存的回复菜单,然后使用已保存的回复自动填充评论字段
|
||||
`Ctrl` `G` | 插入一个建议
|
||||
`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-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Enter/Space` | 开始移动焦点列
|
||||
`Esc` | 取消正在进行的移动
|
||||
`Enter` | 完成正在进行的移动
|
||||
`Left/H` | 向左移动列
|
||||
`Ctrl` `Left/H` | 将列移动到最左边的位置
|
||||
`Right/L` | 向右移动列
|
||||
`Ctrl` `Right/L` | 将列移动到最右边的位置
|
||||
`Enter/Space` | 开始移动聚焦卡
|
||||
`Esc` | 取消正在进行的移动
|
||||
`Enter` | 完成正在进行的移动
|
||||
`Down/J` | 向下移动卡片
|
||||
`Ctrl` `Down/J` | 将卡片移动到列的底部
|
||||
`Up/K` | 向上移动卡片
|
||||
`Ctrl` `Up/K` | 将卡片移动到列的顶部
|
||||
`Left/H` | 将卡片移动到左侧列的底部
|
||||
`Shift` `Left/H` | 将卡片移动到左侧列的顶部
|
||||
`Ctrl` `Left/H` | 将卡片移动到最左边一列的底部
|
||||
`Ctrl` `Shift` `Left/H` | 将卡片移至最左侧列的顶部
|
||||
`Right` | 将卡片移动到右侧列的底部
|
||||
`Shift` `Right/L` | 将卡片移动到右侧列的顶部
|
||||
`Ctrl` `Right/L` | 将卡片移动到最右侧列的底部
|
||||
`Ctrl` `Shift` `Right/L` | 将卡片移至最右侧列的顶部
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 通知
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`E/L/Y` | 标记为已读
|
||||
`Shift` `M` | 静音线程
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 网络图
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Left/H` | 向左滚动
|
||||
`Right/L` | 向右滚动
|
||||
`Up/K` | 向上滑动
|
||||
`Down/J` | 向下滚动
|
||||
`Shift` `Left/H` | 一直向左滚动
|
||||
`Shift` `Right/L` | 一直向右滚动
|
||||
`Shift` `Up/K` | 一直向上滚动
|
||||
`Shift` `Down/J` | 一直向下滚动
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
搜索技巧
|
||||
---
|
||||
|
||||
### 范围搜索
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`org:rails language:ruby` | 指定组织 <pur>`rails`</pur> 和编程语言 <pur>`ruby`</pur>
|
||||
`repo:torvalds/linux io_uring` | 指定仓库 <pur>`torvalds/linux`</pur> 搜索 <pur>`io_uring`</pur>
|
||||
`owner:tpope path:*.vim` | 指定拥有者 <pur>`tpope`</pur> 和文件后缀为 <pur>`*.vim`</pur>
|
||||
`created:"> 2022-10-22" language:C#` | 创建于 <pur>`2022-10-22`</pur> 以后,语言为 <pur>`C#`</pur> 的条件
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 文件路径
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`path:__init__.py` | 文件为 <pur>`__init__.py`</pur> 里面的内容搜索
|
||||
`path:/.*shrc$/` | 文件路径包含 <pur>`.*shrc`</pur> 结尾的文件中搜索内容
|
||||
`path:/src/*.js` | <pur>`src`</pur> 目录中的 <pur>`.js`</pur> 后缀的文件中搜索内容
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 完全符合
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`out of memory` | 文本匹配 <pur>`out of memory`</pur>
|
||||
|
||||
### 布尔运算符
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`io_uring (language:c OR language:cpp)` | 语言为 <pur>`c`</pur> 或者 <pur>`cpp`</pur> 的文件中搜索 <pur>`io_uring`</pur>
|
||||
`org:kubernetes NOT repo:kubernetes/api` | 组织为 <pur>`kubernetes`</pur> 排除里面的 <pur>`api`</pur> 仓库进行搜索
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 基于仓库的条件
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`stars:100..8000 stars:>10000` | 星星为 <pur>100 ~ 8000</pur> 或 <pur>10000</pur> 以上的
|
||||
`forks:50..100 forks:200 forks:<5` | fork 为 <pur>50 ~ 100</pur> 或者 <pur>200</pur> 或者小于 <pur>5</pur>
|
||||
`size:35` | 大小为 `35kb`
|
||||
`pushed:<2022-11-23` | 推送代码时间 <pur>2022-11-23</pur> 之前
|
||||
`fork:true`, `fork:only` |
|
||||
`license:mit` | 基于协议 <pur>`mit`</pur> 条件
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 基于 issue 的条件
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`state:open`, `state:closed` | <pur>`关闭`</pur> / <pur>`打开`</pur> 的 `issue`
|
||||
`reason:completed` | <pur>`"not planned"`</pur>, <pur>`reopened`</pur>, <pur>`completed`</pur>
|
||||
`label:bug` | 标签为 `bug` 的条件
|
||||
`author:jaywcjlove` | 作者 <pur>`jaywcjlove`</pur> 打开
|
||||
`mentions:jaywcjlove` | 提及 <pur>`jaywcjlove`</pur> 用户
|
||||
`assignee:jaywcjlove` | 分配给 <pur>`jaywcjlove`</pur> 用户
|
||||
`updated:<2022-11-23` | 更新日期之前
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
### 基于用户的条件
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`fullname:jaywcjlove` | 全名 <pur>jaywcjlove</pur>
|
||||
`location:China` | 位置 <pur>China</pur>
|
||||
`followers:20..50 followers:>200 followers:<2` | 追随者
|
||||
`repos:0 repos:<40 repos:>5` | 仓库数量
|
||||
<!--rehype:className=style-list-->
|
||||
|
||||
另见
|
||||
-----
|
||||
|
||||
- [Keyboard shortcuts for Github](https://help.github.com/articles/using-keyboard-shortcuts/) _(help.github.com)_
|
126
docs/gitlab.md
Normal file
@ -0,0 +1,126 @@
|
||||
GitLab 键盘快捷键 备忘清单
|
||||
===
|
||||
|
||||
GitLab 中 58 个键盘快捷键的可视化备忘单
|
||||
|
||||
键盘快捷键
|
||||
---------
|
||||
|
||||
### 全局的
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`?` | 显示或隐藏快捷方式参考表
|
||||
`Shift` `P` | 转到您的项目页面
|
||||
`Shift` `G` | 转到您的群组页面
|
||||
`Shift` `A` | 前往您的活动页面
|
||||
`Shift` `L` | 转到您的里程碑页面
|
||||
`Shift` `S` | 转到您的摘要页面
|
||||
`S` | 将光标放在问题或合并请求搜索中
|
||||
`Shift` `I` | 转到您的问题页面
|
||||
`Shift` `T` | 转到您的合并请求页面
|
||||
`P` `B` | 显示或隐藏性能栏
|
||||
`Up` | 编辑您的最后一条评论,您必须在主题下方的空白文本字段中
|
||||
`Ctrl` `Shift` `P` | 在文本字段中编辑文本时切换降价预览
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 项目
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`G` `P` | 进入项目主页
|
||||
`G` `V` | 转到项目活动提要
|
||||
`G` `R` | 转到项目发布列表
|
||||
`G` `F` | 转到项目文件列表
|
||||
`T` | 进入项目文件搜索页面
|
||||
`G` `C` | 转到项目提交列表
|
||||
`G` `N` | 转到存储库图页面
|
||||
`G` `D` | 转到存储库图表
|
||||
`G` `I` | 转到项目问题列表
|
||||
`I` | 转到新问题页面
|
||||
`G` `B` | 转到项目问题板列表
|
||||
`G` `M` | 转到项目合并请求列表
|
||||
`G` `J` | 转到 CI/CD 作业列表
|
||||
`G` `L` | 转到项目指标
|
||||
`G` `E` | 转到项目环境
|
||||
`G` `K` | 进入项目Kubernetes集群集成页面
|
||||
`G` `S` | 转到项目片段列表
|
||||
`G` `W` | 转到项目 wiki,如果启用
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 问题和合并请求
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`E` | 编辑说明
|
||||
`A` | 变更受让人
|
||||
`M` | 改变里程碑
|
||||
`L` | 更改标签
|
||||
`R` | 开始写评论,如果选择了任何文本,它将被引用
|
||||
`N` | 移至下一个未解决的讨论,仅合并请求
|
||||
`P` | 移至先前未解决的讨论,仅合并请求
|
||||
`]` | 移动到下一个文件,仅合并请求
|
||||
`[` | 移动到上一个文件,仅合并请求
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 项目文件
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Up` | 向上移动选择
|
||||
`Down` | 向下移动选择
|
||||
`Enter` | 开放选择
|
||||
`Esc` | 返回文件列表屏幕,仅在搜索文件时
|
||||
`Y` | 仅在查看文件时转到文件永久链接
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 网络集成开发环境
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `P` | 搜索并打开另一个文件进行编辑
|
||||
`Ctrl` `Enter` | 提交,在编辑提交消息时
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 存储库
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Left` | 向左滚动
|
||||
`Right` | 向右滚动
|
||||
`Up` | 向上滑动
|
||||
`Down` | 向下滚动
|
||||
`Shift` `Up` | 滚动到顶部
|
||||
`Shift` `Down` | 滚动到底部
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 维基页面
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`E` | 编辑维基页面
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 过滤搜索
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Backspace` | 清除整个搜索过滤器
|
||||
`Alt` `Backspace` | 一次清除一个标记
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 史诗
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`R` | 开始写评论,如果选择了任何文本,它将被引用
|
||||
`E` | 编辑说明
|
||||
`L` | 更改标签
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
- [Keyboard shortcuts for GitLab](https://docs.gitlab.com/ee/user/shortcuts.html) _(docs.gitlab.com)_
|
@ -70,7 +70,7 @@ func say(message string) {
|
||||
多行注释 */
|
||||
```
|
||||
|
||||
### 如果语句
|
||||
### if 语句
|
||||
|
||||
```go
|
||||
if true {
|
||||
@ -431,7 +431,7 @@ for {
|
||||
}
|
||||
```
|
||||
|
||||
Golang 结构和映射
|
||||
Golang 结构和Maps
|
||||
--------
|
||||
|
||||
### 定义
|
||||
@ -467,7 +467,7 @@ v := Vertex{X: 1}
|
||||
|
||||
您还可以输入字段名
|
||||
|
||||
### 映射
|
||||
### Maps
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```go
|
||||
@ -511,7 +511,7 @@ fmt.Println(plus(1, 2))
|
||||
fmt.Println(plusPlus(1, 2, 3))
|
||||
```
|
||||
|
||||
### 多次返回
|
||||
### 多返回值
|
||||
|
||||
```go
|
||||
func vals() (int, int) {
|
||||
@ -533,7 +533,7 @@ r1, r2 := func() (string, string) {
|
||||
fmt.Println(r1, r2)
|
||||
```
|
||||
|
||||
### 命名返回
|
||||
### 命名返回值
|
||||
|
||||
```go
|
||||
func split(sum int) (x, y int) {
|
||||
@ -546,7 +546,7 @@ fmt.Println(x) // => 7
|
||||
fmt.Println(y) // => 10
|
||||
```
|
||||
|
||||
### 变量函数
|
||||
### 可变参数函数
|
||||
|
||||
```go
|
||||
func sum(nums ...int) {
|
||||
@ -557,7 +557,7 @@ func sum(nums ...int) {
|
||||
}
|
||||
fmt.Println(total)
|
||||
}
|
||||
sum(1, 2) //=> [1 2] 3
|
||||
sum(1, 2) // => [1 2] 3
|
||||
sum(1, 2, 3) // => [1 2 3] 6
|
||||
nums := []int{1, 2, 3, 4}
|
||||
sum(nums...) // => [1 2 3 4] 10
|
||||
@ -987,7 +987,7 @@ Go 命令
|
||||
`GOOS` | 编译系统
|
||||
`GOARCH` | 编译arch
|
||||
`GO111MODULE` | gomod开关
|
||||
`GOPROXY` | go代理 <https://goproxy.io> <https://goproxy.cn>
|
||||
`GOPROXY` | go代理 <https://goproxy.io> <https://goproxy.cn> <https://mirrors.aliyun.com/goproxy/>
|
||||
`GOSSAFUNC` | 生成 `SSA.html` 文件,展示代码优化的每一步 `GOSSAFUNC=func_name go build`
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
|
212
docs/google-chrome.md
Normal file
@ -0,0 +1,212 @@
|
||||
Google Chrome 键盘快捷键备忘清单
|
||||
===
|
||||
|
||||
谷歌浏览器中 65 个键盘快捷键和 Chrome 开发者工具中 56 个键盘快捷键的可视化备忘单
|
||||
|
||||
谷歌浏览器键盘快捷键
|
||||
---------
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 选项卡和窗口
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `N` | 打开一个新窗口
|
||||
`Ctrl` `Shift` `N` | 以隐身模式打开新窗口
|
||||
`Ctrl` `T` | 打开一个新标签,然后跳转到它
|
||||
`Ctrl` `Shift` `T` | 重新打开上次关闭的选项卡,并跳转到它
|
||||
`Ctrl` `Tab` | 跳转到下一个打开的标签页
|
||||
`Ctrl` `Shift` `Tab` | 跳转到上一个打开的标签页
|
||||
`Ctrl` `1-8` | 跳转到特定选项卡
|
||||
`Ctrl` `9` | 跳转到最后一个标签
|
||||
`Alt` `Home` | 在当前选项卡中打开您的主页
|
||||
`Alt` `Left` | 在当前选项卡中打开历史记录中的上一页
|
||||
`Alt` `Right` | 在当前选项卡中打开历史记录的下一页
|
||||
`Ctrl` `W` | 关闭当前标签
|
||||
`Ctrl` `Shift` `W` | 关闭当前窗口
|
||||
`Alt` `Space` `N` | 最小化当前窗口
|
||||
`Alt` `Space` `X` | 最大化当前窗口
|
||||
`Alt` `F4` | 关闭当前窗口
|
||||
`Ctrl` `Shift` `Q` | 相当谷歌浏览器
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 谷歌浏览器功能
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Alt` `F` | 打开 Chrome 菜单
|
||||
`Ctrl` `Shift` `B` | 显示或隐藏书签栏
|
||||
`Ctrl` `Shift` `O` | 打开书签管理器
|
||||
`Ctrl` `H` | 在新标签页中打开历史记录页面
|
||||
`Ctrl` `J` | 在新标签页中打开下载页面
|
||||
`Shift` `Esc` | 打开 Chrome 任务管理器
|
||||
`Shift` `Alt` `T` | 将焦点置于 Chrome 工具栏中的第一项
|
||||
`F10` | 将焦点置于 Chrome 工具栏中的最后一项
|
||||
`F6` | 将焦点切换到未聚焦的对话框(如果显示)
|
||||
`Ctrl` `F` | 打开查找栏以搜索当前页面
|
||||
`Ctrl` `G` | 跳转到查找栏搜索的下一个匹配项
|
||||
`Ctrl` `Shift` `G` | 跳转到查找栏搜索的上一个匹配项
|
||||
`F12` | 打开开发者工具
|
||||
`Ctrl` `Shift` `Delete` | 打开清除浏览数据选项
|
||||
`F1` | 在新标签页中打开 Chrome 帮助中心
|
||||
`Ctrl` `Shift` `M` | 登录不同的用户或以访客身份浏览
|
||||
`Alt` `Shift` `I` | 打开反馈表
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 地址栏
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`(type)` `Enter` | 使用您的默认搜索引擎进行搜索
|
||||
`(type)` `Tab` | 使用不同的搜索引擎搜索
|
||||
`Ctrl` `Enter` | 添加 www. 和 .com 到站点名称,并在当前选项卡中打开
|
||||
`Alt` `Enter` | 打开新标签页并执行 Google 搜索
|
||||
`Ctrl` `L` | 跳转到地址栏
|
||||
`Ctrl` `K` | 从页面上的任何位置搜索
|
||||
`Shift` `Delete` | 从地址栏中删除预测
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 网页快捷方式
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `P` | 打开选项以打印当前页面
|
||||
`Ctrl` `S` | 打开选项以保存当前页面
|
||||
`Ctrl` `R` | 重新加载当前页面
|
||||
`Ctrl` `Shift` `R` | 重新加载当前页面,忽略缓存内容
|
||||
`Esc` | 停止页面加载
|
||||
`Tab` | 向前浏览可点击的项目
|
||||
`Shift` `Tab` | 浏览向后移动的可点击项目
|
||||
`Ctrl` `O` | 在 Chrome 中打开计算机中的文件
|
||||
`Ctrl` `U` | 显示当前页面不可编辑的 HTML 源代码
|
||||
`Ctrl` `D` | 将当前网页保存为书签
|
||||
`Ctrl` `Shift` `D` | 将所有打开的标签保存为新文件夹中的书签
|
||||
`F11` | 打开或关闭全屏模式
|
||||
`Ctrl` `+` | 使页面上的所有内容变大
|
||||
`Ctrl` `-` | 缩小页面上的所有内容
|
||||
`Ctrl` `0` | 将页面上的所有内容恢复为默认大小
|
||||
`Space` | 向下滚动网页,一次滚动一个屏幕
|
||||
`Shift` `Space` | 向上滚动网页,一次滚动一个屏幕
|
||||
`Home` | 转到页面的顶部
|
||||
`End` | 转到页面底部
|
||||
`Shift` `(scroll mouse)` | 在页面上水平滚动
|
||||
`Ctrl` `Left` | 将光标移动到文本字段中上一个单词的前面
|
||||
`Ctrl` `Right` | 将光标移动到文本字段中下一个单词的后面
|
||||
`Ctrl` `Backspace` | 删除文本字段中的前一个词
|
||||
`Alt` `Home` | 在当前选项卡中打开主页
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
Chrome 开发者工具键盘快捷键
|
||||
---
|
||||
|
||||
### 打开 DevTools
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Shift` `I` | 打开您上次使用的任何面板
|
||||
`Ctrl` `Shift` `J` | 打开控制台面板
|
||||
`Ctrl` `Shift` `C` | 打开元素面板
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 全局快捷方式
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`F1` | 显示设置
|
||||
`Ctrl` `]` | 聚焦下一个面板
|
||||
`Ctrl` `[` | 聚焦上一个面板
|
||||
`Ctrl` `Shift` `D` | 切换回您上次使用的任何对接位置
|
||||
`Ctrl` `Shift` `M` | 切换设备模式
|
||||
`Ctrl` `Shift` `C` | 切换检查元素模式
|
||||
`Ctrl` `Shift` `P` | 打开命令菜单
|
||||
`Esc` | 切换抽屉
|
||||
`Ctrl` `R` | 正常装填
|
||||
`Ctrl` `Shift` `R` | 硬重载
|
||||
`Ctrl` `F` | 在当前面板中搜索文本
|
||||
`Ctrl` `Shift` `F` | 在抽屉中打开“搜索”选项卡
|
||||
`Ctrl` `P` | 在源面板中打开文件
|
||||
`Ctrl` `Shift` `+` | 放大
|
||||
`Ctrl` `-` | 缩小
|
||||
`Ctrl` `0` | 恢复默认缩放级别
|
||||
`Ctrl` `O` `!` | 运行片段
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 元素面板
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Z` | 撤消更改
|
||||
`Ctrl` `Y` | 重做更改
|
||||
`Up/Down` | 选择当前所选元素上方或下方的元素
|
||||
`Right` | 展开当前选中的节点
|
||||
`Left` | 折叠当前选中的节点
|
||||
`Enter` | 在当前选定的元素上切换编辑属性模式
|
||||
`Tab` | 进入编辑属性模式后选择下一个属性
|
||||
`Shift` `Tab` | 进入编辑属性模式后选择上一个属性
|
||||
`H` | 隐藏当前选中的元素
|
||||
`F2` | 在当前选定的元素上切换编辑为 HTML 模式
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 资源面板
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `\` | 暂停脚本执行(如果正在运行)或恢复(如果暂停)
|
||||
`Ctrl` `'` | 跳过下一个函数调用
|
||||
`Ctrl` `;` | 进入下一个函数调用
|
||||
`Ctrl` `Shift` `;` | 跳出当前函数
|
||||
`Ctrl` `./,` | 选择当前所选帧下方或上方的调用帧
|
||||
`Ctrl` `S` | 将更改保存到本地修改
|
||||
`Ctrl` `Alt` `S` | 保存所有更改
|
||||
`Ctrl` `G` | 去线
|
||||
`Alt` `W` | 关闭活动标签
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 代码编辑器
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `Del` | 删除最后一个单词中的所有字符,直到光标
|
||||
`Ctrl` `M` | 转到匹配的括号
|
||||
`Ctrl` `/` | 切换单行注释
|
||||
`Ctrl` `D` | 选择光标所在的任何单词的下一个匹配项
|
||||
`Ctrl` `U` | 取消选择光标所在的任何单词的下一个匹配项
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 性能面板
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `E` | 开始或停止录制
|
||||
`Ctrl` `S` | 保存录音
|
||||
`Ctrl` `O` | 载入录音
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 内存面板
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `E` | 开始或停止录制
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 控制台面板
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Tab` | 接受自动完成建议
|
||||
`Esc` | 拒绝自动完成建议
|
||||
`Up` | 获取之前的语句
|
||||
`Down` | 获取下一条语句
|
||||
`Ctrl` <code>\`</code> | 聚焦控制台
|
||||
`Ctrl` `L` | 清除控制台
|
||||
`Shift` `Enter` | 强制多行输入
|
||||
`Enter` | 执行
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
- [Keyboard shortcuts for Google Chrome](https://support.google.com/chrome/answer/157179?hl=en) _(support.google.com)_
|
328
docs/htmx.md
Normal file
@ -0,0 +1,328 @@
|
||||
\</> htmx 备忘清单
|
||||
===
|
||||
|
||||
[](https://npmjs.org/package/htmx.org)
|
||||
[](https://www.npmjs.com/package/htmx.org)
|
||||
[](https://github.com/bigskysoftware/htmx/network/dependents)
|
||||
[](https://github.com/bigskysoftware/htmx)
|
||||
|
||||
适合初学者的综合 [htmx](https://htmx.org/) 备忘清单
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 快速开始
|
||||
|
||||
[htmx](https://htmx.org/) 是 [intercooler.js](http://intercoolerjs.org/) 的继承者
|
||||
|
||||
```html
|
||||
<script
|
||||
src="https://unpkg.com/htmx.org@1.8.4"
|
||||
>
|
||||
</script>
|
||||
<!-- 有一个按钮POST,通过AJAX点击 -->
|
||||
<button
|
||||
hx-post="/clicked"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
点击我
|
||||
</button>
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
`hx-post` 和 `hx-swap` 属性告诉 `htmx`:
|
||||
|
||||
> 当用户单击此按钮时,向 `/clicked` 发出 `AJAX` 请求,并用响应替换整个按钮
|
||||
|
||||
```bash
|
||||
$ npm install htmx.org
|
||||
```
|
||||
|
||||
安装 `htmx` 将导入添加到您的 `index.js`
|
||||
|
||||
```js
|
||||
import 'htmx.org';
|
||||
```
|
||||
|
||||
### 点击编辑提交
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
有一个按钮,可以从 `/contacts/1/edit` 获取联系人的编辑 UI
|
||||
|
||||
```html
|
||||
<div hx-target="this" hx-swap="outerHTML">
|
||||
<div><label>名字</label>: Joe</div>
|
||||
<div><label>姓</label>: Blow</div>
|
||||
<div><label>邮箱</label>: joe@blow.com</div>
|
||||
<button hx-get="/contact/1/edit" class="btn btn-primary">
|
||||
点击编辑
|
||||
</button>
|
||||
</div>
|
||||
```
|
||||
|
||||
这将返回一个可用于编辑联系人的表单
|
||||
|
||||
```html
|
||||
<form hx-put="/contact/1" hx-target="this" hx-swap="outerHTML">
|
||||
<div>
|
||||
<label>名字</label>
|
||||
<input type="text" name="firstName" value="Joe">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>姓</label>
|
||||
<input type="text" name="lastName" value="Blow">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>邮箱</label>
|
||||
<input type="email" name="email" value="joe@blow.com">
|
||||
</div>
|
||||
<button class="btn">提交</button>
|
||||
<button class="btn" hx-get="/contact/1">取消</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
表单按照通常的 `REST-ful` 模式将 `PUT` 发回 `/contacts/1`
|
||||
|
||||
### 删除行
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
```html
|
||||
<table class="table delete-row-example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th> <th>Email</th> <th>Status</th> <th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody hx-confirm="Are you sure?" hx-target="closest tr" hx-swap="outerHTML swap:1s">
|
||||
...
|
||||
</tbody>
|
||||
</table>
|
||||
```
|
||||
|
||||
表体有一个 `hx-confirm` 属性来确认删除动作。 它还将所有按钮的目标设置为最近的 `tr`,即最近的表格行(`hx-target` 继承自 DOM 中的父级)`hx-swap` 中的交换规范表示将整个目标换出并收到响应后等待 1 秒。最后一点是为了让我们可以使用以下 CSS:
|
||||
|
||||
```css
|
||||
tr.htmx-swapping td {
|
||||
opacity: 0;
|
||||
transition: opacity 1s ease-out;
|
||||
}
|
||||
```
|
||||
|
||||
在交换/删除之前淡出该行。每行都有一个带有 `hx-delete` 属性的按钮,该属性包含发出 `DELETE` 请求以从服务器中删除该行的 `url`。此请求以空内容响应,表明该行应替换为空内容
|
||||
|
||||
```html
|
||||
<tr>
|
||||
<td>Angie MacDowell</td>
|
||||
<td>angie@macdowell.org</td>
|
||||
<td>Active</td>
|
||||
<td>
|
||||
<button class="btn btn-danger" hx-delete="/contact/1">
|
||||
Delete
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
```
|
||||
|
||||
### 延迟加载
|
||||
|
||||
```html
|
||||
<div hx-get="/graph" hx-trigger="load">
|
||||
<img
|
||||
alt="正在加载中..."
|
||||
class="htmx-indicator"
|
||||
width="150"
|
||||
src="/img/bars.svg"/>
|
||||
</div>
|
||||
```
|
||||
|
||||
当我们加载图表时显示进度指示器。 然后通过稳定的 CSS(`htmx-settling`) 过渡加载图形并逐渐淡入视图
|
||||
|
||||
```css
|
||||
.htmx-settling img {
|
||||
opacity: 0;
|
||||
}
|
||||
img {
|
||||
transition: opacity 300ms ease-in;
|
||||
}
|
||||
```
|
||||
|
||||
### hx-swap
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`innerHTML` | 默认,替换目标元素的内部 `html`
|
||||
`outerHTML` | 用响应替换整个目标元素
|
||||
`beforebegin` | 在目标元素之前插入响应
|
||||
`afterbegin` | 目标元素的第一个子元素之前插入响应
|
||||
`beforeend` | 目标元素的最后一个子元素之后插入响应
|
||||
`afterend` | 在目标元素之后插入响应
|
||||
`delete` | 无论响应如何,都删除目标元素
|
||||
`none` | 不附加来自响应的内容 <br />_(带外项目仍将被处理)_
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
API 参考
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 核心属性参考
|
||||
|
||||
属性 | 说明
|
||||
:- | --
|
||||
`hx-boost` | 添加或删除链接和表单的[渐进增强](https://en.wikipedia.org/wiki/Progressive_enhancement)
|
||||
`hx-get` | 向指定的 URL 发出 `GET`
|
||||
`hx-post` | 向指定的 URL 发出 `POST`
|
||||
`hx-push-url` | 将 URL 推入浏览器地址栏,创建一个新的历史条目
|
||||
`hx-select` | 从响应中选择要换入的内容
|
||||
`hx-select-oob` | 从带外(目标以外的某个地方)的响应中选择要换入的内容
|
||||
`hx-swap` | 控制内容的交换方式(`outerHTML`、`beforeEnd`、`afterend`,...)
|
||||
`hx-swap-oob` | 将响应中的内容标记为带外(应该在目标以外的地方交换)
|
||||
`hx-target` | 指定要交换的目标元素
|
||||
`hx-trigger` | 指定触发请求的事件
|
||||
`hx-vals` | 向参数添加值以随请求一起提交(JSON 格式)
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
使用 htmx 时最常用的属性
|
||||
|
||||
### 附加属性参考
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
属性 | 说明
|
||||
:- | --
|
||||
`hx-confirm` | 在发出请求之前显示一个 `confim()` 对话框
|
||||
`hx-delete` | 向指定的 URL 发出 `DELETE`
|
||||
`hx-disable` | 禁用给定节点和任何子节点的 htmx 处理
|
||||
`hx-disinherit` | 控制和禁用子节点的自动属性继承
|
||||
`hx-encoding` | 更改请求编码类型
|
||||
`hx-ext` | 用于此元素的扩展
|
||||
`hx-headers` | 添加到将与请求一起提交的标头
|
||||
`hx-history-elt` | 在历史导航期间要快照和恢复的元素
|
||||
`hx-include` | 在请求中包含额外数据
|
||||
`hx-indicator` | 在请求期间放置 `htmx-request` 类的元素
|
||||
`hx-params` | 过滤将与请求一起提交的参数
|
||||
`hx-patch` | 向指定的 URL 发出 PATCH
|
||||
`hx-preserve` | 指定在请求之间保持不变的元素
|
||||
`hx-prompt` | 在提交请求之前显示一个 `prompt()`
|
||||
`hx-put` | 向指定的 URL 发出 PUT
|
||||
`hx-replace-url` | 替换浏览器地址栏中的 URL
|
||||
`hx-request` | 配置请求的各个方面
|
||||
`hx-sse` | 已移至分机。 [旧版本的文档](https://htmx.org/attributes/hx-sse)
|
||||
`hx-sync` | 控制不同元素发出的请求如何同步
|
||||
`hx-validate` | 强制元素在请求之前验证自己
|
||||
~~`hx-vars`~~ | 将值动态添加到参数以随请求提交(已弃用,请使用 `hx-vals`)
|
||||
`hx-ws` | 已移至分机。[旧版本的文档](https://htmx.org/attributes/hx-ws)
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
列出了 htmx 中可用的所有其他属性
|
||||
|
||||
### CSS 类参考
|
||||
|
||||
Class | 说明
|
||||
:- | --
|
||||
`htmx-added` | 在交换之前应用于新的内容,在它被解决之后移除
|
||||
`htmx-indicator` | 一个动态生成的类,当存在 `htmx-request` 类时将切换可见<br /> _(不透明度:`1`)_
|
||||
`htmx-request` | 在请求进行时应用于元素或使用 `hx-indicator` 指定的元素
|
||||
`htmx-settling` | 内容交换后应用于目标,内容确定后删除。<br /> _可以通过 `hx-swap` 修改持续时间_
|
||||
`htmx-swapping` | 在交换任何内容之前应用于目标,在交换之后移除。<br /> _可以通过 `hx-swap` 修改持续时间_
|
||||
|
||||
### 事件参考
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
事件 | 说明
|
||||
:- | --
|
||||
`htmx:abort` | 将此事件发送到元素以中止请求
|
||||
`htmx:afterOnLoad` | AJAX 请求完成处理成功响应后触发
|
||||
`htmx:afterProcessNode` | 在 htmx 初始化节点后触发
|
||||
`htmx:afterRequest` | AJAX 请求完成后触发
|
||||
`htmx:afterSettle` | DOM 稳定后触发
|
||||
`htmx:afterSwap` | 换入新内容后触发
|
||||
`htmx:beforeOnLoad` | 在任何响应处理发生之前触发
|
||||
`htmx:beforeProcessNode` | 在 htmx 初始化节点之前触发
|
||||
`htmx:beforeRequest` | 在发出 AJAX 请求之前触发
|
||||
`htmx:beforeSwap` | 在交换完成之前触发,允许您配置交换
|
||||
`htmx:beforeSend` | 在发送 ajax 请求之前触发
|
||||
`htmx:configRequest` | 在请求之前触发,允许您自定义参数、标头
|
||||
`htmx:confirm` | 在元素上发生触发器后触发<br /> _允许您取消(或延迟)发出 AJAX 请求_
|
||||
`htmx:historyCacheError` | 在缓存写入期间因错误而触发
|
||||
`htmx:historyCacheMiss` | 在历史子系统中的缓存未命中时触发
|
||||
`htmx:historyCacheMissError` | 远程检索不成功时触发
|
||||
`htmx:historyCacheMissLoad` | 在成功的远程检索时触发
|
||||
`htmx:historyRestore` | 当 htmx 处理历史恢复操作时触发
|
||||
`htmx:beforeHistorySave` | 在内容保存到历史缓存之前触发
|
||||
`htmx:load` | 当新内容添加到 DOM 时触发
|
||||
`htmx:noSSESourceError` | 当元素在其触发器中引用 SSE 事件<br/> _但未定义父 SSE 源时触发_
|
||||
`htmx:onLoadError` | htmx中onLoad处理异常时触发
|
||||
`htmx:oobAfterSwap` | 在交换了一个带元素之后触发
|
||||
`htmx:oobBeforeSwap` | 在带外元素交换完成之前触发,允许您配置交换
|
||||
`htmx:oobErrorNoTarget` | 当带外元素在当前 DOM 中没有匹配的 ID 时触发
|
||||
`htmx:prompt` | 显示提示后触发
|
||||
`htmx:pushedIntoHistory` | 在 url 被推送到历史记录后触发
|
||||
`htmx:responseError` | 当发生 HTTP 响应错误<br/> _(非 200 或 300 响应代码)时触发_
|
||||
`htmx:sendError` | 当网络错误阻止 HTTP 请求发生时触发
|
||||
`htmx:sseError` | 当 SSE 源发生错误时触发
|
||||
`htmx:swapError` | 在交换阶段发生错误时触发
|
||||
`htmx:targetError` | 指定无效目标时触发
|
||||
`htmx:timeout` | 发生请求超时时触发
|
||||
`htmx:validation:validate` | 在验证元素之前触发
|
||||
`htmx:validation:failed` | 当元素验证失败时触发
|
||||
`htmx:validation:halted` | 当请求由于验证错误而停止时触发
|
||||
`htmx:xhr:abort` | 当 `ajax` 请求中止时触发
|
||||
`htmx:xhr:loadend` | `ajax` 请求结束时触发
|
||||
`htmx:xhr:loadstart` | `ajax` 请求开始时触发
|
||||
`htmx:xhr:progress` | 在支持进度事件的 `ajax` 请求期间定期触发
|
||||
|
||||
### JavaScript API 参考
|
||||
|
||||
方法 | 说明
|
||||
:- | --
|
||||
`htmx.addClass()` | 向给定元素添加一个类
|
||||
`htmx.ajax()` | 发出一个 htmx 风格的 ajax 请求
|
||||
`htmx.closest()` | 找到与选择器匹配的给定元素的最近父级
|
||||
`htmx.config` | 保存当前 htmx 配置对象的属性
|
||||
`htmx.createEventSource` | 包含为 htmx 创建 SSE EventSource 对象的函数的属性
|
||||
`htmx.createWebSocket` | 包含为 htmx 创建 WebSocket 对象的函数的属性
|
||||
`htmx.defineExtension()` | 定义一个 htmx 扩展
|
||||
`htmx.find()` | 查找与选择器匹配的单个元素
|
||||
`htmx.findAll()` \| `htmx.findAll(elt, selector)` | 查找与给定选择器匹配的所有元素
|
||||
`htmx.logAll()` | 安装将记录所有 htmx 事件的记录器
|
||||
`htmx.logger` | 设置为当前记录器的属性(默认为空)
|
||||
`htmx.off()` | 从给定元素中删除事件侦听器
|
||||
`htmx.on()` | 在给定元素上创建事件侦听器,并返回它
|
||||
`htmx.onLoad()` | 为 htmx:load 事件添加回调处理程序
|
||||
`htmx.parseInterval()` | 将间隔声明解析为毫秒值
|
||||
`htmx.process()` | 处理给定元素及其子元素,连接任何 htmx 行为
|
||||
`htmx.remove()` | 删除给定的元素
|
||||
`htmx.removeClass()` | 从给定元素中删除一个类
|
||||
`htmx.removeExtension()` | 删除一个 htmx 扩展
|
||||
`htmx.takeClass()` | 从给定元素的其他元素中获取一个类
|
||||
`htmx.toggleClass()` | 从给定元素切换一个类
|
||||
`htmx.trigger()` | 在元素上触发事件
|
||||
`htmx.values()` | 返回与给定元素关联的输入值
|
||||
|
||||
### 请求标头参考
|
||||
|
||||
标头 | 说明
|
||||
:- | --
|
||||
`HX-Boosted` | 表示请求是通过使用 `hx-boost` 的元素发出的
|
||||
`HX-Current-URL` | 浏览器的当前 `URL`
|
||||
`HX-History-Restore-Request` | 如果请求是在本地历史缓存未命中后进行历史恢复,则为 `true`
|
||||
`HX-Prompt` | 用户对 `hx` 提示的响应
|
||||
`HX-Request` | 总是 `true`
|
||||
`HX-Target` | 目标元素的 id(如果存在)
|
||||
`HX-Trigger-Name` | 触发元素的名称(如果存在)
|
||||
`HX-Trigger` | 触发元素的 id(如果存在)
|
||||
|
||||
### 响应标头参考
|
||||
|
||||
标头 | 说明
|
||||
:- | --
|
||||
[`HX-Location`](https://htmx.org/headers/hx-location) | 允许您执行不执行整页重新加载的客户端重定向
|
||||
[`HX-Push-Url`](https://htmx.org/headers/hx-push-url) | 将一个新的 `url` 推入历史堆栈
|
||||
`HX-Redirect` | 可用于将客户端重定向到新位置
|
||||
`HX-Refresh` | 如果设置为 `true`,客户端将完全刷新页面
|
||||
[`HX-Replace-Url`](https://htmx.org/headers/hx-replace-url) | 替换地址栏中的当前 `URL`
|
||||
`HX-Reswap` | 允许您指定如何交换响应<br /> _有关可能的值,请参阅 [`hx-swap`](https://htmx.org/attributes/hx-swap)_
|
||||
`HX-Retarget` | 将内容更新的目标更新为页面上不同元素的 CSS 选择器
|
||||
[`HX-Trigger`](https://htmx.org/headers/hx-trigger) | 允许您触发客户端事件<br /> _请[参阅文档](https://htmx.org/headers/hx-trigger)以获取更多信息_
|
||||
[`HX-Trigger-After-Settle`](https://htmx.org/headers/hx-trigger) | 允许您触发客户端事件<br /> _请[参阅文档](https://htmx.org/headers/hx-trigger)以获取更多信息_
|
||||
[`HX-Trigger-After-Swap`](https://htmx.org/headers/hx-trigger) | 允许您触发客户端事件<br /> _请[参阅文档](https://htmx.org/headers/hx-trigger)以获取更多信息_
|
195
docs/intelli-j-idea.md
Normal file
@ -0,0 +1,195 @@
|
||||
IntelliJ IDEA 键盘快捷键
|
||||
===
|
||||
|
||||
IntelliJ IDEA 是一款非常优秀的 Java IDE,它的大部分命令都有快捷键,让你的手不离开键盘
|
||||
|
||||
IDEA Windows 和 Linux 键盘映射
|
||||
---
|
||||
|
||||
### 编辑
|
||||
<!--rehype:wrap-class=row-span-5-->
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Ctrl` `Space`| 基本代码完成
|
||||
`Ctrl` `Shift` `Space`| 智能代码完成
|
||||
`Ctrl` `Shift` `Enter`| 完整声明
|
||||
`Ctrl` `P`| 参数信息
|
||||
`Ctrl` `Q`| 快速文档查找
|
||||
`Shift` `F1`| 外部文档
|
||||
`Ctrl` `hover`| 简介
|
||||
`Ctrl` `F1`| 插入符号处的错误或警告
|
||||
`Alt` `Insert`| 生成代码
|
||||
`Ctrl` `O`| 覆盖方法
|
||||
`Ctrl` `I`| 实现方法
|
||||
`Ctrl` `Alt` `T`| 环绕着
|
||||
`Ctrl` `/`| 注释或取消注释行
|
||||
`Ctrl` `Shift` `/`| 评论或取消评论块
|
||||
`Ctrl` `W`| 选择连续递增的代码块
|
||||
`Ctrl` `Shift` `W`| 将当前选择减少到以前的状态
|
||||
`Alt` `Q`| 上下文信息
|
||||
`Alt` `Enter`| 显示意图操作和快速修复
|
||||
`Ctrl` `Alt` `L`| 重新格式化代码
|
||||
`Ctrl` `Alt` `O`| 优化导入
|
||||
`Ctrl` `Alt` `I`| 自动缩进行
|
||||
`Tab`| 缩进所选行
|
||||
`Shift` `Tab`| 取消缩进所选行
|
||||
`Ctrl` `X`| 将当前行或选定的块剪切到剪贴板
|
||||
`Ctrl` `C`| 将当前行或选定的块复制到剪贴板
|
||||
`Ctrl` `V`| 从剪贴板粘贴
|
||||
`Ctrl` `Shift` `V`| 从最近的缓冲区粘贴
|
||||
`Ctrl` `D`| 复制当前行或选定的块
|
||||
`Ctrl` `Y`| 删除插入符处的行
|
||||
`Ctrl` `Shift` `J`| 智能线路加入
|
||||
`Ctrl` `Enter`| 智能分线
|
||||
`Shift` `Enter`| 开始新行
|
||||
`Ctrl` `Shift` `U`| 在插入符号或选定块处切换单词的大小写
|
||||
`Ctrl` `Shift` `]` _/_ `[`| 选择直到代码块结束/开始
|
||||
`Ctrl` `Backspace`| 删除到词尾/开头
|
||||
`Ctrl` `+` _/_ `-`| 展开/折叠代码块
|
||||
`Ctrl` `Shift` `+`| 展开全部
|
||||
`Ctrl` `Shift` `-`| 全部收缩
|
||||
`Ctrl` `F4`| 关闭活动编辑器选项卡
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 使用搜索
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Alt` `F7` _/_ `Ctrl` `F7`| 查找用法/在文件中查找用法
|
||||
`Ctrl` `Shift` `F7`| 突出显示文件中的用法
|
||||
`Ctrl` `Alt` `F7`| 显示用法
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 导航
|
||||
<!--rehype:wrap-class=row-span-4-->
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Ctrl` `N`| 去 class
|
||||
`Ctrl` `Shift` `N`| 转到文件
|
||||
`Ctrl` `Alt` `Shift` `N`| 转到符号
|
||||
`Alt` `Right` _/_ `Left`| 转到下一个/上一个编辑器选项卡
|
||||
`F12`| 返回上一个工具窗口
|
||||
`Esc`| 转到编辑器
|
||||
`Shift` `Esc`| 隐藏活动或最后一个活动窗口
|
||||
`Ctrl` `Shift` `F4`| 关闭活动运行,消息...
|
||||
`Ctrl` `G`| 去线
|
||||
`Ctrl` `E`| 最近的文件弹出窗口
|
||||
`Ctrl` `Alt` `Left` _/_ `Right`| 向后/向前导航
|
||||
`Ctrl` `Shift` `Backspace`| 导航到上次编辑位置
|
||||
`Alt` `F1`| 在任何视图中选择当前文件或符号
|
||||
`Ctrl` `B` _/_ `Ctrl` `Click`| 去申报
|
||||
`Ctrl` `Alt` `B`| 转到实施
|
||||
`Ctrl` `Shift` `I`| 打开快速定义查找
|
||||
`Ctrl` `Shift` `B`| 转到类型声明
|
||||
`Ctrl` `U`| 转到超方法/超类
|
||||
`Alt` `Up` _/_ `Down`| 转到上一个/下一个方法
|
||||
`Ctrl` `]/[`| 移动到代码块结束/开始
|
||||
`Ctrl` `F12`| 文件结构弹出窗口
|
||||
`Ctrl` `H`| 类型层次结构
|
||||
`Ctrl` `Shift` `H`| 方法层次
|
||||
`Ctrl` `Alt` `H`| 调用层级
|
||||
`F2` _/_ `Shift` `F2`| 下一个/上一个突出显示的错误
|
||||
`F4` _/_ `Ctrl` `Enter`| 编辑源/查看源
|
||||
`Alt` `Home`| 显示导航栏
|
||||
`F11`| 切换书签
|
||||
`Ctrl` `F11`| 使用助记符切换书签
|
||||
`Ctrl` `0...9`| 转到编号书签
|
||||
`Shift` `F11`| 显示书签
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 搜索/替换
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Double Shift`| 到处搜索
|
||||
`Ctrl` `F`| 寻找
|
||||
`F3` `Shift` `F3`| 查找下一个/查找上一个
|
||||
`Ctrl` `R`| 代替
|
||||
`Ctrl` `Shift` `F`| 在路径中查找
|
||||
`Ctrl` `Shift` `R`| 在路径中替换
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 实时模板
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Ctrl` `Alt` `J` | 用实时模板环绕
|
||||
`Ctrl` `J` | 插入实时模板
|
||||
`iter` | 按照Java SDK 1.5风格迭代
|
||||
`inst` | 使用 instanceof 检查对象类型并将其向下转换
|
||||
`itco` | 迭代 java.util.Collection 的元素
|
||||
`itit` | 迭代 java.util.Iterator 的元素
|
||||
`itli` | 迭代 java.util.List 的元素
|
||||
`psf` | 公共静态决赛
|
||||
`thr` | 扔新的
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 重构
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`F5` | 复制
|
||||
`F6` | 移动
|
||||
`Alt` `Delete` | 安全删除
|
||||
`Shift` `F6` | 改名
|
||||
`Ctrl` `F6` | 更改签名
|
||||
`Ctrl` `Alt` `N` | 排队
|
||||
`Ctrl` `Alt` `M` | 提取方法
|
||||
`Ctrl` `Alt` `V` | 提取变量
|
||||
`Ctrl` `Alt` `F` | 提取字段
|
||||
`Ctrl` `Alt` `C` | 提取常量
|
||||
`Ctrl` `Alt` `P` | 提取参数
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 调试
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`F8/F7` | 跨过/进入
|
||||
`Shift` `F7` _/_ `Shift` `F8` | 智能步入/走出
|
||||
`Alt` `F9` | 运行到光标处
|
||||
`Alt` `F8` | 评估表达
|
||||
`F9` | 恢复程序
|
||||
`Ctrl` `F8` | 切换断点
|
||||
`Ctrl` `Shift` `F8` | 查看断点
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 编译运行
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Ctrl` `F9` | 做项目
|
||||
`Ctrl` `Shift` `F9` | 编译选定的文件、包或模块
|
||||
`Alt` `Shift` `F10` _/_ `F9` | 选择配置并运行/和调试
|
||||
`Shift` `F10` _/_ `F9` | 运行/调试
|
||||
`Ctrl` `Shift` `F10` | 从编辑器运行上下文配置
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### VCS/本地历史
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Ctrl` `K` | 提交项目到 VCS
|
||||
`Ctrl` `T` | 从 VCS 更新
|
||||
`Alt` `Shift` `C` | 查看最近的更改
|
||||
`Alt` <kbd>\`</kbd> | VCS 操作弹出窗口
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 一般的
|
||||
|
||||
快捷键 | 说明
|
||||
:-- | --
|
||||
`Alt` `0...9` | 打开相应的工具窗口
|
||||
`Ctrl` `S` | 保存全部
|
||||
`Ctrl` `Alt` `Y` | 同步
|
||||
`Ctrl` `Shift` `F12` | 切换最大化编辑器
|
||||
`Alt` `Shift` `F` | 添加到收藏夹
|
||||
`Alt` `Shift` `I` | 检查当前文件
|
||||
`Ctrl` <kbd>\`</kbd> | 快速切换电流方案
|
||||
`Ctrl` `Alt` `S` | 打开设置对话框
|
||||
`Ctrl` `Alt` `Shift` `S` | 打开项目结构对话框
|
||||
`Ctrl` `Shift` `A` | 寻找行动
|
||||
`Ctrl` `Tab` | 在工具和选项卡之间切换
|
||||
<!--rehype:className=shortcuts-->
|
779
docs/iptables.md
Normal file
@ -0,0 +1,779 @@
|
||||
iptables 备忘清单
|
||||
====
|
||||
|
||||
iptables 是一个配置 Linux 内核防火墙的命令行工具,是 [netfilter](https://en.wikipedia.org/wiki/Netfilter) 项目的一部分。这个快速参考备忘单显示了它的常用命令使用清单
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 介绍
|
||||
|
||||
iptables 使用三个不同的链来允许或阻止流量:输入(input)、输出(output)和转发(forward)
|
||||
|
||||
- 输入(input) —— 此链用于控制传入连接的行为
|
||||
- 输出(output) —— 此链用于传出连接
|
||||
- 转发(forward) —— 这条链用于传入的连接,这些连接实际上不是在本地传递的,比如路由和 NATing
|
||||
|
||||
### 安装 iptables
|
||||
|
||||
CentOS 7 上默认安装了 firewalld 作为防火墙,使用 iptables 建议关闭并禁用 firewalld。
|
||||
|
||||
```bash
|
||||
$ systemctl stop firewalld
|
||||
$ systemctl disable firewalld
|
||||
```
|
||||
|
||||
安装 iptables
|
||||
|
||||
```bash
|
||||
$ yum install -y iptables-services
|
||||
```
|
||||
|
||||
### 服务管理
|
||||
|
||||
```bash
|
||||
$ systemctl status iptables # 查看服务状态
|
||||
$ systemctl enable iptables # 启用服务
|
||||
$ systemctl disable iptables # 禁用服务
|
||||
$ systemctl start iptables # 启动服务
|
||||
$ systemctl restart iptables # 重启服务
|
||||
$ systemctl stop iptables # 关闭服务
|
||||
```
|
||||
|
||||
### 命令参数
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
基本语法:
|
||||
|
||||
```bash
|
||||
$ iptables(选项)(参数)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
参数 | 作用
|
||||
:- | --
|
||||
`-P` | 设置默认策略: <br/>_iptables -P INPUT (DROP_
|
||||
`-F` | 清空规则链
|
||||
`-L` | 查看规则链
|
||||
`-A` | 在规则链的末尾加入新规则
|
||||
`-I` | `num` 在规则链的头部加入新规则
|
||||
`-D` | `num` 删除某一条规则
|
||||
`-s` | 匹配来源地址 `IP/MASK` <br/>加叹号"!"表示除这个 `IP` 外
|
||||
`-d` | 匹配目标地址
|
||||
`-i` | 网卡名称 匹配从这块网卡流入的数据
|
||||
`-o` | 网卡名称 匹配从这块网卡流出的数据
|
||||
`-p` | 匹配协议,如 tcp,udp,icmp
|
||||
`--dport num` | 匹配目标端口号
|
||||
`--sport num` | 匹配来源端口号
|
||||
|
||||
---
|
||||
|
||||
```bash
|
||||
$ iptables -t 表名 <-A/I/D/R> 规则链名 [规则号] <-i/o 网卡名> -p 协议名 <-s 源IP/源子网> --sport 源端口 <-d 目标IP/目标子网> --dport 目标端口 -j 动作
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 开始配置规则
|
||||
|
||||
默认情况下,所有链都配置为接受规则,因此在强化过程中,建议从拒绝所有配置开始,然后只打开需要的端口:
|
||||
|
||||
```bash
|
||||
$ iptables --policy INPUT DROP
|
||||
$ iptables --policy OUTPUT DROP
|
||||
$ iptables --policy FORWARD DROP
|
||||
```
|
||||
|
||||
### 删除/插入规则
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
按链条和编号删除规则
|
||||
|
||||
```bash
|
||||
$ iptables -D INPUT 10
|
||||
```
|
||||
|
||||
按规范删除规则
|
||||
|
||||
```bash
|
||||
$ iptables -D INPUT -m conntrack --ctstate INVALID -j DROP
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
刷新所有规则,删除所有链,并接受所有
|
||||
|
||||
```bash
|
||||
$ iptables -P INPUT ACCEPT
|
||||
$ iptables -P FORWARD ACCEPT
|
||||
$ iptables -P OUTPUT ACCEPT
|
||||
$ iptables -t nat -F
|
||||
$ iptables -t mangle -F
|
||||
$ iptables -F
|
||||
$ iptables -X
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```bash
|
||||
# 冲洗所有链
|
||||
$ iptables -F
|
||||
# 刷新单链
|
||||
$ iptables -F INPUT
|
||||
# 插入规则
|
||||
$ iptables -I INPUT 2 -s 202.54.1.2 -j DROP
|
||||
```
|
||||
|
||||
### 显示规则
|
||||
|
||||
详细打印出所有活动的 `iptables` 规则
|
||||
|
||||
```bash
|
||||
$ iptables -n -L -v
|
||||
```
|
||||
|
||||
...具有行号的相同输出:
|
||||
|
||||
```bash
|
||||
$ iptables -n -L -v --line-numbers
|
||||
```
|
||||
|
||||
最后,相同的数据输出但与 `INPUT`/`OUTPUT` 链相关:
|
||||
|
||||
```bash
|
||||
$ iptables -L INPUT -n -viptables -L OUTPUT -n -v --line-numbers
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 列出特定链的规则
|
||||
|
||||
```bash
|
||||
$ iptables -L INPUT
|
||||
# 具有规则规范的相同数据:
|
||||
$ iptables -S INPUT
|
||||
# 包含数据包计数的规则列表
|
||||
$ iptables -L INPUT -v
|
||||
```
|
||||
|
||||
### 保存规则
|
||||
|
||||
```bash
|
||||
# 在基于 Debian 的系统上
|
||||
$ netfilter-persistent save
|
||||
# 在基于 RedHat 的系统上
|
||||
$ service iptables save
|
||||
```
|
||||
|
||||
iptables 示例
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
### 清空当前的所有规则和计数
|
||||
|
||||
```bash
|
||||
$ iptables -F # 清空所有的防火墙规则
|
||||
$ iptables -X # 删除用户自定义的空链
|
||||
$ iptables -Z # 清空计数
|
||||
```
|
||||
|
||||
### 配置允许 ssh 端口连接
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 22 -j ACCEPT
|
||||
```
|
||||
|
||||
`22` 为你的 `ssh` 端口, `-s 192.168.1.0/24` 表示允许这个网段的机器来连接,其它网段的 `ip` 地址是登陆不了你的机器的。`-j ACCEPT` 表示接受这样的请求
|
||||
|
||||
### 允许本地回环地址可以正常使用
|
||||
|
||||
```shell
|
||||
$ iptables -A INPUT -i lo -j ACCEPT
|
||||
# 本地圆环地址就是那个127.0.0.1
|
||||
# 是本机上使用的,它进与出都设置为允许
|
||||
$ iptables -A OUTPUT -o lo -j ACCEPT
|
||||
```
|
||||
|
||||
### 设置默认的规则
|
||||
|
||||
```shell
|
||||
# 配置默认的不让进
|
||||
$ iptables -P INPUT DROP
|
||||
# 默认的不允许转发
|
||||
$ iptables -P FORWARD DROP
|
||||
# 默认的可以出去
|
||||
$ iptables -P OUTPUT ACCEPT
|
||||
```
|
||||
|
||||
### 配置白名单
|
||||
|
||||
```shell
|
||||
# 允许机房内网机器可以访问
|
||||
$ iptables -A INPUT -p all -s 192.168.1.0/24 -j ACCEPT
|
||||
# 允许机房内网机器可以访问
|
||||
$ iptables -A INPUT -p all -s 192.168.140.0/24 -j ACCEPT
|
||||
# 允许 183.121.3.7 访问本机的3380端口
|
||||
$ iptables -A INPUT -p tcp -s 183.121.3.7 --dport 3380 -j ACCEPT
|
||||
```
|
||||
|
||||
### 开启相应的服务端口
|
||||
|
||||
```shell
|
||||
# 开启 80 端口,因为web对外都是这个端口
|
||||
$ iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
||||
# 允许被 ping
|
||||
$ iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT
|
||||
# 已经建立的连接得让它进来
|
||||
$ iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||
```
|
||||
|
||||
### 保存规则到配置文件中
|
||||
|
||||
```shell
|
||||
# 任何改动之前先备份,请保持这一优秀的习惯
|
||||
$ cp /etc/sysconfig/iptables /etc/sysconfig/iptables.bak
|
||||
$ iptables-save > /etc/sysconfig/iptables
|
||||
$ cat /etc/sysconfig/iptables
|
||||
```
|
||||
|
||||
### 列出已设置的规则
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```bash
|
||||
$ iptables -L [-t 表名][链名]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
- 四个表名 `raw`,`nat`,`filter`,`mangle`
|
||||
- 五个规则链名 `INPUT`、`OUTPUT`、`FORWARD`、`PREROUTING`、`POSTROUTING`
|
||||
- filter 表包含`INPUT`、`OUTPUT`、`FORWARD`三个规则链
|
||||
|
||||
```shell
|
||||
# 列出 nat 上面的所有规则
|
||||
$ iptables -L -t nat
|
||||
# ^ -t 参数指定,必须是 raw, nat,filter,mangle 中的一个
|
||||
# 规则带编号
|
||||
$ iptables -L -t nat --line-numbers
|
||||
$ iptables -L INPUT
|
||||
# 查看,这个列表看起来更详细
|
||||
$ iptables -L -nv
|
||||
```
|
||||
|
||||
### 清除已有规则
|
||||
|
||||
```shell
|
||||
# 清空指定链 INPUT 上面的所有规则
|
||||
$ iptables -F INPUT
|
||||
# 删除指定的链,这个链必须没有被其它任何规则引用,
|
||||
# 而且这条上必须没有任何规则
|
||||
$ iptables -X INPUT
|
||||
# 如果没有指定链名,则会删除该表中所有非内置的链
|
||||
# 把指定链,或者表中的所有链上的所有计数器清零
|
||||
$ iptables -Z INPUT
|
||||
```
|
||||
|
||||
### 删除已添加的规则
|
||||
|
||||
```shell
|
||||
# 添加一条规则
|
||||
$ iptables -A INPUT -s 192.168.1.5 -j DROP
|
||||
```
|
||||
|
||||
将所有 iptables 以序号标记显示,执行:
|
||||
|
||||
```shell
|
||||
$ iptables -L -n --line-numbers
|
||||
```
|
||||
|
||||
比如要删除 INPUT 里序号为 8 的规则,执行:
|
||||
|
||||
```shell
|
||||
$ iptables -D INPUT 8
|
||||
```
|
||||
|
||||
### 开放指定的端口
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```shell
|
||||
# 允许本地回环接口(即运行本机访问本机)
|
||||
$ iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
|
||||
# 允许已建立的或相关连的通行
|
||||
$ iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||
# 允许所有本机向外的访问
|
||||
$ iptables -A OUTPUT -j ACCEPT
|
||||
# 允许访问22端口
|
||||
$ iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
||||
# 允许访问80端口
|
||||
$ iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
||||
# 允许ftp服务的21端口
|
||||
$ iptables -A INPUT -p tcp --dport 21 -j ACCEPT
|
||||
# 允许FTP服务的20端口
|
||||
$ iptables -A INPUT -p tcp --dport 20 -j ACCEPT
|
||||
# 禁止其他未允许的规则访问
|
||||
$ iptables -A INPUT -j reject
|
||||
# 禁止其他未允许的规则访问
|
||||
$ iptables -A FORWARD -j REJECT
|
||||
```
|
||||
|
||||
### 屏蔽 IP
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```shell
|
||||
# 屏蔽恶意主机(比如,192.168.0.8
|
||||
$ iptables -A INPUT -p tcp -m tcp -s 192.168.0.8 -j DROP
|
||||
# 屏蔽单个IP的命令
|
||||
$ iptables -I INPUT -s 123.45.6.7 -j DROP
|
||||
# 封整个段即从123.0.0.1到123.255.255.254的命令
|
||||
$ iptables -I INPUT -s 123.0.0.0/8 -j DROP
|
||||
# 封IP段即从123.45.0.1到123.45.255.254的命令
|
||||
$ iptables -I INPUT -s 124.45.0.0/16 -j DROP
|
||||
# 封IP段即从123.45.6.1到123.45.6.254的命令是
|
||||
$ iptables -I INPUT -s 123.45.6.0/24 -j DROP
|
||||
```
|
||||
|
||||
### 指定数据包出去的网络接口
|
||||
|
||||
只对 OUTPUT,FORWARD,POSTROUTING 三个链起作用。
|
||||
|
||||
```shell
|
||||
$ iptables -A FORWARD -o eth0
|
||||
```
|
||||
|
||||
### 查看已添加的规则
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```shell
|
||||
$ iptables -L -n -v
|
||||
Chain INPUT (policy DROP 48106 packets, 2690K bytes)
|
||||
pkts bytes target prot opt in out source destination
|
||||
5075 589K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
|
||||
191K 90M ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
|
||||
1499K 133M ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
|
||||
4364K 6351M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
|
||||
6256 327K ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
|
||||
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
|
||||
pkts bytes target prot opt in out source destination
|
||||
Chain OUTPUT (policy ACCEPT 3382K packets, 1819M bytes)
|
||||
pkts bytes target prot opt in out source destination
|
||||
5075 589K ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
|
||||
```
|
||||
|
||||
### 启动网络转发规则
|
||||
|
||||
公网`210.14.67.7`让内网`192.168.188.0/24`上网
|
||||
|
||||
```shell
|
||||
$ iptables -t nat -A POSTROUTING -s 192.168.188.0/24 -j SNAT --to-source 210.14.67.127
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 端口映射
|
||||
|
||||
本机的 2222 端口映射到内网 虚拟机的 22 端口
|
||||
|
||||
```shell
|
||||
$ iptables -t nat -A PREROUTING -d 210.14.67.127 -p tcp --dport 2222 -j DNAT --to-dest 192.168.188.115:22
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 字符串匹配
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
比如,我们要过滤所有 TCP 连接中的字符串`test`,一旦出现它我们就终止这个连接,我们可以这么做:
|
||||
|
||||
```shell
|
||||
$ iptables -A INPUT -p tcp -m string --algo kmp --string "test" -j REJECT --reject-with tcp-reset
|
||||
$ iptables -L
|
||||
# Chain INPUT (policy ACCEPT)
|
||||
# target prot opt source destination
|
||||
# REJECT tcp -- anywhere anywhere STRING match "test" ALGO name kmp TO 65535 reject-with tcp-reset
|
||||
#
|
||||
# Chain FORWARD (policy ACCEPT)
|
||||
# target prot opt source destination
|
||||
#
|
||||
# Chain OUTPUT (policy ACCEPT)
|
||||
# target prot opt source destination
|
||||
```
|
||||
|
||||
### 阻止 Windows 蠕虫的攻击
|
||||
|
||||
```shell
|
||||
$ iptables -I INPUT -j DROP -p tcp -s 0.0.0.0/0 -m string --algo kmp --string "cmd.exe"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 防止 SYN 洪水攻击
|
||||
|
||||
```shell
|
||||
$ iptables -A INPUT -p tcp --syn -m limit --limit 5/second -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许环回连接
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i lo -j ACCEPTiptables -A OUTPUT -o lo -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许已建立和相关的传入连接
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许已建立的传出连接
|
||||
|
||||
```bash
|
||||
$ iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 内部到外部
|
||||
|
||||
```bash
|
||||
$ iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
|
||||
```
|
||||
|
||||
### 丢弃无效数据包
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
|
||||
```
|
||||
|
||||
### 阻止 IP 地址
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -s 192.168.1.10 -j DROP
|
||||
```
|
||||
|
||||
### 阻止和 IP 地址并拒绝
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -s 192.168.1.10 -j REJECT
|
||||
```
|
||||
|
||||
### 阻止与网络接口的连接
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i eth0 -s 192.168.1.10 -j DROP
|
||||
```
|
||||
|
||||
### 允许所有传入的 SSH
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许来自特定 IP 地址或子网的传入 SSH
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许传出 SSH
|
||||
|
||||
```bash
|
||||
$ iptables -A OUTPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A INPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许来自特定 IP 地址或子网的传入 Rsync
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 873 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 873 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许传入 HTTP
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 80 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许传入 HTTPS
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 443 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许传入 HTTP 和 HTTPS
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp -m multiport --dports 80,443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许来自特定 IP 地址或子网的 MySQL
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 3306 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 3306 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许 MySQL 到特定的网络接口
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i eth1 -p tcp --dport 3306 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -o eth1 -p tcp --sport 3306 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许来自特定 IP 地址或子网的 PostgreSQL
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 5432 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 5432 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许 PostgreSQL 到特定的网络接口
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i eth1 -p tcp --dport 5432 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -o eth1 -p tcp --sport 5432 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 阻止传出 SMTP 邮件
|
||||
|
||||
```bash
|
||||
$ iptables -A OUTPUT -p tcp --dport 25 -j REJECT
|
||||
```
|
||||
|
||||
### 允许所有传入的 SMTP
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 25 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 25 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许所有传入的 IMAP
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 143 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 143 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许所有传入的 IMAPS
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 993 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 993 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许所有传入的 POP3
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 110 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 110 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 允许所有传入的 POP3S
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport 995 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||
$ iptables -A OUTPUT -p tcp --sport 995 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||
```
|
||||
|
||||
### 在公共接口上删除专用网络地址
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i eth1 -s 192.168.1.0/24 -j DROP
|
||||
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP
|
||||
```
|
||||
|
||||
### 将所有传出到 Facebook 网络
|
||||
|
||||
获取 Facebook 作为:
|
||||
|
||||
```bash
|
||||
$ whois -h v4.whois.cymru.com " -v $(host facebook.com | grep "has address" | cut -d " " -f4)" | tail -n1 | awk '{print $1}'
|
||||
```
|
||||
|
||||
降低:
|
||||
|
||||
```bash
|
||||
$ for i in $(whois -h whois.radb.net -- '-i origin AS1273' | grep "^route:" | cut -d ":" -f2 | sed -e 's/^[ \t]*//' | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | cut -d ":" -f2 | sed 's/$/;/') ; do iptables -A OUTPUT -s "$i" -j REJECTdone
|
||||
```
|
||||
|
||||
### 记录和丢弃数据包
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j LOG --log-prefix "IP_SPOOF A: "
|
||||
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP
|
||||
```
|
||||
|
||||
默认情况下,所有内容都记录到 `/var/log/messages` 文件中:
|
||||
|
||||
```bash
|
||||
$ tail -f /var/log/messagesgrep --color 'IP SPOOF' /var/log/messages
|
||||
```
|
||||
|
||||
### 记录和丢弃日志条目数量有限的数据包
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix "IP_SPOOF A: "
|
||||
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP
|
||||
```
|
||||
|
||||
### 丢弃或接受来自 Mac 地址的流量
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -m mac --mac-source 00:0F:EA:91:04:08 -j DROP
|
||||
$ iptables -A INPUT -p tcp --destination-port 22 -m mac --mac-source 00:0F:EA:91:04:07 -j ACCEPT
|
||||
```
|
||||
|
||||
### 阻止或允许 ICMP Ping 请求
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
|
||||
$ iptables -A INPUT -i eth1 -p icmp --icmp-type echo-request -j DROP
|
||||
```
|
||||
|
||||
### 使用 multiport 指定多个端口
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -i eth0 -p tcp -m state --state NEW -m multiport --dports ssh,smtp,http,https -j ACCEPT
|
||||
```
|
||||
|
||||
### 使用 `random*` 或 `nth*` 进行负载平衡
|
||||
|
||||
```bash
|
||||
_ips=("172.31.250.10" "172.31.250.11" "172.31.250.12" "172.31.250.13")for ip in "${_ips[@]}" ; do iptables -A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m nth --counter 0 --every 4 --packet 0 \ -j DNAT --to-destination ${ip}:80done
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
_ips=("172.31.250.10" "172.31.250.11" "172.31.250.12" "172.31.250.13")for ip in "${_ips[@]}" ; do iptables -A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m random --average 25 \ -j DNAT --to-destination ${ip}:80done
|
||||
```
|
||||
|
||||
### 使用 limit 和 `iplimit*` 限制连接数
|
||||
|
||||
```bash
|
||||
$ iptables -A FORWARD -m state --state NEW -p tcp -m multiport --dport http,https -o eth0 -i eth1 -m limit --limit 20/hour --limit-burst 5 -j ACCEPT
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp -m state --state NEW --dport http -m iplimit --iplimit-above 5 -j DROP
|
||||
```
|
||||
|
||||
### 维护要匹配的最近连接列表
|
||||
|
||||
```bash
|
||||
$ iptables -A FORWARD -m recent --name portscan --rcheck --seconds 100 -j DROPiptables -A FORWARD -p tcp -i eth0 --dport 443 -m recent --name portscan --set -j DROP
|
||||
```
|
||||
|
||||
### 匹配数据包数据负载中的 “string*”
|
||||
|
||||
```bash
|
||||
$ iptables -A FORWARD -m string --string '.com' -j DROP
|
||||
$ iptables -A FORWARD -m string --string '.exe' -j DROP
|
||||
```
|
||||
|
||||
### 带有“时间*”的基于时间的规则
|
||||
|
||||
```bash
|
||||
$ iptables -A FORWARD -p tcp -m multiport --dport http,https -o eth0 -i eth1 -m time --timestart 21:30 --timestop 22:30 --days Mon,Tue,Wed,Thu,Fri -j ACCEPT
|
||||
```
|
||||
|
||||
### 基于 TTL 值的数据包匹配
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -s 1.2.3.4 -m ttl --ttl-lt 40 -j REJECT
|
||||
```
|
||||
|
||||
### 防止端口扫描
|
||||
|
||||
```bash
|
||||
$ iptables -N port-scanningiptables -A port-scanning -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s --limit-burst 2 -j RETURNiptables -A port-scanning -j DROP
|
||||
```
|
||||
|
||||
### SSH 暴力破解保护
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --setiptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 10 -j DROP
|
||||
```
|
||||
|
||||
### 同步泛洪保护
|
||||
|
||||
```bash
|
||||
$ iptables -N syn_floodiptables -A INPUT -p tcp --syn -j syn_floodiptables -A syn_flood -m limit --limit 1/s --limit-burst 3 -j RETURN
|
||||
$ iptables -A syn_flood -j DROPiptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j ACCEPT
|
||||
$ iptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j LOG --log-prefix PING-DROP:
|
||||
$ iptables -A INPUT -p icmp -j DROPiptables -A OUTPUT -p icmp -j ACCEPT
|
||||
```
|
||||
|
||||
### 使用 SYNPROXY 缓解 SYN 泛洪
|
||||
|
||||
```bash
|
||||
$ iptables -t raw -A PREROUTING -p tcp -m tcp --syn -j CT --notrack
|
||||
$ iptables -A INPUT -p tcp -m tcp -m conntrack --ctstate INVALID,UNTRACKED -j SYNPROXY --sack-perm --timestamp --wscale 7 --mss 1460
|
||||
$ iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
|
||||
```
|
||||
|
||||
### 阻止非 SYN 的新数据包
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
|
||||
```
|
||||
|
||||
或
|
||||
|
||||
```bash
|
||||
$ iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
|
||||
```
|
||||
|
||||
### 强制碎片数据包检查
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -f -j DROP
|
||||
```
|
||||
|
||||
### XMAS 包
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
|
||||
```
|
||||
|
||||
### 丢弃所有 NULL 数据包
|
||||
|
||||
```bash
|
||||
$ iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
|
||||
```
|
||||
|
||||
### 阻止不常见的 MSS 值
|
||||
|
||||
```bash
|
||||
$ iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
|
||||
```
|
||||
|
||||
### 阻止带有虚假 TCP 标志的数据包
|
||||
|
||||
```bash
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,RST FIN,RST -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,ACK FIN -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,URG URG -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,FIN FIN -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,PSH PSH -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL ALL -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL NONE -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL FIN,PSH,URG -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,FIN,PSH,URG -j DROP
|
||||
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
|
||||
```
|
||||
|
||||
### 阻止来自私有子网的数据包(欺骗)
|
||||
|
||||
```bash
|
||||
_subnets=("224.0.0.0/3" "169.254.0.0/16" "172.16.0.0/12" "192.0.2.0/24" "192.168.0.0/16" "10.0.0.0/8" "0.0.0.0/8" "240.0.0.0/5")for _sub in "${_subnets[@]}" ; do iptables -t mangle -A PREROUTING -s "$_sub" -j DROPdoneiptables -t mangle -A PREROUTING -s 127.0.0.0/8 ! -i lo -j DROP
|
||||
```
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
- [Iptables 应用](https://dunwu.github.io/linux-tutorial/linux/ops/iptables.html)
|
||||
- [netfilter 官网](https://netfilter.org/)
|
36
docs/java.md
@ -89,7 +89,7 @@ boolean[] answers = {true, false};
|
||||
|
||||
查看: [Arrays](#java-数组)
|
||||
|
||||
### Swap
|
||||
### 交换变量 Swap
|
||||
|
||||
```java
|
||||
int a = 1;
|
||||
@ -101,7 +101,7 @@ b = temp;
|
||||
System.out.println(a + " " + b); // 2 1
|
||||
```
|
||||
|
||||
### Type Casting
|
||||
### 类型转换 Type Casting
|
||||
|
||||
```java
|
||||
// Widening
|
||||
@ -344,7 +344,7 @@ for (int a: arr) {
|
||||
// 输出: a b c
|
||||
```
|
||||
|
||||
### Multidimensional Arrays
|
||||
### 二维数组 Multidimensional Arrays
|
||||
|
||||
```java
|
||||
int[][] matrix = { {1, 2, 3}, {4, 5} };
|
||||
@ -359,7 +359,7 @@ for (int i = 0; i < a.length; ++i) {
|
||||
// 输出: 1 2 3 4 5 6 7
|
||||
```
|
||||
|
||||
### Sort
|
||||
### 排序 Sort
|
||||
|
||||
```java
|
||||
char[] chars = {'b', 'a', 'c'};
|
||||
@ -547,10 +547,10 @@ for (int i = 0; i < 5; i++) {
|
||||
Java 框架搜集
|
||||
--------------------
|
||||
|
||||
### Java 搜集
|
||||
### Java 集合
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
搜集 | Interface | 有序 | 已排序 | 线程安全 | 复制 | Nullable
|
||||
集合 | Interface | 有序 | 已排序 | 线程安全 | 复制 | Nullable
|
||||
:-|:-|:-|:-|:-|:-|:-
|
||||
[ArrayList](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html) | List | Y | _N_ | _N_ | Y | Y
|
||||
[Vector](https://docs.oracle.com/javase/8/docs/api/java/util/Vector.html) | List | Y | _N_ | Y | Y | Y
|
||||
@ -615,6 +615,25 @@ m.forEach((key, value) -> {
|
||||
});
|
||||
```
|
||||
|
||||
### ConcurrentHashMap
|
||||
|
||||
```java
|
||||
ConcurrentHashMap<Integer, String> m
|
||||
= new ConcurrentHashMap<>();
|
||||
m.put(100, "Hello");
|
||||
m.put(101, "Geeks");
|
||||
m.put(102, "Geeks");
|
||||
// 移除
|
||||
m.remove(101, "Geeks");
|
||||
|
||||
// 如果不存在,就添加,存在就不变更
|
||||
m.putIfAbsent(103, "Hello");
|
||||
|
||||
// 替换
|
||||
m.replace(101, "Hello", "For");
|
||||
System.out.println(m);
|
||||
```
|
||||
|
||||
### HashSet
|
||||
|
||||
```java
|
||||
@ -771,7 +790,7 @@ text.split(Pattern.quote("|"));
|
||||
`Math.toDegrees(rad)` | 以度为单位的角度弧度
|
||||
`Math.toRadians(deg)` | 以弧度为单位的角度度
|
||||
|
||||
### Try/Catch/Finally
|
||||
### 异常 Try/Catch/Finally
|
||||
|
||||
```java
|
||||
try {
|
||||
@ -816,6 +835,9 @@ method.invoke(classLoader, url);
|
||||
- `SecureRandom` 实例用于生成安全的伪随机数流
|
||||
- `UUID` 表示一个不可变的通用唯一标识符
|
||||
- `Vector` 实现了一个可增长的对象数组
|
||||
- `LocalDate` 表示没有时区的日期,只包含年月日,不可变并且线程安全的,java8 及以上版本可用
|
||||
- `LocalTime` 表示没有时区的时间,只包含时分秒,不可变并且线程安全的,java8 及以上版本可用
|
||||
- `LocalDateTime` 表示没有时区的日期时间,同时包含年月日时分秒,不可变并且线程安全的,java8 及以上版本可用
|
||||
|
||||
另见
|
||||
---
|
||||
|
@ -1190,6 +1190,99 @@ console.log(myCat.name);
|
||||
myCat.name = 'Yankee';
|
||||
```
|
||||
|
||||
### Proxy
|
||||
|
||||
Proxy 对象用于创建一个对象的代理,从而实现基本操作的拦截和自定义(如属性查找、赋值、枚举、函数调用等)。
|
||||
|
||||
```javascript
|
||||
// 用于拦截对象的读取属性操作。
|
||||
const handler = {
|
||||
get: function(obj, prop) {
|
||||
return prop in obj ? obj[prop] : 37;
|
||||
}
|
||||
};
|
||||
|
||||
const p = new Proxy({}, handler);
|
||||
p.a = 1;
|
||||
p.b = undefined;
|
||||
|
||||
console.log(p.a, p.b); // 1, undefined
|
||||
console.log('c' in p, p.c); // false, 37
|
||||
```
|
||||
|
||||
#### 语法
|
||||
|
||||
```javascript
|
||||
const p = new Proxy(target, handler)
|
||||
```
|
||||
|
||||
- target 要使用 Proxy 包装的目标对象(可以是任何类型的对象,包括原生数组,函数,甚至另一个代理)。
|
||||
- handler 一个通常以函数作为属性的对象,各属性中的函数分别定义了在执行各种操作时代理 p 的行为。
|
||||
|
||||
#### 方法
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
`Proxy.revocable()` | 创建一个可撤销的Proxy对象 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable)
|
||||
|
||||
#### handler 对象的方法
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
`handler.getPrototypeOf()` | Object.getPrototypeOf 方法的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getPrototypeOf)
|
||||
`handler.setPrototypeOf()` | Object.setPrototypeOf 方法的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/setPrototypeOf)
|
||||
`handler.isExtensible()` | Object.isExtensible 方法的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/isExtensible)
|
||||
`handler.preventExtensions()` | Object.preventExtensions 方法的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/preventExtensions)
|
||||
`handler.getOwnPropertyDescriptor()` | Object.getOwnPropertyDescriptor 方法的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor)
|
||||
`handler.defineProperty()` | Object.defineProperty 方法的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/defineProperty)
|
||||
`handler.has()` | in 操作符的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/has)
|
||||
`handler.get()` | 属性读取操作的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/get)
|
||||
`handler.set()` | 属性设置操作的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/set)
|
||||
`handler.deleteProperty()` | delete 操作符的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/deleteProperty)
|
||||
`handler.ownKeys()` | Object.getOwnPropertyNames 方法和 Object.getOwnPropertySymbols 方法的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/ownKeys)
|
||||
`handler.apply()` | 函数调用操作的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/apply)
|
||||
`handler.construct()` | new 操作符的捕捉器 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/construct)
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
### Reflect
|
||||
|
||||
Reflect 是一个内置的对象,它提供拦截 JavaScript 操作的方法。这些方法与proxy handlers (en-US)的方法相同。Reflect不是一个函数对象,因此它是不可构造的。
|
||||
|
||||
```javascript
|
||||
// 检测一个对象是否存在特定属性
|
||||
const duck = {
|
||||
name: 'Maurice',
|
||||
color: 'white',
|
||||
greeting: function() {
|
||||
console.log(`Quaaaack! My name is ${this.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reflect.has(duck, 'color');
|
||||
// true
|
||||
Reflect.has(duck, 'haircut');
|
||||
// false
|
||||
```
|
||||
|
||||
#### 静态方法
|
||||
|
||||
:- | :-
|
||||
:- | :-
|
||||
`Reflect.apply(target, thisArgument, argumentsList)` | 对一个函数进行调用操作,同时可以传入一个数组作为调用参数。和 Function.prototype.apply() 功能类似 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/apply)
|
||||
`Reflect.construct(target, argumentsList[, newTarget])` | 对构造函数进行 new 操作,相当于执行 new target(...args) [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/construct)
|
||||
`Reflect.defineProperty(target, propertyKey, attributes)` | 和 Object.defineProperty() 类似。如果设置成功就会返回 true [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/defineProperty)
|
||||
`Reflect.deleteProperty(target, propertyKey)` | 作为函数的delete操作符,相当于执行 delete target[name] [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/deleteProperty)
|
||||
`Reflect.get(target, propertyKey[, receiver])` | 获取对象身上某个属性的值,类似于 target[name] [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/get)
|
||||
`Reflect.getOwnPropertyDescriptor(target, propertyKey)` | 类似于 Object.getOwnPropertyDescriptor()。如果对象中存在该属性,则返回对应的属性描述符,否则返回 undefined [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/getOwnPropertyDescriptor)
|
||||
`Reflect.getPrototypeOf(target)` | 类似于 Object.getPrototypeOf() [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/getPrototypeOf)
|
||||
`Reflect.has(target, propertyKey)` | 判断一个对象是否存在某个属性,和 in 运算符 的功能完全相同 [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/has)
|
||||
`Reflect.isExtensible(target)` | 类似于 Object.isExtensible() [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/isExtensible)
|
||||
`Reflect.ownKeys(target)` | 返回一个包含所有自身属性(不包含继承属性)的数组。(类似于 Object.keys(), 但不会受enumerable 影响) [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/ownKeys)
|
||||
`Reflect.preventExtensions(target)` | 类似于 Object.preventExtensions()。返回一个Boolean [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions)
|
||||
`Reflect.set(target, propertyKey, value[, receiver])` | 将值分配给属性的函数。返回一个Boolean,如果更新成功,则返回true [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/set)
|
||||
`Reflect.setPrototypeOf(target, prototype)` | 设置对象原型的函数。返回一个 Boolean,如果更新成功,则返回 true [#](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Reflect/setPrototypeOf)
|
||||
<!--rehype:className=style-list-arrow-->
|
||||
|
||||
JavaScript this 绑定
|
||||
----
|
||||
|
||||
|
112
docs/jest.md
@ -1,7 +1,13 @@
|
||||
Jest 备忘清单
|
||||
===
|
||||
|
||||
Jest 是一款优雅、简洁的 JavaScript 测试框架,这里介绍了它的入门和 一些 API 的索引。
|
||||
[](https://www.npmjs.com/package/jest)
|
||||
[](https://www.npmjs.com/package/jest)
|
||||
[](https://github.com/facebook/jest/network/dependents)
|
||||
[](https://github.com/facebook/jest)
|
||||
|
||||
Jest 是一款优雅、简洁的 JavaScript 测试框架,这里介绍了它的入门和 一些 API 的索引
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
----
|
||||
@ -41,6 +47,37 @@ npm test -- --watch
|
||||
|
||||
查看: [Getting started](https://jestjs.io/docs/getting-started)
|
||||
|
||||
### 常用命令
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
```bash
|
||||
# 指定测试文件的名称
|
||||
$ jest my-test
|
||||
# 指定测试文件的路径
|
||||
$ jest path/to/my-test.js
|
||||
# 仅运行在 hg/git 上有改动但尚未提交的文件
|
||||
$ jest -o
|
||||
# 仅运行与 fileA.js 和 fileB.js相关的测试
|
||||
$ jest --findRelatedTests fileA.js fileB.js
|
||||
# 仅运行匹配特定名称的测试用例
|
||||
$ jest -t name-of-spec
|
||||
# 运行监视模式默认执行 jest -o 监视有改动的测试
|
||||
$ jest --watch
|
||||
$ jest --watchAll # 监视所有测试
|
||||
```
|
||||
|
||||
### 支持驼峰和串式命名的参数
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
# 下面给出的命令执行的结果是一样的:
|
||||
$ jest --collect-coverage
|
||||
$ jest --collectCoverage
|
||||
# 不同命名形式的参数还可以混用,如:
|
||||
$ jest --update-snapshot \
|
||||
--detectOpenHandles
|
||||
```
|
||||
|
||||
### 编写测试
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
@ -884,6 +921,79 @@ test('第二个文本', () => {
|
||||
|
||||
`Node.js` 和 `Jest` 会缓存你需要的模块。 要测试具有副作用的模块,您需要在测试之间重置模块注册表
|
||||
|
||||
命令参数参考
|
||||
---
|
||||
<!--rehype:body-class=cols-1-->
|
||||
|
||||
### 命令参数
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`--bail[=<n>]`, `-b` | 在 `n` 个测试套件失败后立即退出测试套件
|
||||
`--cache` | 是否使用缓存
|
||||
`--changedFilesWithAncestor` | 运行与当前更改和上次提交中所做更改相关的测试
|
||||
`--changedSince` | 运行与自提供的分支或提交哈希以来的更改相关的测试
|
||||
`--ci` | 指定该参数时,`Jest` 会认为正在 `CI` 环境上运行
|
||||
`--clearCache` | 删除 `Jest` 的缓存目录, 然后不运行测试直接退出
|
||||
`--clearMocks` | 在每次测试前自动清除模拟的上下文
|
||||
`--collectCoverageFrom=<glob>` | 相对于 `rootDir` 的 `glob` 模式匹配需要从中收集覆盖信息的文件
|
||||
`--colors` | 即便 `stdout` 不是 `TTY` 模式,也要强制高亮显示测试结果
|
||||
`--config=<path>` | 指定配置文件的路径
|
||||
`--coverage[=<boolean>]`, `--collectCoverage` | 将测试覆盖率信息输出为报告
|
||||
`--coverageProvider=<provider>` | 指示应该使用哪个提供程序来检测代码的覆盖率
|
||||
`--debug` | 打印关于 `Jest` 配置的调试信息
|
||||
`--detectOpenHandles` | 尝试收集并打印打开的句柄以防止 `Jest` 干净地退出
|
||||
`--env=<environment>` | 所有测试都使用该测试环境设定
|
||||
`--errorOnDeprecated` | 使调用已弃用的 `API` 抛出有用的错误消息
|
||||
`--expand`, `-e` | 使用该参数来对比完整的差异和错误,而非修复
|
||||
`--filter=<file>` | 导出过滤功能的模块的路径
|
||||
`--findRelatedTests <spaceSeparatedListOfSourceFiles>` | 查找并运行涵盖作为参数传入的以空格分隔的源文件列表的测试
|
||||
`--forceExit` | 强制 `Jest` 在所有测试运行完后退出
|
||||
`--help` | 显示帮助信息,类似于本页文档
|
||||
`--ignoreProjects <project1> ... <projectN>` | 忽略特定的测试项目
|
||||
`--init` | 生成一个基础配置文件
|
||||
`--injectGlobals` | 将全局变量(`expect`,`test`,`describe`,`beforeEach`等)插入到全局环境中
|
||||
`--json` | 以 `JSON` 模式显示测试结果
|
||||
`--lastCommit` | 运行受上次提交中的文件更改影响的所有测试
|
||||
`--listTests` | 以 `JSON` 数组的形式列出所有将要运行的测试并退出
|
||||
`--logHeapUsage` | 记录每个测试后的记录堆使用情况
|
||||
`--maxConcurrency=<num>` | 防止 `Jest` 同时执行超过指定数量的测试
|
||||
`--maxWorkers=<num>\|<string>` | 设定运行测试的最大工作池数目
|
||||
`--noStackTrace` | 禁止栈跟踪信息在测试结果输出中
|
||||
`--notify` | 激活测试结果通知
|
||||
`--onlyChanged` `-o` | 尝试确定根据当前存储库中哪些已经更改的文件来运行的测试
|
||||
`--outputFile=<filename>` | 通过 `——json` 参数可以将测试结果写入到指定文件
|
||||
`--passWithNoTests` | 允许在没有找到文件的情况下通过测试
|
||||
`--projects <path1> ... <pathN>` | 从指定路径中找到的一个或多个项目运行测试;也采用路径 `globs`
|
||||
`--reporters` | 使用指定的记者进行测试
|
||||
`--resetMocks` | 每次测试前自动重置模拟状态
|
||||
`--restoreMocks` | 在每次测试前自动恢复模拟状态和实现
|
||||
`--roots` | `Jest` 应该用来搜索文件的目录路径列表
|
||||
`--runInBand`, `-i` | 仅在当前的进程中连续运行所有测试,而非通过创建的子进程的工作池来运行测试
|
||||
`--runTestsByPath` | 仅运行使用其确切路径指定的测试
|
||||
`--selectProjects <project1> ... <projectN>` | 运行指定的测试项目
|
||||
`--setupFilesAfterEnv <path1> ... <pathN>` | 运行某些代码以在每次测试之前配置或设置测试框架的模块的路径列表
|
||||
`--shard` | 测试套件分片以 `(?<shardIndex>\d+)/(?<shardCount>\d+)` 的格式执行
|
||||
`--showConfig` | 输出 `Jest` 配置,然后退出
|
||||
`--silent` | 阻止所有测试通过控制台输出信息
|
||||
`--testEnvironmentOptions=<json string>` | 带有将传递给 `testEnvironment` 的选项的 `JSON` 字符串
|
||||
`--testLocationInResults` | 向测试结果添加 `location` 字段
|
||||
`--testMatch glob1 ... globN` | `Jest` 用于检测测试文件的 `glob` 模式
|
||||
`--testNamePattern=<regex>`, `-t` | 仅运行名称与正则表达式匹配的测试
|
||||
`--testPathIgnorePatterns=<regex>\|[array]` | 在执行测试之前针对所有测试路径进行测试的单个或一组正则表达式模式字符串
|
||||
`--testPathPattern=<regex>` | 在运行测试前,匹配的 `regexp` 模式字符串的测试文件路径
|
||||
`--testRunner=<path>` | 允许你指定自定义测试运行程序
|
||||
`--testSequencer=<path>` | 允许您指定自定义测试定序器
|
||||
`--testTimeout=<number>` | 测试的默认超时时间(以毫秒为单位)。默认值:`5000`
|
||||
`--updateSnapshot`, `-u` | 在运行测试中使用这个参数来重新录制每个失败测试的快照
|
||||
`--useStderr` | 转移所有输出到 `stderr` (标准错误输出)
|
||||
`--verbose` | 层次显示测试套件中每个测试的结果
|
||||
`--version`, `-v` | 打印版本并退出
|
||||
`--watch` | 监视文件更改,并重新运行与已更改的文件相关的测试
|
||||
`--watchAll` | 监视文件的更改并在任何更改时重新运行所有测试
|
||||
`--watchman` | 是否使用 `watchman` 进行文件爬取。 默认为 `true`
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
|
689
docs/jquery.md
Normal file
@ -0,0 +1,689 @@
|
||||
jQuery 备忘清单
|
||||
===
|
||||
|
||||
[jQuery](https://jquery.com/) 备忘单对于初学者和有经验的开发人员都是很好的参考
|
||||
|
||||
入门
|
||||
-----
|
||||
|
||||
### 引入 jQuery
|
||||
|
||||
```js
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
#### 官方 CDN
|
||||
|
||||
```js
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" crossorigin="anonymous"></script>
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### jQuery 语法
|
||||
|
||||
```js
|
||||
$(selector).methodOrFunction();
|
||||
```
|
||||
|
||||
#### 例子
|
||||
|
||||
```js
|
||||
$('#menu').on('click', () =>{
|
||||
$(this).hide();
|
||||
});
|
||||
$("body").css("background", "red");
|
||||
```
|
||||
|
||||
### jQuery 文档准备就绪
|
||||
|
||||
```js
|
||||
$(document).ready(function() {
|
||||
// 在加载 DOM 后运行
|
||||
alert('DOM fully loaded!');
|
||||
});
|
||||
```
|
||||
|
||||
```js
|
||||
$(function(){
|
||||
// 在加载 DOM 后运行
|
||||
alert('DOM fully loaded!');
|
||||
});
|
||||
```
|
||||
|
||||
jQuery 选择器
|
||||
----------
|
||||
|
||||
### 例子
|
||||
|
||||
```js
|
||||
$("button").click(() => {
|
||||
$(":button").css("color", "red");
|
||||
});
|
||||
```
|
||||
|
||||
#### 组合选择器
|
||||
|
||||
```js
|
||||
$("selector1, selector2 ...selectorn")
|
||||
```
|
||||
|
||||
### 基本
|
||||
|
||||
- [*](https://api.jquery.com/all-selector/) _选择所有元素_<!--rehype:tooltips-->
|
||||
- [.class](https://api.jquery.com/class-selector/) _选择具有给定类的所有元素_<!--rehype:tooltips-->
|
||||
- [element](https://api.jquery.com/element-selector/) _选择具有给定标签名称的所有元素_<!--rehype:tooltips-->
|
||||
- [#id](https://api.jquery.com/id-selector/) _选择具有给定 id 属性的单个元素_<!--rehype:tooltips-->
|
||||
- [:hidden](https://api.jquery.com/hidden-selector/) _选择所有隐藏的元素_<!--rehype:tooltips-->
|
||||
- [:visible](https://api.jquery.com/visible-selector/) _选择所有可见的元素_<!--rehype:tooltips-->
|
||||
- [:contains()](https://api.jquery.com/contains-selector/) _选择包含指定文本的所有元素_<!--rehype:tooltips-->
|
||||
- [:empty](https://api.jquery.com/empty-selector/) _选择所有没有子元素的元素(包括文本节点)_<!--rehype:tooltips-->
|
||||
- [:has()](https://api.jquery.com/has-selector/) _选择至少包含一个与指定选择器匹配的元素的元素_<!--rehype:tooltips-->
|
||||
- [:parent](https://api.jquery.com/parent-selector/) _选择具有至少一个子节点(元素或文本)的所有元素_<!--rehype:tooltips-->
|
||||
- [parent > child](https://api.jquery.com/child-selector/) _选择由父元素指定的子元素指定的所有直接子元素_<!--rehype:tooltips-->
|
||||
- [ancestor descendant](https://api.jquery.com/descendant-selector/) _选择作为给定祖先的后代的所有元素_<!--rehype:tooltips-->
|
||||
- [prev + next](https://api.jquery.com/next-adjacent-Selector/) _选择所有与 next 匹配且紧接在其前面的同级 prev 的下一个元素_<!--rehype:tooltips-->
|
||||
- [prev ~ siblings](https://api.jquery.com/next-siblings-selector/) _选择 prev 元素之后的所有同级元素,具有相同的父元素,并匹配过滤同级选择器_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 基本过滤器
|
||||
|
||||
- [:animated](https://api.jquery.com/animated-selector/) _在运行选择器时选择动画进度中的所有元素_<!--rehype:tooltips-->
|
||||
- [:eq()](https://api.jquery.com/eq-selector/) _选择匹配集中索引 n 处的元素_<!--rehype:tooltips-->
|
||||
- [:even](https://api.jquery.com/even-selector/) _选择偶数元素,索引为零。 另见:奇数_<!--rehype:tooltips-->
|
||||
- [:first](https://api.jquery.com/first-selector/) _选择第一个匹配的 DOM 元素_<!--rehype:tooltips-->
|
||||
- [:gt()](https://api.jquery.com/gt-selector/) _选择匹配集中索引大于索引的所有元素_<!--rehype:tooltips-->
|
||||
- [:header](https://api.jquery.com/header-selector/) _选择所有标题元素,如 h1、h2、h3 等_<!--rehype:tooltips-->
|
||||
- [:lang()](https://api.jquery.com/lang-selector/) _选择指定语言的所有元素_<!--rehype:tooltips-->
|
||||
- [:last](https://api.jquery.com/last-selector/) _选择最后一个匹配的元素_<!--rehype:tooltips-->
|
||||
- [:lt()](https://api.jquery.com/lt-selector/) _选择匹配集中索引小于索引的所有元素_<!--rehype:tooltips-->
|
||||
- [:not()](https://api.jquery.com/not-selector/) _选择与给定选择器不匹配的所有元素_<!--rehype:tooltips-->
|
||||
- [:odd](https://api.jquery.com/odd-selector/) _选择奇数元素,索引为零。 另见:甚至_<!--rehype:tooltips-->
|
||||
- [:root](https://api.jquery.com/root-selector/) _选择作为文档根的元素_<!--rehype:tooltips-->
|
||||
- [:target](https://api.jquery.com/target-selector/) _选择由文档的 URI 的片段标识符指示的目标元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 属性
|
||||
|
||||
- [[name|="value"]](https://api.jquery.com/attribute-contains-prefix-selector/) _选择具有指定属性且值等于给定字符串或以该字符串开头后跟连字符 (-) 的元素_<!--rehype:tooltips-->
|
||||
- [[name*="value"]](https://api.jquery.com/attribute-contains-selector/) _选择具有指定属性且值包含给定子字符串的元素_<!--rehype:tooltips-->
|
||||
- [[name~="value"]](https://api.jquery.com/attribute-contains-word-selector/) _选择具有指定属性的元素,其值包含给定单词,由空格分隔_<!--rehype:tooltips-->
|
||||
- [[name$="value"]](https://api.jquery.com/attribute-ends-with-selector/) _选择具有指定属性且值恰好以给定字符串结尾的元素。 比较区分大小写_<!--rehype:tooltips-->
|
||||
- [[name="value"]](https://api.jquery.com/attribute-equals-selector/) _选择具有指定属性且值恰好等于特定值的元素_<!--rehype:tooltips-->
|
||||
- [[name!="value"]](https://api.jquery.com/attribute-not-equal-selector/) _选择不具有指定属性或具有指定属性但不具有特定值的元素_<!--rehype:tooltips-->
|
||||
- [[name^="value"]](https://api.jquery.com/attribute-starts-with-selector/) _选择具有指定属性且值恰好以给定字符串开头的元素_<!--rehype:tooltips-->
|
||||
- [[name]](https://api.jquery.com/has-attribute-selector/) _选择具有指定属性和任意值的元素_<!--rehype:tooltips-->
|
||||
- [[name="value"][name2="value2"]](https://api.jquery.com/multiple-attribute-selector/) _匹配匹配所有指定属性过滤器的元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 子过滤器
|
||||
|
||||
- [:first-child](https://api.jquery.com/first-child-selector/) _选择作为其父元素的第一个子元素的所有元素_<!--rehype:tooltips-->
|
||||
- [:first-of-type](https://api.jquery.com/first-of-type-selector/) _选择具有相同元素名称的兄弟姐妹中第一个的所有元素_<!--rehype:tooltips-->
|
||||
- [:last-child](https://api.jquery.com/last-child-selector/) _选择作为其父元素的最后一个子元素的所有元素_<!--rehype:tooltips-->
|
||||
- [:last-of-type](https://api.jquery.com/last-of-type-selector/) _选择具有相同元素名称的兄弟中最后一个的所有元素_<!--rehype:tooltips-->
|
||||
- [:nth-child()](https://api.jquery.com/nth-child-selector/) _选择作为其父元素的第 n 个子元素的所有元素_<!--rehype:tooltips-->
|
||||
- [:nth-last-child()](https://api.jquery.com/nth-last-child-selector/) _选择作为其父元素的第 n 个子元素的所有元素,从最后一个元素到第一个元素计数_<!--rehype:tooltips-->
|
||||
- [:nth-last-of-type()](https://api.jquery.com/nth-last-of-type-selector/) _选择所有元素,这些元素是其父元素的第 n 个子元素,相对于具有相同元素名称的兄弟元素,从最后一个元素到第一个元素计数_<!--rehype:tooltips-->
|
||||
- [:nth-of-type()](https://api.jquery.com/nth-of-type-selector/) _选择所有元素,这些元素是其父元素相对于具有相同元素名称的兄弟元素的第 n 个子元素_<!--rehype:tooltips-->
|
||||
- [:only-child](https://api.jquery.com/only-child-selector/) _选择作为其父元素的唯一子元素的所有元素_<!--rehype:tooltips-->
|
||||
- [:only-of-type()](https://api.jquery.com/only-of-type-selector/) _选择所有没有同名元素的元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### Forms
|
||||
|
||||
- [:button](https://api.jquery.com/button-selector/) _选择所有按钮元素和按钮类型的元素_<!--rehype:tooltips-->
|
||||
- [:checkbox](https://api.jquery.com/checkbox-selector/) _选择复选框类型的所有元素_<!--rehype:tooltips-->
|
||||
- [:checked](https://api.jquery.com/checked-selector/) _匹配所有选中或选择的元素_<!--rehype:tooltips-->
|
||||
- [:disabled](https://api.jquery.com/disabled-selector/) _选择所有禁用的元素_<!--rehype:tooltips-->
|
||||
- [:enabled](https://api.jquery.com/enabled-selector/) _选择所有启用的元素_<!--rehype:tooltips-->
|
||||
- [:focus](https://api.jquery.com/focus-selector/) _如果当前获得焦点,则选择元素_<!--rehype:tooltips-->
|
||||
- [:file](https://api.jquery.com/file-selector/) _选择类型文件的所有元素_<!--rehype:tooltips-->
|
||||
- [:image](https://api.jquery.com/image-selector/) _选择图像类型的所有元素_<!--rehype:tooltips-->
|
||||
- [:input](https://api.jquery.com/input-selector/) _选择所有输入、文本区域、选择和按钮元素_<!--rehype:tooltips-->
|
||||
- [:password](https://api.jquery.com/password-selector/) _选择密码类型的所有元素_<!--rehype:tooltips-->
|
||||
- [:radio](https://api.jquery.com/radio-selector/) _选择无线电类型的所有元素_<!--rehype:tooltips-->
|
||||
- [:reset](https://api.jquery.com/reset-selector/) _选择重置类型的所有元素_<!--rehype:tooltips-->
|
||||
- [:selected](https://api.jquery.com/selected-selector/) _选择所有选中的元素_<!--rehype:tooltips-->
|
||||
- [:submit](https://api.jquery.com/submit-selector/) _选择提交类型的所有元素_<!--rehype:tooltips-->
|
||||
- [:text](https://api.jquery.com/text-selector/) _选择文本类型的所有输入元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
jQuery 属性
|
||||
-----
|
||||
|
||||
### 例子
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```js
|
||||
$('h2').css({
|
||||
color: 'blue',
|
||||
backgroundColor: 'gray',
|
||||
fontSize: '24px'
|
||||
});
|
||||
```
|
||||
|
||||
#### jQuery 添加类
|
||||
|
||||
```js
|
||||
$('.button').addClass('active');
|
||||
```
|
||||
|
||||
#### jQuery 移除类
|
||||
|
||||
```js
|
||||
$('.button').on('mouseleave', evt => {
|
||||
let e = evt.currentTarget;
|
||||
$(e).removeClass('active');
|
||||
});
|
||||
```
|
||||
|
||||
#### jQuery 切换类
|
||||
|
||||
```js
|
||||
$('.choice').toggleClass('highlighted');
|
||||
```
|
||||
|
||||
### Attributes
|
||||
|
||||
- [.attr()](https://api.jquery.com/attr/) _获取匹配元素集中第一个元素的属性值_<!--rehype:tooltips-->
|
||||
- [.prop()](https://api.jquery.com/prop/) _获取匹配元素集中第一个元素的属性值_<!--rehype:tooltips-->
|
||||
- [.removeAttr()](https://api.jquery.com/removeAttr/) _从匹配元素集中的每个元素中删除一个属性_<!--rehype:tooltips-->
|
||||
- [.removeProp()](https://api.jquery.com/removeProp/) _删除匹配元素集的属性_<!--rehype:tooltips-->
|
||||
- [.val()](https://api.jquery.com/val/) _获取匹配元素集中第一个元素的当前值_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
#### Data
|
||||
|
||||
- [jQuery.data()](https://api.jquery.com/jQuery.data/) _存储与指定元素关联的任意数据。 返回设置的值_<!--rehype:tooltips-->
|
||||
- [.data()](https://api.jquery.com/data/) _存储与匹配元素关联的任意数据_<!--rehype:tooltips-->
|
||||
- [jQuery.hasData()](https://api.jquery.com/jQuery.hasData/) _确定一个元素是否有任何与之关联的 jQuery 数据_<!--rehype:tooltips-->
|
||||
- [jQuery.removeData()](https://api.jquery.com/jQuery.removeData/) _删除以前存储的数据_<!--rehype:tooltips-->
|
||||
- [.removeData()](https://api.jquery.com/removeData/) _删除以前存储的数据_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### CSS
|
||||
|
||||
- [.addClass()](https://api.jquery.com/addClass/) _将指定的类添加到匹配元素集中的每个元素_<!--rehype:tooltips-->
|
||||
- [.hasClass()](https://api.jquery.com/hasClass/) _确定是否有任何匹配的元素被分配给给定的类_<!--rehype:tooltips-->
|
||||
- [.removeClass()](https://api.jquery.com/removeClass/) _从匹配元素集中的每个元素中删除单个类、多个类或所有类_<!--rehype:tooltips-->
|
||||
- [.toggleClass()](https://api.jquery.com/toggleClass/) _根据类的存在或状态参数的值,从匹配元素集中的每个元素添加或删除一个或多个类_<!--rehype:tooltips-->
|
||||
- [.css()](https://api.jquery.com/css/) _获取匹配元素集中第一个元素的计算样式属性_<!--rehype:tooltips-->
|
||||
- [jQuery.cssHooks](https://api.jquery.com/jQuery.cssHooks/) _直接连接到 jQuery 以覆盖特定 CSS 属性的检索或设置方式、标准化 CSS 属性命名或创建自定义属性_<!--rehype:tooltips-->
|
||||
- [jQuery.cssNumber](https://api.jquery.com/jQuery.cssNumber/) _包含所有可以在没有单位的情况下使用的 CSS 属性的对象。`.css()` 方法使用此对象来查看它是否可以将 px 附加到无单位值_<!--rehype:tooltips-->
|
||||
- [jQuery.escapeSelector()](https://api.jquery.com/jQuery.escapeSelector/) _转义任何在 CSS 选择器中具有特殊含义的字符_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### Dimensions
|
||||
|
||||
- [.height()](https://api.jquery.com/height/) _获取匹配元素集中第一个元素的当前计算高度_<!--rehype:tooltips-->
|
||||
- [.innerHeight()](https://api.jquery.com/innerHeight/) _获取匹配元素集中第一个元素的当前计算高度,包括填充但不包括边框_<!--rehype:tooltips-->
|
||||
- [.innerWidth()](https://api.jquery.com/innerWidth/) _获取匹配元素集中第一个元素的当前计算内部宽度,包括填充但不包括边框_<!--rehype:tooltips-->
|
||||
- [.outerHeight()](https://api.jquery.com/outerHeight/) _获取匹配元素集中第一个元素的当前计算外部高度(包括填充、边框和可选的边距)_<!--rehype:tooltips-->
|
||||
- [.outerWidth()](https://api.jquery.com/outerWidth/) _获取匹配元素集中第一个元素的当前计算外部宽度(包括填充、边框和可选的边距)_<!--rehype:tooltips-->
|
||||
- [.width()](https://api.jquery.com/width/) _获取匹配元素集中第一个元素的当前计算宽度_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### Offset
|
||||
|
||||
- [.offset()](https://api.jquery.com/offset/) _获取匹配元素集中第一个元素相对于文档的当前坐标_<!--rehype:tooltips-->
|
||||
- [.offsetParent()](https://api.jquery.com/offsetParent/) _获取定位的最近的祖先元素_<!--rehype:tooltips-->
|
||||
- [.position()](https://api.jquery.com/position/) _获取匹配元素集中第一个元素相对于偏移父元素的当前坐标_<!--rehype:tooltips-->
|
||||
- [.scrollLeft()](https://api.jquery.com/scrollLeft/) _获取匹配元素集中第一个元素的滚动条的当前水平位置_<!--rehype:tooltips-->
|
||||
- [.scrollTop()](https://api.jquery.com/scrollTop/) _获取匹配元素集中第一个元素的滚动条的当前垂直位置,或为每个匹配元素设置滚动条的垂直位置_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
jQuery 操控
|
||||
------------
|
||||
|
||||
### Examples
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
```js
|
||||
/*<span>Span.</span>*/
|
||||
$('span').after('<p>Paragraph.</p>');
|
||||
/*<span>Span.</span><p>Paragraph.</p>*/
|
||||
/*<span>Span.</span>*/
|
||||
$('<span>Span.</span>').replaceAll('p');
|
||||
/*<p>Span.</p>*/
|
||||
/*<span>This is span.</span>*/
|
||||
$('span').wrap('<p></p>');
|
||||
/*<p><span>This is span.</span></p>*/
|
||||
```
|
||||
|
||||
### 复刻
|
||||
|
||||
- [.clone()](https://api.jquery.com/clone/) _创建匹配元素集的深层副本_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### DOM 插入,环绕
|
||||
|
||||
- [.wrap()](https://api.jquery.com/wrap/) _在匹配元素集中的每个元素周围包装一个 HTML 结构_<!--rehype:tooltips-->
|
||||
- [.wrapAll()](https://api.jquery.com/wrapAll/) _在匹配元素集中的所有元素周围包装一个 HTML 结构_<!--rehype:tooltips-->
|
||||
- [.wrapInner()](https://api.jquery.com/wrapInner/) _围绕匹配元素集中每个元素的内容包装一个 HTML 结构_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### DOM 插入,内部
|
||||
|
||||
- [.append()](https://api.jquery.com/append/) _在匹配的元素集中,插入由参数指定的内容插入每个元素的末尾_<!--rehype:tooltips-->
|
||||
- [.appendTo()](https://api.jquery.com/appendTo/) _将匹配元素集中的每个元素插入目标末端_<!--rehype:tooltips-->
|
||||
- [.html()](https://api.jquery.com/html/) _在匹配元素集中获取第一个元素的HTML内容_<!--rehype:tooltips-->
|
||||
- [.prepend()](https://api.jquery.com/prepend/) _插入由参数指定的内容插入匹配元素集中每个元素的开始_<!--rehype:tooltips-->
|
||||
- [.prependTo()](https://api.jquery.com/prependTo/) _将匹配元素集中的每个元素插入目标开始_<!--rehype:tooltips-->
|
||||
- [.text()](https://api.jquery.com/text/) _在匹配的元素集(包括其后代)中获取每个元素的组合文本内容_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### DOM 插入,外部
|
||||
|
||||
- [.after()](https://api.jquery.com/after/) _在匹配元素集中的每个元素之后,插入由参数指定的内容_<!--rehype:tooltips-->
|
||||
- [.before()](https://api.jquery.com/before/) _在匹配元素集中的每个元素之前,插入由参数指定的内容_<!--rehype:tooltips-->
|
||||
- [.insertAfter()](https://api.jquery.com/insertAfter/) _在目标之后插入匹配元素集中的每个元素_<!--rehype:tooltips-->
|
||||
- [.insertBefore()](https://api.jquery.com/insertBefore/) _在目标之前插入匹配元素集中的每个元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### DOM 移除
|
||||
|
||||
- [.detach()](https://api.jquery.com/detach/) _从DOM上删除一组匹配的元素_<!--rehype:tooltips-->
|
||||
- [.empty()](https://api.jquery.com/empty/) _从DOM中删除一组匹配元素的所有子节点_<!--rehype:tooltips-->
|
||||
- [.remove()](https://api.jquery.com/remove/) _从DOM上删除一组匹配的元素_<!--rehype:tooltips-->
|
||||
- [.unwrap()](https://api.jquery.com/unwrap/) _从DOM上删除一组匹配元素的父母,将匹配的元素留在其位置_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### DOM 替换
|
||||
|
||||
- [.replaceAll()](https://api.jquery.com/replaceAll/) _用匹配的元素集替换每个目标元素_<!--rehype:tooltips-->
|
||||
- [.replaceWith()](https://api.jquery.com/replaceWith/) _用提供的新内容替换一组匹配元素中的每个元素,然后返回已删除的元素集_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
jQuery 遍历
|
||||
------------
|
||||
|
||||
### 过滤
|
||||
|
||||
- [.eq()](https://api.jquery.com/eq/) _将匹配的元素集减少到指定索引处的集合_<!--rehype:tooltips-->
|
||||
- [.filter()](https://api.jquery.com/filter/) _将匹配的元素集减少到匹配选择器或传递函数测试的元素_<!--rehype:tooltips-->
|
||||
- [.first()](https://api.jquery.com/first/) _将匹配的元素集减少到集合中的第一个_<!--rehype:tooltips-->
|
||||
- [.has()](https://api.jquery.com/has/) _将匹配的元素集减少到具有与选择器或DOM元素相匹配的后代的元素_<!--rehype:tooltips-->
|
||||
- [.is()](https://api.jquery.com/is/) _检查当前匹配的元素与选择器,元素或jQuery对象的元素集,如果至少其中一个元素与给定参数匹配,则返回true_<!--rehype:tooltips-->
|
||||
- [.last()](https://api.jquery.com/last/) _将匹配的元素集减少到集合中的最后一个元素_<!--rehype:tooltips-->
|
||||
- [.map()](https://api.jquery.com/map/) _将当前匹配的每个元素通过函数传递,从而产生包含返回值的新jQuery对象_<!--rehype:tooltips-->
|
||||
- [.not()](https://api.jquery.com/not/) _从匹配元素集中删除元素_<!--rehype:tooltips-->
|
||||
- [.slice()](https://api.jquery.com/slice/) _将匹配的元素集减少为由一系列索引指定的子集_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 杂项遍历
|
||||
|
||||
- [.add()](https://api.jquery.com/add/) _创建一个新的jQuery对象,其中添加到匹配元素集中的元素_<!--rehype:tooltips-->
|
||||
- [.addBack()](https://api.jquery.com/addBack/) _将堆栈上的上一个元素添加到当前集合中,并由选择器进行过滤_<!--rehype:tooltips-->
|
||||
- [.andSelf()](https://api.jquery.com/andSelf/) _将堆栈上的先前元素添加到当前集合中_<!--rehype:tooltips-->
|
||||
- [.contents()](https://api.jquery.com/contents/) _在一组匹配元素中获取每个元素的孩子,包括文本和评论节点_<!--rehype:tooltips-->
|
||||
- [.each()](https://api.jquery.com/each/) _在jQuery对象上迭代,为每个匹配的元素执行一个函数_<!--rehype:tooltips-->
|
||||
- [.end()](https://api.jquery.com/end/) _结束当前链中最新的过滤操作,并将匹配元素集返回其先前状态_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 树遍历
|
||||
|
||||
- [.children()](https://api.jquery.com/children/) _在一组匹配元素中获取每个元素的孩子,并被选择器进行过滤_<!--rehype:tooltips-->
|
||||
- [.closest()](https://api.jquery.com/closest/) _对于集合中的每个元素,通过测试元素本身并通过其祖先在DOM树中的祖先进行遍历来获取与选择器匹配的第一个元素_<!--rehype:tooltips-->
|
||||
- [.find()](https://api.jquery.com/find/) _在当前匹配元素集中获取每个元素的后代,并由选择器,jQuery对象或元素过滤_<!--rehype:tooltips-->
|
||||
- [.next()](https://api.jquery.com/next/) _在匹配的元素集中,立即获取每个元素的兄弟姐妹。 如果提供了选择器,则仅在匹配该选择器的情况下才能检索下一个兄弟姐妹_<!--rehype:tooltips-->
|
||||
- [.nextAll()](https://api.jquery.com/nextAll/) _在一组匹配元素中获取每个元素的所有以下兄弟姐妹,并由选择器进行过滤_<!--rehype:tooltips-->
|
||||
- [.nextUntil()](https://api.jquery.com/nextUntil/) _将每个元素的所有以下兄弟姐妹添加到,但不包括通过选择器,DOM节点或jQuery对象匹配的元素_<!--rehype:tooltips-->
|
||||
- [.parent()](https://api.jquery.com/parent/) _在当前匹配元素集中获取每个元素的父,由选择器选择过滤_<!--rehype:tooltips-->
|
||||
- [.parents()](https://api.jquery.com/parents/) _在当前匹配元素集中获取每个元素的祖先,并被选择器进行过滤_<!--rehype:tooltips-->
|
||||
- [.parentsUntil()](https://api.jquery.com/parentsUntil/) _在当前匹配元素集中获取每个元素的祖先,直到但不包括由选择器,DOM节点或jQuery对象匹配的元素_<!--rehype:tooltips-->
|
||||
- [.prev()](https://api.jquery.com/prev/) _在匹配元素集中获取每个元素的立即兄弟姐妹。 如果提供了选择器,则仅在匹配该选择器时才检索先前的同胞_<!--rehype:tooltips-->
|
||||
- [.prevAll()](https://api.jquery.com/prevAll/) _在一组匹配元素中获取每个元素的所有先前兄弟姐妹,并由选择器进行过滤_<!--rehype:tooltips-->
|
||||
- [.prevUntil()](https://api.jquery.com/prevUntil/) _将每个元素的所有先前兄弟姐妹添加到,但不包括由选择器,DOM节点或jQuery对象匹配的元素_<!--rehype:tooltips-->
|
||||
- [.siblings()](https://api.jquery.com/siblings/) _在匹配的元素集中获取每个元素的兄弟姐妹,并被选择器进行过滤_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
jQuery 事件
|
||||
------------
|
||||
|
||||
### Examples
|
||||
<!--rehype:wrap-class=row-span-6-->
|
||||
|
||||
```js
|
||||
// 鼠标事件“点击”
|
||||
$('#menu-button').on('click', () => {
|
||||
$('#menu').show();
|
||||
});
|
||||
// 键盘事件“键盘”
|
||||
$('#textbox').on('keyup', () => {
|
||||
$('#menu').show();
|
||||
});
|
||||
// 滚动事件“滚动”
|
||||
$('#menu-button').on('scroll', () => {
|
||||
$('#menu').show();
|
||||
});
|
||||
```
|
||||
|
||||
#### 事件对象
|
||||
|
||||
```js
|
||||
$('#menu').on('click', event => {
|
||||
$(event.currentTarget).hide();
|
||||
});
|
||||
```
|
||||
|
||||
#### 方法链
|
||||
|
||||
```js
|
||||
$('#menu-btn').on('mouseenter', () => {
|
||||
$('#menu').show();
|
||||
}).on('mouseleave', () => {
|
||||
$('#menu').hide();
|
||||
});
|
||||
```
|
||||
|
||||
#### 防止事件
|
||||
|
||||
```js
|
||||
$( "p" ).click(function( event ) {
|
||||
event.stopPropagation();
|
||||
// Do something
|
||||
});
|
||||
```
|
||||
|
||||
### 浏览器事件
|
||||
|
||||
- [.error()](https://api.jquery.com/error/) _将事件处理程序绑定到错误 JavaScript 事件_ <!--rehype:tooltips-->
|
||||
- [.resize()](https://api.jquery.com/resize/) _将事件处理程序绑定到调整大小的 JavaScript 事件,或在元素上触发该事件_ <!--rehype:tooltips-->
|
||||
- [.scroll()](https://api.jquery.com/scroll/) _将事件处理程序绑定到滚动 JavaScript 事件,或在元素上触发该事件_ <!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 事件对象
|
||||
<!--rehype:wrap-class=row-span-6-->
|
||||
|
||||
- [event.currentTarget](https://api.jquery.com/event.currentTarget/) _事件冒泡阶段中的当前 DOM 元素_ <!--rehype:tooltips-->
|
||||
- [event.delegateTarget](https://api.jquery.com/event.delegateTarget/) _附加了当前调用的 jQuery 事件处理程序的元素_ <!--rehype:tooltips-->
|
||||
- [event.data](https://api.jquery.com/event.data/) _绑定当前正在执行的处理程序时传递给事件方法的可选数据对象_ <!--rehype:tooltips-->
|
||||
- [event.isDefaultPrevented()](https://api.jquery.com/event.isDefaultPrevented/) _返回是否曾在此事件对象上调用过 event.preventDefault()_ <!--rehype:tooltips-->
|
||||
- [event.isImmediatePropagationStopped()](https://api.jquery.com/event.isImmediatePropagationStopped/) _返回是否曾在此事件对象上调用过 event.stopImmediatePropagation()_ <!--rehype:tooltips-->
|
||||
- [event.isPropagationStopped()](https://api.jquery.com/event.isPropagationStopped/) _返回是否曾在此事件对象上调用过 event.stopPropagation()_ <!--rehype:tooltips-->
|
||||
- [event.metaKey](https://api.jquery.com/event.metaKey/) _指示事件触发时是否按下了 META 键_ <!--rehype:tooltips-->
|
||||
- [event.namespace](https://api.jquery.com/event.namespace/) _触发事件时指定的命名空间_ <!--rehype:tooltips-->
|
||||
- [event.pageX](https://api.jquery.com/event.pageX/) _鼠标相对于文档左边缘的位置_ <!--rehype:tooltips-->
|
||||
- [event.pageY](https://api.jquery.com/event.pageY/) _鼠标位置相对于文档的上边缘_ <!--rehype:tooltips-->
|
||||
- [event.preventDefault()](https://api.jquery.com/event.preventDefault/) _如果调用该方法,则不会触发事件的默认动作_ <!--rehype:tooltips-->
|
||||
- [event.relatedTarget](https://api.jquery.com/event.relatedTarget/) _事件中涉及的其他 DOM 元素(如果有)_ <!--rehype:tooltips-->
|
||||
- [event.result](https://api.jquery.com/event.result/) _由此事件触发的事件处理程序返回的最后一个值,除非该值未定义_ <!--rehype:tooltips-->
|
||||
- [event.stopImmediatePropagation()](https://api.jquery.com/event.stopImmediatePropagation/) _保持其余的处理程序不被执行,并防止事件在 DOM 树中向上冒泡_ <!--rehype:tooltips-->
|
||||
- [event.stopPropagation()](https://api.jquery.com/event.stopPropagation/) _防止事件在 DOM 树中向上冒泡,从而防止任何父处理程序收到事件通知_ <!--rehype:tooltips-->
|
||||
- [event.target](https://api.jquery.com/event.target/) _发起事件的 DOM 元素_ <!--rehype:tooltips-->
|
||||
- [event.timeStamp](https://api.jquery.com/event.timeStamp/) _浏览器创建事件的时间与 1970 年 1 月 1 日之间的毫秒差_ <!--rehype:tooltips-->
|
||||
- [event.type](https://api.jquery.com/event.type/) _描述事件的性质_ <!--rehype:tooltips-->
|
||||
- [event.which](https://api.jquery.com/event.which/) _对于键或鼠标事件,此属性指示按下的特定键或按钮_ <!--rehype:tooltips-->
|
||||
<!--rehype:className=style-none-->
|
||||
|
||||
### 文档加载
|
||||
|
||||
- [.load()](https://api.jquery.com/load-event/) _将事件处理程序绑定到加载 JavaScript 事件_<!--rehype:tooltips-->
|
||||
- [.ready()](https://api.jquery.com/ready/) _指定在 DOM 完全加载时执行的函数_<!--rehype:tooltips-->
|
||||
- [.unload()](https://api.jquery.com/unload/) _将事件处理程序绑定到卸载 JavaScript 事件_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 事件处理程序附件
|
||||
|
||||
- [.bind()](https://api.jquery.com/bind/) _将处理程序附加到元素的事件_<!--rehype:tooltips-->
|
||||
- [.delegate()](https://api.jquery.com/delegate/) _基于一组特定的根元素,将处理程序附加到现在或将来与选择器匹配的所有元素的一个或多个事件_<!--rehype:tooltips-->
|
||||
- [.die()](https://api.jquery.com/die/) _从元素中删除先前使用 .live() 附加的事件处理程序_<!--rehype:tooltips-->
|
||||
- [.live()](https://api.jquery.com/live/) _现在和将来为所有匹配当前选择器的元素附加一个事件处理程序_<!--rehype:tooltips-->
|
||||
- [.off()](https://api.jquery.com/off/) _删除事件处理程序_<!--rehype:tooltips-->
|
||||
- [.on()](https://api.jquery.com/on/) _将一个或多个事件的事件处理函数附加到所选元素_<!--rehype:tooltips-->
|
||||
- [.one()](https://api.jquery.com/one/) _将处理程序附加到元素的事件。 每个事件类型的每个元素最多执行一次处理程序_<!--rehype:tooltips-->
|
||||
- [.trigger()](https://api.jquery.com/trigger/) _执行附加到给定事件类型的匹配元素的所有处理程序和行为_<!--rehype:tooltips-->
|
||||
- [.triggerHandler()](https://api.jquery.com/triggerHandler/) _执行附加到事件元素的所有处理程序_<!--rehype:tooltips-->
|
||||
- [.unbind()](https://api.jquery.com/unbind/) _从元素中删除先前附加的事件处理程序_<!--rehype:tooltips-->
|
||||
- [.undelegate()](https://api.jquery.com/undelegate/) _根据一组特定的根元素,从与当前选择器匹配的所有元素的事件中删除处理程序_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 形式事件
|
||||
|
||||
- [.blur()](https://api.jquery.com/blur/) _将事件处理程序绑定到 blur JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.change()](https://api.jquery.com/change/) _将事件处理程序绑定到更改 JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.focus()](https://api.jquery.com/focus/) _将事件处理程序绑定到焦点 JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.focusin()](https://api.jquery.com/focusin/) _将事件处理程序绑定到 focusin 事件_<!--rehype:tooltips-->
|
||||
- [.focusout()](https://api.jquery.com/focusout/) _将事件处理程序绑定到 focusout JavaScript 事件_<!--rehype:tooltips-->
|
||||
- [.select()](https://api.jquery.com/select/) _将事件处理程序绑定到 select JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.submit()](https://api.jquery.com/submit/) _将事件处理程序绑定到提交 JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 键盘事件
|
||||
|
||||
- [.keydown()](https://api.jquery.com/keydown/) _将事件处理程序绑定到 keydown JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.keypress()](https://api.jquery.com/keypress/) _将事件处理程序绑定到按键 JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.keyup()](https://api.jquery.com/keyup/) _将事件处理程序绑定到 keyup JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 鼠标事件
|
||||
|
||||
- [.click()](https://api.jquery.com/click/) _将事件处理程序绑定到 click JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.contextMenu()](https://api.jquery.com/contextmenu/) _将事件处理程序绑定到 contextmenu JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.dblclick()](https://api.jquery.com/dblclick/) _将事件处理程序绑定到 dblclick JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.hover()](https://api.jquery.com/hover/) _将两个处理程序绑定到匹配的元素,当鼠标指针进入和离开元素时执行_<!--rehype:tooltips-->
|
||||
- [.mousedown()](https://api.jquery.com/mousedown/) _将事件处理程序绑定到 mousedown JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.mouseenter()](https://api.jquery.com/mouseenter/) _绑定要在鼠标进入元素时触发的事件处理程序,或在元素上触发该处理程序_<!--rehype:tooltips-->
|
||||
- [.mouseleave()](https://api.jquery.com/mouseleave/) _绑定要在鼠标离开元素时触发的事件处理程序,或在元素上触发该处理程序_<!--rehype:tooltips-->
|
||||
- [.mousemove()](https://api.jquery.com/mousemove/) _将事件处理程序绑定到 mousemove JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.mouseout()](https://api.jquery.com/mouseout/) _将事件处理程序绑定到 mouseout JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.mouseover()](https://api.jquery.com/mouseover/) _将事件处理程序绑定到 mouseover JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.mouseup()](https://api.jquery.com/mouseup/) _将事件处理程序绑定到 mouseup JavaScript 事件,或在元素上触发该事件_<!--rehype:tooltips-->
|
||||
- [.toggle()](https://api.jquery.com/toggle-event/) _将两个或多个处理程序绑定到匹配的元素,以在交替单击时执行_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
jQuery Effects
|
||||
------------
|
||||
|
||||
### 例子
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```js
|
||||
$('#menu-button').on('click', () => {
|
||||
// $('#menu').fadeIn(400, 'swing')
|
||||
$('#menu').fadeIn();
|
||||
});
|
||||
```
|
||||
|
||||
#### 淡出效果
|
||||
|
||||
```js
|
||||
$('#menu-button').on('click', () => {
|
||||
// $('#menu').fadeOut(400, 'swing')
|
||||
$('#menu').fadeOut();
|
||||
});
|
||||
```
|
||||
|
||||
### 基本
|
||||
|
||||
- [.hide()](https://api.jquery.com/hide/) _隐藏匹配的元素_<!--rehype:tooltips-->
|
||||
- [.show()](https://api.jquery.com/show/) _显示匹配的元素_<!--rehype:tooltips-->
|
||||
- [.toggle()](https://api.jquery.com/toggle/) _显示或隐藏匹配的元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 滑动
|
||||
|
||||
- [.slideDown()](https://api.jquery.com/slideDown/) _以滑动方式显示匹配的元素_<!--rehype:tooltips-->
|
||||
- [.slideToggle()](https://api.jquery.com/slideToggle/) _通过滑动显示或隐藏匹配的元素_<!--rehype:tooltips-->
|
||||
- [.slideUp()](https://api.jquery.com/slideUp/) _通过滑动隐藏匹配的元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 自定义
|
||||
|
||||
- [.animate()](https://api.jquery.com/animate/) _执行一组 CSS 属性的自定义动画_<!--rehype:tooltips-->
|
||||
- [.clearQueue()](https://api.jquery.com/clearQueue/) _从队列中删除所有尚未运行的项目_<!--rehype:tooltips-->
|
||||
- [.delay()](https://api.jquery.com/delay/) _设置一个计时器来延迟队列中后续项目的执行_<!--rehype:tooltips-->
|
||||
- [.dequeue()](https://api.jquery.com/dequeue/) _为匹配的元素执行队列上的下一个函数_<!--rehype:tooltips-->
|
||||
- [jQuery.dequeue()](https://api.jquery.com/jQuery.dequeue/) _为匹配的元素执行队列上的下一个函数_<!--rehype:tooltips-->
|
||||
- [.finish()](https://api.jquery.com/finish/) _停止当前运行的动画,移除所有排队的动画,并完成匹配元素的所有动画_<!--rehype:tooltips-->
|
||||
- [jQuery.fx.interval](https://api.jquery.com/jQuery.fx.interval/) _动画触发的速率(以毫秒为单位)_<!--rehype:tooltips-->
|
||||
- [jQuery.fx.off](https://api.jquery.com/jQuery.fx.off/) _全局禁用所有动画_<!--rehype:tooltips-->
|
||||
- [jQuery.speed](https://api.jquery.com/jQuery.speed/) _创建一个对象,其中包含一组准备用于自定义动画定义的属性_<!--rehype:tooltips-->
|
||||
- [.queue()](https://api.jquery.com/queue/) _显示要在匹配元素上执行的函数队列_<!--rehype:tooltips-->
|
||||
- [jQuery.queue()](https://api.jquery.com/jQuery.queue/) _显示要在匹配元素上执行的函数队列_<!--rehype:tooltips-->
|
||||
- [.stop()](https://api.jquery.com/stop/) _停止匹配元素上当前运行的动画_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
### 衰退
|
||||
|
||||
- [.fadeIn()](https://api.jquery.com/fadeIn/) _通过将匹配的元素淡化为不透明来显示它们_<!--rehype:tooltips-->
|
||||
- [.fadeOut()](https://api.jquery.com/fadeOut/) _通过将它们淡化为透明来隐藏匹配的元素_<!--rehype:tooltips-->
|
||||
- [.fadeTo()](https://api.jquery.com/fadeTo/) _调整匹配元素的不透明度_<!--rehype:tooltips-->
|
||||
- [.fadeToggle()](https://api.jquery.com/fadeToggle/) _通过设置不透明度动画来显示或隐藏匹配的元素_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-3 style-none-->
|
||||
|
||||
jQuery Ajax
|
||||
------------
|
||||
|
||||
### Examples
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```js
|
||||
$.ajax({
|
||||
url: this.action,
|
||||
type: this.method,
|
||||
data: $(this).serialize()
|
||||
}).done(function(server_data){
|
||||
console.log("success" + server_data);
|
||||
}).fail(function(jqXHR, status, err){
|
||||
console.log("fail" + err);
|
||||
});
|
||||
```
|
||||
|
||||
### 全局 Ajax 事件处理程序
|
||||
|
||||
- [.ajaxComplete()](https://api.jquery.com/ajaxComplete/) _注册要在 Ajax 请求完成时调用的处理程序。 这是一个 AjaxEvent_<!--rehype:tooltips-->
|
||||
- [.ajaxError()](https://api.jquery.com/ajaxError/) _注册一个处理程序,当 Ajax 请求完成但出现错误时调用。 这是一个 Ajax 事件_<!--rehype:tooltips-->
|
||||
- [.ajaxSend()](https://api.jquery.com/ajaxSend/) _附加一个要在发送 Ajax 请求之前执行的函数。 这是一个 Ajax 事件_<!--rehype:tooltips-->
|
||||
- [.ajaxStart()](https://api.jquery.com/ajaxStart/) _注册一个处理程序,在第一个 Ajax 请求开始时调用。 这是一个 Ajax 事件_<!--rehype:tooltips-->
|
||||
- [.ajaxStop()](https://api.jquery.com/ajaxStop/) _注册一个处理程序,在所有 Ajax 请求完成时调用。 这是一个 Ajax 事件_<!--rehype:tooltips-->
|
||||
- [.ajaxSuccess()](https://api.jquery.com/ajaxSuccess/) _附加一个要在 Ajax 请求成功完成时执行的函数。 这是一个 Ajax 事件_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 辅助功能
|
||||
|
||||
- [jQuery.param()](https://api.jquery.com/jQuery.param/) _创建适合在 URL 查询字符串或 Ajax 请求中使用的数组、普通对象或 jQuery 对象的序列化表示。 如果传递了 jQuery 对象,它应该包含具有名称/值属性的输入元素_<!--rehype:tooltips-->
|
||||
- [.serialize()](https://api.jquery.com/serialize/) _将一组表单元素编码为字符串以供提交_<!--rehype:tooltips-->
|
||||
- [.serializeArray()](https://api.jquery.com/serializeArray/) _将一组表单元素编码为名称和值的数组_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 底层接口
|
||||
|
||||
- [jQuery.ajax()](https://api.jquery.com/jQuery.ajax/) _执行异步 HTTP (Ajax) 请求_<!--rehype:tooltips-->
|
||||
- [jQuery.prefilter()](https://api.jquery.com/jQuery.ajaxPrefilter/) _在发送每个请求之前和 $.ajax() 处理它们之前处理自定义 Ajax 选项或修改现有选项_<!--rehype:tooltips-->
|
||||
- [jQuery.ajaxSetup()](https://api.jquery.com/jQuery.ajaxSetup/) _为将来的 Ajax 请求设置默认值。 不推荐使用它_<!--rehype:tooltips-->
|
||||
- [jQuery.ajaxTransport()](https://api.jquery.com/jQuery.ajaxTransport/) _创建一个对象来处理 Ajax 数据的实际传输_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 速记方法
|
||||
|
||||
- [jQuery.get()](https://api.jquery.com/jQuery.get/) _使用 HTTP GET 请求从服务器加载数据_<!--rehype:tooltips-->
|
||||
- [jQuery.getJSON()](https://api.jquery.com/jQuery.getJSON/) _使用 GET HTTP 请求从服务器加载 JSON 编码的数据_<!--rehype:tooltips-->
|
||||
- [jQuery.getScript()](https://api.jquery.com/jQuery.getScript/) _使用 GET HTTP 请求从服务器加载 JavaScript 文件,然后执行它_<!--rehype:tooltips-->
|
||||
- [jQuery.post()](https://api.jquery.com/jQuery.post/) _使用 HTTP POST 请求将数据发送到服务器_<!--rehype:tooltips-->
|
||||
- [.load()](https://api.jquery.com/load/) _从服务器加载数据并将返回的 HTML 放入匹配的元素中_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
各种各样的
|
||||
------------
|
||||
|
||||
### jQuery 对象
|
||||
|
||||
- [jQuery()](https://api.jquery.com/jQuery/) _接受包含 CSS 选择器的字符串,然后用于匹配一组元_<!--rehype:tooltips-->
|
||||
- [jQuery.noConflict()](https://api.jquery.com/jQuery.noConflict/) _放弃 jQuery 对 $ 变量的控_<!--rehype:tooltips-->
|
||||
- [jQuery.sub()](https://api.jquery.com/jQuery.sub/) _创建一个新的 jQuery 副本,可以在不影响原始 jQuery 对象的情况下修改其属性和方_<!--rehype:tooltips-->
|
||||
- [jQuery.holdReady()](https://api.jquery.com/jQuery.holdReady/) _持有或释放jQuery的就绪事件的执_<!--rehype:tooltips-->
|
||||
- [jQuery.when()](https://api.jquery.com/jQuery.when/) _提供一种基于零个或多个 Thenable 对象执行回调函数的方法,通常是表示异步事件的 Deferred 对_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 延迟对象
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
- [jQuery.Deferred()](https://api.jquery.com/jQuery.Deferred/) _返回可链接实用程序对象的工厂函数,该对象具有将多个回调注册到回调队列、调用回调队列以及中继任何同步或异步函数的成功或失败状态的方法_<!--rehype:tooltips-->
|
||||
- [deferred.always()](https://api.jquery.com/deferred.always/) _添加要在延迟对象被解析或拒绝时调用的处理程序_<!--rehype:tooltips-->
|
||||
- [deferred.done()](https://api.jquery.com/deferred.done/) _添加要在解析延迟对象时调用的处理程序_<!--rehype:tooltips-->
|
||||
- [deferred.fail()](https://api.jquery.com/deferred.fail/) _添加处理程序以在延迟对象被拒绝时调用_<!--rehype:tooltips-->
|
||||
- [deferred.isRejected()](https://api.jquery.com/deferred.isRejected/) _判断一个 Deferred 对象是否被拒绝_<!--rehype:tooltips-->
|
||||
- [deferred.isResolved()](https://api.jquery.com/deferred.isResolved/) _判断一个 Deferred 对象是否已经解析_<!--rehype:tooltips-->
|
||||
- [deferred.notify()](https://api.jquery.com/deferred.notify/) _使用给定的 args 在 Deferred 对象上调用 progressCallbacks_<!--rehype:tooltips-->
|
||||
- [deferred.notifyWith()](https://api.jquery.com/deferred.notifyWith/) _使用给定的上下文和参数调用 Deferred 对象的 progressCallbacks_<!--rehype:tooltips-->
|
||||
- [deferred.pipe()](https://api.jquery.com/deferred.pipe/) _过滤和/或链接 Deferreds 的实用方法_<!--rehype:tooltips-->
|
||||
- [deferred.progress()](https://api.jquery.com/deferred.progress/) _添加在 Deferred 对象生成进度通知时要调用的处理程序_<!--rehype:tooltips-->
|
||||
- [deferred.promise()](https://api.jquery.com/deferred.promise/) _返回一个 Deferred 的 Promise 对象_<!--rehype:tooltips-->
|
||||
- [deferred.reject()](https://api.jquery.com/deferred.reject/) _拒绝 Deferred 对象并使用给定的 args 调用任何 failCallbacks_<!--rehype:tooltips-->
|
||||
- [deferred.rejectWith()](https://api.jquery.com/deferred.rejectWith/) _拒绝 Deferred 对象并使用给定的上下文和参数调用任何 failCallbacks_<!--rehype:tooltips-->
|
||||
- [deferred.resolve()](https://api.jquery.com/deferred.resolve/) _解析一个 Deferred 对象并使用给定的 args 调用任何 doneCallbacks_<!--rehype:tooltips-->
|
||||
- [deferred.resolveWith()](https://api.jquery.com/deferred.resolveWith/) _解析延迟对象并使用给定的上下文和参数调用任何 doneCallbacks_<!--rehype:tooltips-->
|
||||
- [deferred.state()](https://api.jquery.com/deferred.state/) _确定 Deferred 对象的当前状态_<!--rehype:tooltips-->
|
||||
- [deferred.then()](https://api.jquery.com/deferred.then/) _添加要在延迟对象被解析、拒绝或仍在进行中时调用的处理程序_<!--rehype:tooltips-->
|
||||
- [.promise()](https://api.jquery.com/promise/) _返回一个 Promise 对象以观察绑定到集合的特定类型的所有操作(无论是否排队)何时完成_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 公用事业
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
- [jQuery.boxModel](https://api.jquery.com/jQuery.boxModel/) _说明用户浏览器中的当前页面是否正在使用 W3C CSS 盒模型呈现_<!--rehype:tooltips-->
|
||||
- [jQuery.browser](https://api.jquery.com/jQuery.browser/) _包含用户代理的标志,从 navigator.userAgent 读取。 此属性在 jQuery 1.9 中被删除,只能通过 jQuery.migrate 插件使用。 请尝试改用特征检测_<!--rehype:tooltips-->
|
||||
- [jQuery.contains()](https://api.jquery.com/jQuery.contains/) _检查一个 DOM 元素是否是另一个 DOM 元素的后代_<!--rehype:tooltips-->
|
||||
- [jQuery.each()](https://api.jquery.com/jQuery.each/) _通用迭代器函数,可用于无缝迭代对象和数组。 具有长度属性的数组和类似数组的对象(例如函数的参数对象)按数字索引迭代,从 0 到 length-1。 其他对象通过它们的命名属性迭代_<!--rehype:tooltips-->
|
||||
- [jQuery.extend()](https://api.jquery.com/jQuery.extend/) _将两个或多个对象的内容合并到第一个对象中_<!--rehype:tooltips-->
|
||||
- [jQuery.globalEval()](https://api.jquery.com/jQuery.globalEval/) _全局执行一些 JavaScript 代码_<!--rehype:tooltips-->
|
||||
- [jQuery.grep()](https://api.jquery.com/jQuery.grep/) _查找满足过滤功能的数组元素。 原数组不受影响_<!--rehype:tooltips-->
|
||||
- [jQuery.inArray()](https://api.jquery.com/jQuery.inArray/) _在数组中搜索指定值并返回其索引(如果未找到,则返回 -1)_<!--rehype:tooltips-->
|
||||
- [jQuery.isArray()](https://api.jquery.com/jQuery.isArray/) _判断参数是否为数组_<!--rehype:tooltips-->
|
||||
- [jQuery.isEmptyObject()](https://api.jquery.com/jQuery.isEmptyObject/) _检查对象是否为空(不包含可枚举属性)_<!--rehype:tooltips-->
|
||||
- [jQuery.isFunction()](https://api.jquery.com/jQuery.isFunction/) _确定其参数是否可作为函数调用_<!--rehype:tooltips-->
|
||||
- [jQuery.isNumeric()](https://api.jquery.com/jQuery.isNumeric/) _确定其参数是否表示 JavaScript 数字_<!--rehype:tooltips-->
|
||||
- [jQuery.isPlainObject()](https://api.jquery.com/jQuery.isPlainObject/) _检查对象是否为普通对象_<!--rehype:tooltips-->
|
||||
- [jQuery.isWindow()](https://api.jquery.com/jQuery.isWindow/) _判断参数是否为窗口_<!--rehype:tooltips-->
|
||||
- [jQuery.isXMLDoc()](https://api.jquery.com/jQuery.isXMLDoc/) _检查 DOM 节点是否在 XML 文档中(或者是 XML 文档)_<!--rehype:tooltips-->
|
||||
- [jQuery.makeArray()](https://api.jquery.com/jQuery.makeArray/) _将类数组对象转换为真正的 JavaScript 数组_<!--rehype:tooltips-->
|
||||
- [jQuery.map()](https://api.jquery.com/jQuery.map/) _将数组或对象中的所有项转换为新的项数组_<!--rehype:tooltips-->
|
||||
- [jQuery.merge()](https://api.jquery.com/jQuery.merge/) _将两个数组的内容合并到第一个数组中_<!--rehype:tooltips-->
|
||||
- [jQuery.noop()](https://api.jquery.com/jQuery.noop/) _空函数_<!--rehype:tooltips-->
|
||||
- [jQuery.now()](https://api.jquery.com/jQuery.now/) _返回代表当前时间的数字_<!--rehype:tooltips-->
|
||||
- [jQuery.parseHTML()](https://api.jquery.com/jQuery.parseHTML/) _将字符串解析为 DOM 节点数组_<!--rehype:tooltips-->
|
||||
- [jQuery.parseJSON()](https://api.jquery.com/jQuery.parseJSON/) _获取格式正确的 JSON 字符串并返回生成的 JavaScript 值_<!--rehype:tooltips-->
|
||||
- [jQuery.parseXML()](https://api.jquery.com/jQuery.parseXML/) _将字符串解析为 XML 文档_<!--rehype:tooltips-->
|
||||
- [jQuery.proxy()](https://api.jquery.com/jQuery.proxy/) _接受一个函数并返回一个总是有特定上下文的新函数_<!--rehype:tooltips-->
|
||||
- [jQuery.support](https://api.jquery.com/jQuery.support/) _表示存在不同浏览器功能或错误的属性集合。 用于 jQuery 的内部使用; 当内部不再需要特定属性以提高页面启动性能时,可能会删除它们。 对于您自己项目的功能检测需求,我们强烈建议使用外部库(例如 Modernizr),而不是依赖于 jQuery.support 中的属性_<!--rehype:tooltips-->
|
||||
- [jQuery.trim()](https://api.jquery.com/jQuery.trim/) _删除字符串开头和结尾的空格_<!--rehype:tooltips-->
|
||||
- [jQuery.type()](https://api.jquery.com/jQuery.type/) _确定对象的内部 JavaScript [[Class]]_<!--rehype:tooltips-->
|
||||
- [jQuery.unique()](https://api.jquery.com/jQuery.unique/) _对 DOM 元素数组进行适当的排序,并删除重复项。 请注意,这仅适用于 DOM 元素数组,不适用于字符串或数字_<!--rehype:tooltips-->
|
||||
- [jQuery.uniqueSort()](https://api.jquery.com/jQuery.uniqueSort/) _对 DOM 元素数组进行适当的排序,并删除重复项。 请注意,这仅适用于 DOM 元素数组,不适用于字符串或数字_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### DOM 元素方法
|
||||
|
||||
- [.get()](https://api.jquery.com/get/) _检索与 jQuery 对象匹配的元素之一_<!--rehype:tooltips-->
|
||||
- [.index()](https://api.jquery.com/index/) _从匹配的元素中搜索给定的元素_<!--rehype:tooltips-->
|
||||
- [.size()](https://api.jquery.com/size/) _返回 jQuery 对象中元素的数量_<!--rehype:tooltips-->
|
||||
- [.toArray()](https://api.jquery.com/toArray/) _检索 jQuery 集合中包含的所有元素,作为数组_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 内部结构
|
||||
|
||||
- [.jquery](https://api.jquery.com/jquery-2/) _包含 jQuery 版本号的字符串_<!--rehype:tooltips-->
|
||||
- [.context](https://api.jquery.com/context/) _最初传递给 jQuery() 的 DOM 节点上下文; 如果未通过,则上下文可能是文档_<!--rehype:tooltips-->
|
||||
- [jQuery.error()](https://api.jquery.com/jQuery.error/) _获取一个字符串并抛出包含它的异常_<!--rehype:tooltips-->
|
||||
- [.length](https://api.jquery.com/length/) _jQuery 对象中元素的数量_<!--rehype:tooltips-->
|
||||
- [.pushStack()](https://api.jquery.com/pushStack/) _将一组 DOM 元素添加到 jQuery 堆栈中_<!--rehype:tooltips-->
|
||||
- [.selector](https://api.jquery.com/selector/) _代表选择器的选择器在创建原始集合时传递给 jQuery(),如果有的话_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
||||
|
||||
### 回调对象
|
||||
|
||||
- [jQuery.Callbacks()](https://api.jquery.com/jQuery.Callbacks/) _一个多用途回调列表对象,提供了一种管理回调列表的强大方法_<!--rehype:tooltips-->
|
||||
- [callbacks.add()](https://api.jquery.com/callbacks.add/) _将回调或回调集合添加到回调列表_<!--rehype:tooltips-->
|
||||
- [callbacks.disable()](https://api.jquery.com/callbacks.disable/) _禁止回调列表做更多的事情_<!--rehype:tooltips-->
|
||||
- [callbacks.disabled()](https://api.jquery.com/callbacks.disabled/) _确定回调列表是否已被禁用_<!--rehype:tooltips-->
|
||||
- [callbacks.empty()](https://api.jquery.com/callbacks.empty/) _从列表中删除所有回调_<!--rehype:tooltips-->
|
||||
- [callbacks.fire()](https://api.jquery.com/callbacks.fire/) _使用给定参数调用所有回调_<!--rehype:tooltips-->
|
||||
- [callbacks.fired()](https://api.jquery.com/callbacks.fired/) _确定回调是否已至少被调用一次_<!--rehype:tooltips-->
|
||||
- [callbacks.fireWith()](https://api.jquery.com/callbacks.fireWith/) _使用给定的上下文和参数调用列表中的所有回调_<!--rehype:tooltips-->
|
||||
- [callbacks.has()](https://api.jquery.com/callbacks.has/) _确定列表是否附加了任何回调。如果回调作为参数提供,请确定它是否在列表中_<!--rehype:tooltips-->
|
||||
- [callbacks.lock()](https://api.jquery.com/callbacks.lock/) _将回调列表锁定在其当前状态_<!--rehype:tooltips-->
|
||||
- [callbacks.locked()](https://api.jquery.com/callbacks.locked/) _判断回调列表是否被锁定_<!--rehype:tooltips-->
|
||||
- [callbacks.remove()](https://api.jquery.com/callbacks.remove/) _从回调列表中删除回调或回调集合_<!--rehype:tooltips-->
|
||||
<!--rehype:className=cols-2 style-none-->
|
@ -1,7 +1,7 @@
|
||||
Julia 备忘清单
|
||||
===
|
||||
|
||||
本备忘清单旨在快速理解 [Julia](https://mysql.com) 一份简单而粗略的语言概览,供您参考。
|
||||
本备忘清单旨在快速理解 [Julia](https://julialang.org/) 一份简单而粗略的语言概览,供您参考。
|
||||
|
||||
入门
|
||||
---
|
||||
@ -678,4 +678,5 @@ names(ModuleName, all::Bool, imported::Bool)
|
||||
另见
|
||||
---
|
||||
|
||||
- [快速入门一份简单而粗略的语言概览](https://cheatsheet.juliadocs.org/zh-cn/)
|
||||
- [Julia 官方网站](https://julialang.org/) _(julialang.org)_
|
||||
- [快速入门一份简单而粗略的语言概览](https://cheatsheet.juliadocs.org/zh-cn/) _(juliadocs.org)_
|
||||
|
@ -1,7 +1,13 @@
|
||||
Koajs 备忘清单
|
||||
===
|
||||
|
||||
基于 Node.js 平台的下一代 web 开发框架,包含 [Koa](https://koajs.com/) 的 API 参考列表和一些示例。
|
||||
[](https://npmjs.org/package/koa)
|
||||
[](https://www.npmjs.com/package/koa)
|
||||
[](https://github.com/koajs/koa/network/dependents)
|
||||
[](https://github.com/koajs/koa)
|
||||
|
||||
基于 Node.js 平台的下一代 web 开发框架,包含 [Koa](https://koajs.com/) 的 API 参考列表和一些示例
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
---
|
||||
|
@ -350,7 +350,7 @@ when(grade) {
|
||||
var height = 46 // inches
|
||||
|
||||
if (height in 1..53) {
|
||||
println("抱歉,您必须至少 54 英寸才能乘坐过山车")
|
||||
println("抱歉,您必须至少 54 英寸才能乘坐过山车")
|
||||
}
|
||||
// Prints: 抱歉,您必须至少 54 英寸才能乘坐过山车
|
||||
```
|
||||
|
342
docs/kubernetes.md
Normal file
@ -0,0 +1,342 @@
|
||||
Kubernetes 备忘清单
|
||||
===
|
||||
|
||||
查看资源信息
|
||||
---
|
||||
|
||||
### 节点
|
||||
|
||||
资源名称: nodes, 缩写: no
|
||||
|
||||
```bash
|
||||
$ kubectl get no # 显示所有节点信息
|
||||
$ kubectl get no -o wide # 显示所有节点的更多信息
|
||||
$ kubectl describe no # 显示节点详情
|
||||
$ kubectl get no -o yaml # 以yaml格式,显示节点详情
|
||||
$ kubectl get node --selector=[label_name] # 筛选指定标签的节点
|
||||
$ kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
|
||||
# 输出jsonpath表达式定义的字段信息
|
||||
$ kubectl top node [node_name] # 显示节点(CPU/内存/存储)使用情况
|
||||
```
|
||||
|
||||
### 容器组
|
||||
|
||||
资源名称: pods, 缩写: po
|
||||
|
||||
```bash
|
||||
$ kubectl get po # 显示所有容器组信息
|
||||
$ kubectl get po -o wide
|
||||
$ kubectl describe po
|
||||
$ 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
|
||||
$ kubectl get pod [pod_name] -o yaml --export > nameoffile.yaml
|
||||
# 以yaml格式导出容器组信息到yaml文件
|
||||
$ kubectl get pods --field-selector status.phase=Running
|
||||
# 使用字段选择器筛选出容器组信息
|
||||
```
|
||||
|
||||
### 命名空间
|
||||
|
||||
资源名称: namespaces, 缩写: ns
|
||||
|
||||
```bash
|
||||
$ kubectl get ns
|
||||
$ kubectl get ns -o yaml
|
||||
$ kubectl describe ns
|
||||
```
|
||||
|
||||
### 无状态
|
||||
|
||||
资源名称: deployments, 缩写: deploy
|
||||
|
||||
```bash
|
||||
$ kubectl get deploy
|
||||
$ kubectl describe deploy
|
||||
$ kubectl get deploy -o wide
|
||||
$ kubectl get deploy -o yaml
|
||||
```
|
||||
|
||||
### 服务
|
||||
|
||||
资源名称: services, 缩写: svc
|
||||
|
||||
```bash
|
||||
$ kubectl get svc
|
||||
$ kubectl describe svc
|
||||
$ kubectl get svc -o wide
|
||||
$ kubectl get svc -o yaml
|
||||
$ kubectl get svc --show-labels
|
||||
```
|
||||
|
||||
### 守护进程集
|
||||
|
||||
资源名称: daemonsets, 缩写: ds
|
||||
|
||||
```bash
|
||||
$ kubectl get ds
|
||||
$ kubectl describe ds --all-namespaces
|
||||
$ kubectl describe ds [daemonset_name] -n [namespace_name]
|
||||
$ kubectl get ds [ds_name] -n [ns_name] -o yaml
|
||||
```
|
||||
|
||||
### 事件
|
||||
|
||||
资源名称: events, 缩写: ev
|
||||
|
||||
```bash
|
||||
$ kubectl get events
|
||||
$ kubectl get events -n kube-system
|
||||
$ kubectl get events -w
|
||||
```
|
||||
|
||||
### 日志
|
||||
|
||||
```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 [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
|
||||
|
||||
```bash
|
||||
$ kubectl get rs
|
||||
$ kubectl describe rs
|
||||
$ kubectl get rs -o wide
|
||||
$ kubectl get rs -o yaml
|
||||
```
|
||||
|
||||
### 角色
|
||||
|
||||
```bash
|
||||
$ kubectl get roles --all-namespaces
|
||||
$ kubectl get roles --all-namespaces -o yaml
|
||||
```
|
||||
|
||||
### 保密字典
|
||||
|
||||
```bash
|
||||
$ kubectl get secrets
|
||||
$ kubectl get secrets --all-namespaces
|
||||
$ kubectl get secrets -o yaml
|
||||
```
|
||||
|
||||
### 配置项
|
||||
|
||||
资源名称: configmaps, 缩写: cm
|
||||
|
||||
```bash
|
||||
$ kubectl get cm
|
||||
$ kubectl get cm --all-namespaces
|
||||
$ kubectl get cm --all-namespaces -o yaml
|
||||
```
|
||||
|
||||
### 路由
|
||||
|
||||
资源名称: ingresses, 缩写: ing
|
||||
|
||||
```bash
|
||||
$ kubectl get ing
|
||||
$ kubectl get ing --all-namespaces
|
||||
```
|
||||
|
||||
### 持久卷
|
||||
|
||||
资源名称: persistentvolumes, 缩写: pv
|
||||
|
||||
```bash
|
||||
$ kubectl get pv
|
||||
$ kubectl describe pv
|
||||
```
|
||||
|
||||
### 持久卷声明
|
||||
|
||||
资源名称: persistentvolumeclaims, 缩写: pvc
|
||||
|
||||
```bash
|
||||
$ kubectl get pvc
|
||||
$ kubectl describe pvc
|
||||
```
|
||||
|
||||
### 存储类
|
||||
|
||||
资源名称: storageclasses, 缩写: sc
|
||||
|
||||
```bash
|
||||
$ kubectl get sc
|
||||
$ kubectl get sc -o yaml
|
||||
```
|
||||
|
||||
### 多个资源
|
||||
|
||||
```bash
|
||||
$ kubectl get svc, po
|
||||
$ kubectl get deploy, no
|
||||
$ kubectl get all
|
||||
$ kubectl get all --all-namespaces
|
||||
```
|
||||
|
||||
变更资源属性
|
||||
---
|
||||
|
||||
### 污点
|
||||
|
||||
```bash
|
||||
$ kubectl taint [node_name] [taint_name]
|
||||
```
|
||||
|
||||
### 标签
|
||||
|
||||
```bash
|
||||
$ kubectl label [node_name] disktype=ssd
|
||||
$ kubectl label [pod_name] env=prod
|
||||
```
|
||||
|
||||
### 维护/可调度
|
||||
|
||||
```bash
|
||||
$ kubectl cordon [node_name] # 节点维护
|
||||
$ kubectl uncordon [node_name] # 节点可调度
|
||||
```
|
||||
|
||||
### 清空节点
|
||||
|
||||
```bash
|
||||
$ kubectl drain [node_name] # 清空节点
|
||||
```
|
||||
|
||||
### 节点/容器组
|
||||
|
||||
```bash
|
||||
$ kubectl delete node [node_name]
|
||||
$ kubectl delete pod [pod_name]
|
||||
$ kubectl edit node [node_name]
|
||||
$ kubectl edit pod [pod_name]
|
||||
```
|
||||
|
||||
### 无状态/命名空间
|
||||
|
||||
```bash
|
||||
$ kubectl edit deploy [deploy_name]
|
||||
$ kubectl delete deploy [deploy_name]
|
||||
$ kubectl expose deploy [deploy_name] --port=80 --type=NodePort
|
||||
$ kubectl scale deploy [deploy_name] --replicas=5
|
||||
$ kubectl delete ns
|
||||
$ kubectl edit ns [ns_name]
|
||||
```
|
||||
|
||||
### 服务
|
||||
|
||||
```bash
|
||||
$ kubectl edit svc [svc_name]
|
||||
$ kubectl delete svc [svc_name]
|
||||
```
|
||||
|
||||
### 守护进程集
|
||||
|
||||
```bash
|
||||
$ kubectl edit ds [ds_name] -n kube-system
|
||||
$ kubectl delete ds [ds_name]
|
||||
```
|
||||
|
||||
### 服务账号
|
||||
|
||||
```bash
|
||||
$ kubectl edit sa [sa_name]
|
||||
$ kubectl delete sa [sa_name]
|
||||
```
|
||||
|
||||
### 注释
|
||||
|
||||
```bash
|
||||
$ kubectl annotatepo [pod_name] [annotation]
|
||||
$ kubectl annotateno [node_name]
|
||||
```
|
||||
|
||||
添加资源
|
||||
---
|
||||
|
||||
### 创建容器组
|
||||
|
||||
```bash
|
||||
$ kubectl create -f [name_of_file]
|
||||
$ kubectl apply -f [name_of_file]
|
||||
$ kubectl run [pod_name] --image=nginx --restart=Never
|
||||
$ kubectl run [pod_name] --generator=run-pod/v1 --image=nginx
|
||||
$ kubectl run [pod_name] --image=nginx --restart=Never
|
||||
```
|
||||
|
||||
### 创建服务
|
||||
|
||||
```bash
|
||||
$ 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
|
||||
```
|
||||
|
||||
### 输出YAML文件
|
||||
|
||||
```bash
|
||||
$ kubectl create deploy [deploy_name] --image=nginx --dry-run -o yaml > deploy.yaml
|
||||
$ kubectl get po [pod_name] -o yaml --export > pod.yaml
|
||||
```
|
||||
|
||||
### 获取帮助
|
||||
|
||||
```bash
|
||||
$ kubectl -h
|
||||
$ kubectl create -h
|
||||
$ kubectl run -h
|
||||
$ kubectl explain deploy.spec
|
||||
```
|
||||
|
||||
请求
|
||||
---
|
||||
|
||||
### API调用
|
||||
|
||||
```bash
|
||||
$ kubectl get --raw /apis/metrics.k8s.io/
|
||||
```
|
||||
|
||||
### 集群信息
|
||||
|
||||
```bash
|
||||
$ kubectl config
|
||||
$ kubectl cluster-info
|
||||
$ kubectl get componentstatus
|
||||
```
|
||||
|
||||
另见
|
||||
---
|
||||
|
||||
- [Kubernetes 官方文档 命令行工具 (kubectl)](https://kubernetes.io/zh-cn/docs/reference/kubectl/) _(kubernetes.io)_
|
@ -1,7 +1,13 @@
|
||||
Lerna 备忘清单
|
||||
===
|
||||
|
||||
本备忘单旨在快速理解 [Lerna v6](https://github.com/lerna/lerna) 所涉及的主要概念,显示了它的常用命令使用清单。
|
||||
[](https://www.npmjs.com/package/lerna)
|
||||
[](https://www.npmjs.com/package/lerna)
|
||||
[](https://github.com/lerna/lerna/nest/network/dependents)
|
||||
[](https://github.com/lerna/lerna/nest)
|
||||
|
||||
本备忘单旨在快速理解 [Lerna v6](https://github.com/lerna/lerna) 所涉及的主要概念,显示了它的常用命令使用清单
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
----
|
||||
|
@ -1,7 +1,13 @@
|
||||
Less 备忘清单
|
||||
===
|
||||
|
||||
本备忘单旨在快速理解 [Less](https://github.com/less/less.js) 所涉及的主要概念,显示了它的常用方法使用清单。
|
||||
[](https://npmjs.org/package/less)
|
||||
[](https://www.npmjs.com/package/less)
|
||||
[](https://github.com/less/less.js/network/dependents)
|
||||
[](https://github.com/less/less.js)
|
||||
|
||||
本备忘单旨在快速理解 [Less](https://github.com/less/less.js) 所涉及的主要概念,显示了它的常用方法使用清单
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
---
|
||||
|
@ -293,7 +293,7 @@ print(a ^ b) -- 64.0
|
||||
---
|
||||
|
||||
### 运算符
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
#### 关系运算符
|
||||
|
||||
|
1031
docs/make.md
Normal file
434
docs/mongodb.md
Normal file
@ -0,0 +1,434 @@
|
||||
MongoDB 备忘清单
|
||||
===
|
||||
|
||||
[MongoDB](https://www.mongodb.com/developer/products/mongodb/cheat-sheet/#connect-mongodb-shell) 此备忘单包含一些方便的提示、命令和快速参考,可让您立即连接并进行 CRUD
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 连接 MongoDB Shell
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
mongo # 默认连接到 mongodb://127.0.0.1:27017
|
||||
mongo --host <host> --port <port> -u <user> -p <pwd> # 如果需要提示,请省略密码
|
||||
mongo "mongodb://192.168.1.1:27017"
|
||||
# MongoDB 地图集
|
||||
mongo "mongodb+srv://cluster-name.abcde.mongodb.net/<dbname>" --username <username>
|
||||
```
|
||||
|
||||
### 显示数据库
|
||||
|
||||
```mongodb
|
||||
show dbs
|
||||
db // 打印当前数据库
|
||||
```
|
||||
|
||||
### 切换数据库
|
||||
|
||||
```mongodb
|
||||
use <database_name>
|
||||
```
|
||||
|
||||
### 显示收藏
|
||||
|
||||
```mongodb
|
||||
show collections
|
||||
```
|
||||
|
||||
### 运行 JavaScript 文件
|
||||
|
||||
```mongodb
|
||||
load("myScript.js")
|
||||
```
|
||||
|
||||
CRUD
|
||||
---
|
||||
|
||||
### 创建
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
```mongodb
|
||||
db.coll.insertOne({ name: "Max" })
|
||||
db.coll.insert([{ name: "Max"}, {name:"Alex"}]) // 订购批量插入
|
||||
db.coll.insert([{ name: "Max"}, {name:"Alex"}], {ordered: false}) // 无序批量插入
|
||||
db.coll.insert({ date: ISODate()})
|
||||
db.coll.insert({ name: "Max"}, {"writeConcern": {"w": "majority", "wtimeout": 5000}})
|
||||
```
|
||||
|
||||
### 寻找文件
|
||||
|
||||
Commands | Description
|
||||
:-- | ---
|
||||
`db.docx.findOne()` | 查找一个随机文档
|
||||
`db.docx.find().prettyPrint()` | 查找所有文档
|
||||
`db.docx.find({}, {name:true, _id:false})` | 仅显示文档 Docx 的名称
|
||||
`db.docx.find({}, {name:true, _id:false})` | 可以在多个文件中按属性查找一个文件
|
||||
|
||||
### 使用运算符查找文档
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
Operator | Description | Commands
|
||||
:-- | --- | ---
|
||||
`$gt` | 比...更棒 | `db.docx.find({class:{$gt:'T'}`
|
||||
`$gte` | 大于等于 | `db.docx.find({class:{$gt:'T'}`
|
||||
`$lt` | 小于 | `db.docx.find({class:{$lt:'T'}`
|
||||
`$lte` | 小于等于 | `db.docx.find({class:{$lte:'T'}`
|
||||
`$exists` | 属性是否存在 | `db.docx.find({class:{$gt:'T'}`
|
||||
`$regex` | 正则表达式匹配 | `db.docx.find({name:{$regex:'^USS\\sE'}})`
|
||||
`$type` | 按元素类型搜索 | `db.docx.find({name : {$type:4}})`
|
||||
|
||||
### 读取
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
```mongodb
|
||||
db.coll.findOne() // 返回单个文档
|
||||
db.coll.find() // 返回一个游标 - 显示 20 个结果 - "it" 显示更多
|
||||
db.coll.find().pretty()
|
||||
db.coll.find({name: "Max", age: 32}) // 隐式逻辑“与”。
|
||||
db.coll.find({date: ISODate("2020-09-25T13:57:17.180Z")})
|
||||
|
||||
// 或“queryPlanner”或“allPlansExecution”
|
||||
db.coll.find({name: "Max", age: 32}).explain("executionStats")
|
||||
db.coll.distinct("name")
|
||||
|
||||
// 数数
|
||||
db.coll.count({age: 32}) // 基于馆藏元数据的估计
|
||||
db.coll.estimatedDocumentCount() // 基于馆藏元数据的估计
|
||||
db.coll.countDocuments({age: 32}) // 聚合管道的别名 - 准确计数
|
||||
|
||||
// Comparison 比较
|
||||
db.coll.find({"year": {$gt: 1970}})
|
||||
db.coll.find({"year": {$gte: 1970}})
|
||||
db.coll.find({"year": {$lt: 1970}})
|
||||
db.coll.find({"year": {$lte: 1970}})
|
||||
db.coll.find({"year": {$ne: 1970}})
|
||||
db.coll.find({"year": {$in: [1958, 1959]}})
|
||||
db.coll.find({"year": {$nin: [1958, 1959]}})
|
||||
|
||||
|
||||
// Logical 逻辑
|
||||
db.coll.find({name:{$not: {$eq: "Max"}}})
|
||||
db.coll.find({$or: [{"year" : 1958}, {"year" : 1959}]})
|
||||
db.coll.find({$nor: [{price: 1.99}, {sale: true}]})
|
||||
db.coll.find({
|
||||
$and: [
|
||||
{$or: [{qty: {$lt :10}}, {qty :{$gt: 50}}]},
|
||||
{$or: [{sale: true}, {price: {$lt: 5 }}]}
|
||||
]
|
||||
})
|
||||
|
||||
// Element 元素
|
||||
db.coll.find({name: {$exists: true}})
|
||||
db.coll.find({"zipCode": {$type: 2 }})
|
||||
db.coll.find({"zipCode": {$type: "string"}})
|
||||
|
||||
// Aggregation Pipeline 聚合管道
|
||||
db.coll.aggregate([
|
||||
{$match: {status: "A"}},
|
||||
{$group: {_id: "$cust_id", total: {$sum: "$amount"}}},
|
||||
{$sort: {total: -1}}
|
||||
])
|
||||
|
||||
// 使用“文本”索引进行文本搜索
|
||||
db.coll.find({$text: {$search: "cake"}}, {score: {$meta: "textScore"}})
|
||||
.sort({score: {$meta: "textScore"}})
|
||||
|
||||
// Regex 正则表达式
|
||||
db.coll.find({name: /^Max/}) // 正则表达式:以字母“M”开头
|
||||
db.coll.find({name: /^Max$/i}) // 正则表达式不区分大小写
|
||||
|
||||
// Array
|
||||
db.coll.find({tags: {$all: ["Realm", "Charts"]}})
|
||||
db.coll.find({field: {$size: 2}}) // 无法索引 - 更喜欢存储数组的大小并更新它
|
||||
db.coll.find({results: {$elemMatch: {product: "xyz", score: {$gte: 8}}}})
|
||||
|
||||
// Projections 预测
|
||||
db.coll.find({"x": 1}, {"actors": 1}) // actors + _id
|
||||
db.coll.find({"x": 1}, {"actors": 1, "_id": 0}) // actors
|
||||
db.coll.find({"x": 1}, {"actors": 0, "summary": 0}) // 除了“actors”和“summary”之外的所有内容
|
||||
|
||||
// Sort 排序, skip 跳过, limit 限制
|
||||
db.coll.find({}).sort({"year": 1, "rating": -1}).skip(10).limit(3)
|
||||
|
||||
// Read Concern 阅读关注
|
||||
db.coll.find().readConcern("majority")
|
||||
```
|
||||
|
||||
### 更新
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
```mongodb
|
||||
db.coll.update({"_id": 1}, {"year": 2016}) // 警告! 替换整个文档
|
||||
db.coll.update({"_id": 1}, {$set: {"year": 2016, name: "Max"}})
|
||||
db.coll.update({"_id": 1}, {$unset: {"year": 1}})
|
||||
db.coll.update({"_id": 1}, {$rename: {"year": "date"} })
|
||||
db.coll.update({"_id": 1}, {$inc: {"year": 5}})
|
||||
db.coll.update({"_id": 1}, {$mul: {price: NumberDecimal("1.25"), qty: 2}})
|
||||
db.coll.update({"_id": 1}, {$min: {"imdb": 5}})
|
||||
db.coll.update({"_id": 1}, {$max: {"imdb": 8}})
|
||||
db.coll.update({"_id": 1}, {$currentDate: {"lastModified": true}})
|
||||
db.coll.update({"_id": 1}, {$currentDate: {"lastModified": {$type: "timestamp"}}})
|
||||
|
||||
// Array
|
||||
db.coll.update({"_id": 1}, {$push :{"array": 1}})
|
||||
db.coll.update({"_id": 1}, {$pull :{"array": 1}})
|
||||
db.coll.update({"_id": 1}, {$addToSet :{"array": 2}})
|
||||
db.coll.update({"_id": 1}, {$pop: {"array": 1}}) // 最后一个元素
|
||||
db.coll.update({"_id": 1}, {$pop: {"array": -1}}) // 第一个元素
|
||||
db.coll.update({"_id": 1}, {$pullAll: {"array" :[3, 4, 5]}})
|
||||
db.coll.update({"_id": 1}, {$push: {scores: {$each: [90, 92, 85]}}})
|
||||
db.coll.updateOne({"_id": 1, "grades": 80}, {$set: {"grades.$": 82}})
|
||||
db.coll.updateMany({}, {$inc: {"grades.$[]": 10}})
|
||||
db.coll.update({}, {$set: {"grades.$[element]": 100}}, {multi: true, arrayFilters: [{"element": {$gte: 100}}]})
|
||||
|
||||
// 更新很多
|
||||
db.coll.update({"year": 1999}, {$set: {"decade": "90's"}}, {"multi":true})
|
||||
db.coll.updateMany({"year": 1999}, {$set: {"decade": "90's"}})
|
||||
|
||||
// FindOneAndUpdate 查找并更新
|
||||
db.coll.findOneAndUpdate({"name": "Max"}, {$inc: {"points": 5}}, {returnNewDocument: true})
|
||||
|
||||
// Upsert 更新插入
|
||||
db.coll.update({"_id": 1}, {$set: {item: "apple"}, $setOnInsert: {defaultQty: 100}}, {upsert: true})
|
||||
|
||||
// Replace 代替
|
||||
db.coll.replaceOne({"name": "Max"}, {"firstname": "Maxime", "surname": "Beugnet"})
|
||||
|
||||
// Save 保存
|
||||
db.coll.save({"item": "book", "qty": 40})
|
||||
|
||||
// Write concern 写关注
|
||||
db.coll.update({}, {$set: {"x": 1}}, {"writeConcern": {"w": "majority", "wtimeout": 5000}})
|
||||
```
|
||||
|
||||
### 删除
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
```mongodb
|
||||
db.coll.remove({name: "Max"})
|
||||
db.coll.remove({name: "Max"}, {justOne: true})
|
||||
db.coll.remove({}) // 警告!删除所有文档但不删除集合本身及其索引定义
|
||||
db.coll.remove({name: "Max"}, {"writeConcern": {"w": "majority", "wtimeout": 5000}})
|
||||
db.coll.findOneAndDelete({"name": "Max"})
|
||||
```
|
||||
|
||||
数据库和集合
|
||||
---
|
||||
|
||||
### Drop
|
||||
|
||||
```mongodb
|
||||
// 删除集合及其索引定义
|
||||
db.coll.drop()
|
||||
// 仔细检查你*不*在 PROD 集群上......:-)
|
||||
db.dropDatabase()
|
||||
```
|
||||
|
||||
### 创建集合
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
```mongodb
|
||||
// 使用 $jsonschema 创建集合
|
||||
db.createCollection("contacts", {
|
||||
validator: {$jsonSchema: {
|
||||
bsonType: "object",
|
||||
required: ["phone"],
|
||||
properties: {
|
||||
phone: {
|
||||
bsonType: "string",
|
||||
description: "必须是一个字符串并且是必需的"
|
||||
},
|
||||
email: {
|
||||
bsonType: "string",
|
||||
pattern: "@mongodb\.com$",
|
||||
description: "必须是字符串并匹配正则表达式模式"
|
||||
},
|
||||
status: {
|
||||
enum: [ "Unknown", "Incomplete" ],
|
||||
description: "只能是枚举值之一"
|
||||
}
|
||||
}
|
||||
}}
|
||||
})
|
||||
```
|
||||
|
||||
### 其他采集功能
|
||||
|
||||
```mongodb
|
||||
db.coll.stats()
|
||||
db.coll.storageSize()
|
||||
db.coll.totalIndexSize()
|
||||
db.coll.totalSize()
|
||||
db.coll.validate({full: true})
|
||||
// 第二个参数用于删除目标集合(如果存在)
|
||||
db.coll.renameCollection("new_coll", true)
|
||||
```
|
||||
|
||||
索引
|
||||
---
|
||||
|
||||
### 列表索引
|
||||
|
||||
```mongodb
|
||||
db.coll.getIndexes()
|
||||
db.coll.getIndexKeys()
|
||||
```
|
||||
|
||||
### 创建索引
|
||||
<!--rehype:wrap-class=col-span-2 row-span-3-->
|
||||
|
||||
```mongodb
|
||||
// 索引类型
|
||||
db.coll.createIndex({"name": 1}) // 单字段索引
|
||||
db.coll.createIndex({"name": 1, "date": 1}) // 复合索引
|
||||
db.coll.createIndex({foo: "text", bar: "text"}) // 文本索引
|
||||
db.coll.createIndex({"$**": "text"}) // 通配符文本索引
|
||||
db.coll.createIndex({"userMetadata.$**": 1}) // 通配符索引
|
||||
db.coll.createIndex({"loc": "2d"}) // 二维索引
|
||||
db.coll.createIndex({"loc": "2dsphere"}) // 2dsphere 索引
|
||||
db.coll.createIndex({"_id": "hashed"}) // 哈希索引
|
||||
|
||||
// Index Options
|
||||
db.coll.createIndex({"lastModifiedDate": 1}, {expireAfterSeconds: 3600}) // TTL指数
|
||||
db.coll.createIndex({"name": 1}, {unique: true})
|
||||
db.coll.createIndex({"name": 1}, {partialFilterExpression: {age: {$gt: 18}}}) // 部分索引
|
||||
// 强度为 1 或 2 的不区分大小写的索引
|
||||
db.coll.createIndex({"name": 1}, {collation: {locale: 'en', strength: 1}})
|
||||
db.coll.createIndex({"name": 1 }, {sparse: true})
|
||||
```
|
||||
|
||||
### 删除索引
|
||||
|
||||
```mongodb
|
||||
db.coll.dropIndex("name_1")
|
||||
```
|
||||
|
||||
### 隐藏/取消隐藏索引
|
||||
|
||||
```mongodb
|
||||
db.coll.hideIndex("name_1")
|
||||
db.coll.unhideIndex("name_1")
|
||||
```
|
||||
|
||||
方便的命令
|
||||
---
|
||||
|
||||
###
|
||||
<!--rehype:wrap-class=col-span-3&style=display:none;&wrap-style=padding-top: 0;-->
|
||||
|
||||
```mongodb
|
||||
use admin
|
||||
db.createUser({"user": "root", "pwd": passwordPrompt(), "roles": ["root"]})
|
||||
db.dropUser("root")
|
||||
db.auth( "user", passwordPrompt() )
|
||||
|
||||
use test
|
||||
db.getSiblingDB("dbname")
|
||||
db.currentOp()
|
||||
db.killOp(123) // opid
|
||||
|
||||
db.fsyncLock()
|
||||
db.fsyncUnlock()
|
||||
|
||||
db.getCollectionNames()
|
||||
db.getCollectionInfos()
|
||||
db.printCollectionStats()
|
||||
db.stats()
|
||||
|
||||
db.getReplicationInfo()
|
||||
db.printReplicationInfo()
|
||||
db.isMaster()
|
||||
db.hostInfo()
|
||||
db.printShardingStatus()
|
||||
db.shutdownServer()
|
||||
db.serverStatus()
|
||||
|
||||
db.setSlaveOk()
|
||||
db.getSlaveOk()
|
||||
|
||||
db.getProfilingLevel()
|
||||
db.getProfilingStatus()
|
||||
db.setProfilingLevel(1, 200) // 0 == OFF, 1 == ON with slowms, 2 == ON
|
||||
|
||||
db.enableFreeMonitoring()
|
||||
db.disableFreeMonitoring()
|
||||
db.getFreeMonitoringStatus()
|
||||
|
||||
db.createView("viewName", "sourceColl", [{$project:{department: 1}}])
|
||||
```
|
||||
|
||||
各种各样的
|
||||
---
|
||||
|
||||
### 改变流
|
||||
|
||||
```mongodb
|
||||
watchCursor = db.coll.watch([
|
||||
{
|
||||
$match : {"operationType": "insert" }
|
||||
}
|
||||
])
|
||||
|
||||
while (!watchCursor.isExhausted()){
|
||||
if (watchCursor.hasNext()){
|
||||
print(tojson(watchCursor.next()));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 分片集群
|
||||
<!--rehype:wrap-class=col-span-2 row-span-3-->
|
||||
|
||||
```mongodb
|
||||
sh.status()
|
||||
sh.addShard("rs1/mongodbd1.example.net:27017")
|
||||
sh.shardCollection("mydb.coll", {zipcode: 1})
|
||||
|
||||
sh.moveChunk("mydb.coll", { zipcode: "53187" }, "shard0019")
|
||||
sh.splitAt("mydb.coll", {x: 70})
|
||||
sh.splitFind("mydb.coll", {x: 70})
|
||||
sh.disableAutoSplit()
|
||||
sh.enableAutoSplit()
|
||||
|
||||
sh.startBalancer()
|
||||
sh.stopBalancer()
|
||||
sh.disableBalancing("mydb.coll")
|
||||
sh.enableBalancing("mydb.coll")
|
||||
sh.getBalancerState()
|
||||
sh.setBalancerState(true/false)
|
||||
sh.isBalancerRunning()
|
||||
|
||||
sh.addTagRange("mydb.coll", {state: "NY",zip: MinKey}, {state: "NY",zip: MaxKey}, "NY")
|
||||
sh.removeTagRange("mydb.coll", {state: "NY",zip: MinKey}, {state: "NY",zip: MaxKey}, "NY")
|
||||
sh.addShardTag("shard0000", "NYC")
|
||||
sh.removeShardTag("shard0000", "NYC")
|
||||
|
||||
sh.addShardToZone("shard0000", "JFK")
|
||||
sh.removeShardFromZone("shard0000", "NYC")
|
||||
sh.removeRangeFromZone("mydb.coll", {a: 1, b: 1}, {a: 10, b: 10})
|
||||
```
|
||||
|
||||
### 副本集
|
||||
|
||||
```mongodb
|
||||
rs.status()
|
||||
rs.initiate({"_id": "replicaTest",
|
||||
members: [
|
||||
{ _id: 0, host: "127.0.0.1:27017" },
|
||||
{ _id: 1, host: "127.0.0.1:27018" },
|
||||
{ _id: 2, host: "127.0.0.1:27019",
|
||||
arbiterOnly:true }]
|
||||
})
|
||||
rs.add("mongodbd1.example.net:27017")
|
||||
rs.addArb("mongodbd2.example.net:27017")
|
||||
rs.remove("mongodbd1.example.net:27017")
|
||||
rs.conf()
|
||||
rs.isMaster()
|
||||
rs.printReplicationInfo()
|
||||
rs.printSlaveReplicationInfo()
|
||||
rs.reconfig(<valid_conf>)
|
||||
rs.slaveOk()
|
||||
rs.stepDown(20, 5)
|
||||
// (stepDownSecs, secondaryCatchUpPeriodSecs)
|
||||
```
|
@ -1,7 +1,13 @@
|
||||
NestJS 备忘清单
|
||||
===
|
||||
|
||||
[](https://www.npmjs.com/package/@nestjs/core)
|
||||
[](https://www.npmjs.com/package/@nestjs/core)
|
||||
[](https://github.com/nestjs/nest/network/dependents)
|
||||
[](https://github.com/nestjs/nest)
|
||||
|
||||
[NestJS](https://docs.nestjs.com/) 是一个用于构建高效、可扩展的 Node.js 服务器端应用程序的开发框架
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
创建应用
|
||||
---
|
||||
|
@ -1,7 +1,13 @@
|
||||
Next.js 备忘清单
|
||||
===
|
||||
|
||||
这是一份快速参考备忘单,包含 Next.js 的 API 参考列表和一些示例
|
||||
[](https://www.npmjs.com/package/next)
|
||||
[](https://www.npmjs.com/package/next)
|
||||
[](https://github.com/vercel/next.js/network/dependents)
|
||||
[](https://github.com/vercel/next.js)
|
||||
|
||||
这是一份快速参考备忘单,包含 [Next.js](https://nextjs.org/) 的 API 参考列表和一些示例
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
----
|
||||
|
317
docs/pm2.md
Normal file
@ -0,0 +1,317 @@
|
||||
PM2 备忘清单
|
||||
===
|
||||
|
||||
[](https://npmjs.org/package/pm2)
|
||||
[](https://www.npmjs.com/package/pm2)
|
||||
[](https://github.com/Unitech/pm2/network/dependents)
|
||||
[](https://github.com/Unitech/pm2)
|
||||
|
||||
[PM2](https://pm2.keymetrics.io/) 是一个守护进程管理器,它将帮助您管理和保持您的应用程序在线。PM2 入门非常简单,它以简单直观的 CLI 形式提供
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
-----
|
||||
|
||||
### 安装
|
||||
|
||||
最新的 PM2 版本可通过 NPM 或 Yarn 安装
|
||||
|
||||
```shell
|
||||
$ npm install pm2@latest -g
|
||||
```
|
||||
|
||||
或者
|
||||
|
||||
```shell
|
||||
$ yarn global add pm2
|
||||
```
|
||||
|
||||
### 启动应用程序
|
||||
|
||||
启动、守护进程和监视应用程序的最简单方法是使用此命令行
|
||||
|
||||
```shell
|
||||
$ pm2 start app.js
|
||||
```
|
||||
|
||||
或者轻松启动任何其他应用程序
|
||||
|
||||
```shell
|
||||
$ pm2 start bashscript.sh
|
||||
$ pm2 start python-app.py --watch
|
||||
$ pm2 start binary-file -- --port 1520
|
||||
```
|
||||
|
||||
### 您可以传递给 CLI 的一些选项
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
指定应用名称
|
||||
|
||||
```shell
|
||||
--name <app_name>
|
||||
```
|
||||
|
||||
文件更改时监视并重新启动应用程序
|
||||
|
||||
```shell
|
||||
--watch
|
||||
```
|
||||
|
||||
设置应用重新加载的内存阈值
|
||||
|
||||
```shell
|
||||
--max-memory-restart <200MB>
|
||||
```
|
||||
|
||||
指定日志文件
|
||||
|
||||
```shell
|
||||
--log <log_path>
|
||||
```
|
||||
|
||||
将额外的参数传递给脚本
|
||||
|
||||
```shell
|
||||
-- arg1 arg2 arg3
|
||||
```
|
||||
|
||||
自动重启之间的延迟
|
||||
|
||||
```shell
|
||||
--restart-delay <delay in ms>
|
||||
```
|
||||
|
||||
带时间的前缀日志
|
||||
|
||||
```shell
|
||||
--time
|
||||
```
|
||||
|
||||
不要自动重启应用程序
|
||||
|
||||
```shell
|
||||
--no-autorestart
|
||||
```
|
||||
|
||||
指定 cron 强制重启
|
||||
|
||||
```shell
|
||||
--cron <cron_pattern>
|
||||
```
|
||||
|
||||
附加到应用程序日志
|
||||
|
||||
```shell
|
||||
--no-daemon
|
||||
```
|
||||
|
||||
### 管理流程
|
||||
|
||||
管理应用程序状态很简单,这里是命令
|
||||
|
||||
```shell
|
||||
$ pm2 restart app_name
|
||||
$ pm2 reload app_name
|
||||
$ pm2 stop app_name
|
||||
$ pm2 delete app_name
|
||||
```
|
||||
|
||||
#### 你可以传递而不是 app_name
|
||||
|
||||
- `all` 作用于所有进程
|
||||
- `id` 作用于特定的进程 ID
|
||||
|
||||
### 检查状态、日志、指标
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
现在您已经启动了这个应用程序,您可以检查它的状态、日志、指标,甚至可以使用 [pm2.io](https://pm2.io/) 获取在线仪表板
|
||||
|
||||
列出PM2管理的所有应用的状态
|
||||
|
||||
```shell
|
||||
$ pm2 [list|ls|status]
|
||||
```
|
||||
|
||||
实时显示日志
|
||||
|
||||
```shell
|
||||
$ pm2 logs
|
||||
```
|
||||
|
||||
挖掘旧日志
|
||||
|
||||
```shell
|
||||
$ pm2 logs --lines 200
|
||||
```
|
||||
|
||||
这是一个直接适合您的终端的实时仪表板
|
||||
|
||||
```shell
|
||||
$ pm2 monit
|
||||
```
|
||||
|
||||
基于 Web 的仪表板,具有诊断系统的跨服务器
|
||||
|
||||
```shell
|
||||
$ pm2 plus
|
||||
```
|
||||
|
||||
### 集群模式
|
||||
|
||||
对于 Node.js 应用程序,PM2 包括一个自动负载均衡器,它将在每个衍生进程之间共享所有 HTTP[s]/Websocket/TCP/UDP 连接
|
||||
|
||||
以集群模式启动应用程序
|
||||
|
||||
```shell
|
||||
$ pm2 start app.js -i max
|
||||
```
|
||||
|
||||
在 [此处](https://pm2.keymetrics.io/docs/usage/quick-start/) 阅读有关集群模式的更多信息
|
||||
|
||||
### 生态系统文件
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
您还可以创建一个称为生态系统文件的配置文件来管理多个应用程序。生成生态系统文件
|
||||
|
||||
```shell
|
||||
$ pm2 ecosystem
|
||||
```
|
||||
|
||||
这将生成一个 `ecosystem.config.js` 文件
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
apps : [{
|
||||
name: "app",
|
||||
script: "./app.js",
|
||||
env: {
|
||||
NODE_ENV: "development",
|
||||
},
|
||||
env_production: {
|
||||
NODE_ENV: "production",
|
||||
}
|
||||
}, {
|
||||
name: 'worker',
|
||||
script: 'worker.js'
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
并轻松启动
|
||||
|
||||
```shell
|
||||
$ pm2 start ecosystem.config.js
|
||||
```
|
||||
|
||||
在 [此处](https://pm2.keymetrics.io/docs/usage/application-declaration/) 阅读有关应用程序声明的更多信息
|
||||
|
||||
### 设置启动脚本
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
使用您在服务器启动/重新启动时管理的进程重新启动 PM2 至关重要。为了解决这个问题,只需运行这个命令来生成一个活动的启动脚本
|
||||
|
||||
```shell
|
||||
$ pm2 save
|
||||
```
|
||||
|
||||
在 [此处](https://pm2.keymetrics.io/docs/usage/startup/) 阅读有关启动脚本生成器的更多信息
|
||||
|
||||
### 重新启动应用程序更改
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
使用 `--watch` 选项非常简单
|
||||
|
||||
```shell
|
||||
$ cd /path/to/my/app
|
||||
$ pm2 start env.js --watch --ignore-watch="node_modules"
|
||||
```
|
||||
|
||||
这将在当前目录 `+` 所有子文件夹中的任何文件更改时监视并重新启动应用程序,并且它将忽略 `node_modules` 文件夹中的任何更改 `--ignore-watch="node_modules"`。
|
||||
|
||||
```bash
|
||||
$ pm2 logs
|
||||
```
|
||||
|
||||
然后,您可以使用上面命令来检查重新启动的应用程序日志。
|
||||
|
||||
PM2 CheatSheet
|
||||
---
|
||||
<!--rehype:body-class=cols-2-->
|
||||
|
||||
以下是一些值得了解的命令。 只需使用示例应用程序或开发机器上当前的 Web 应用程序来尝试它们
|
||||
|
||||
### PM2 分叉模式
|
||||
|
||||
```shell
|
||||
$ pm2 start app.js --name my-api # 名称进程
|
||||
```
|
||||
|
||||
### PM2 集群模式
|
||||
|
||||
```shell
|
||||
$ pm2 start app.js -i 0 # 将根据可用的 CPU 使用 LB 启动最大进程
|
||||
$ pm2 start app.js -i max # 与上面相同,但已弃用。
|
||||
$ pm2 scale app +3 # 将 `app` 增加 3 名工人
|
||||
$ pm2 scale app 2 # 将 `app` 向上或向下扩展到总共 2 个工人
|
||||
```
|
||||
|
||||
### PM2 清单
|
||||
|
||||
```shell
|
||||
$ pm2 list # 显示所有进程状态
|
||||
$ pm2 jlist # 以原始 JSON 格式打印进程列表
|
||||
$ pm2 prettylist # 以美化JSON打印进程列表
|
||||
$ pm2 describe 0 # 显示有关特定进程的所有信息
|
||||
$ pm2 monit # 监控所有进程
|
||||
```
|
||||
|
||||
### PM2 日志
|
||||
|
||||
```shell
|
||||
$ pm2 logs [--raw] # 在流中显示所有进程日志
|
||||
$ pm2 flush # 清空所有日志文件
|
||||
$ pm2 reloadLogs # 重新加载所有日志
|
||||
```
|
||||
|
||||
### PM2 动作
|
||||
|
||||
```shell
|
||||
$ pm2 stop all # 停止所有进程
|
||||
$ pm2 restart all # 重启所有进程
|
||||
$ pm2 reload all # 将 0s 停机时间重新加载(对于 NETWORKED 应用程序)
|
||||
$ pm2 stop 0 # 停止特定进程 ID
|
||||
$ pm2 restart 0 # 重启特定进程id
|
||||
$ pm2 delete 0 # 将从 pm2 列表中删除进程
|
||||
$ pm2 delete all # 将从 pm2 列表中删除所有进程
|
||||
```
|
||||
|
||||
### PM2 杂项
|
||||
|
||||
```shell
|
||||
$ pm2 reset <process> # 重置元数据(重启时间...)
|
||||
$ pm2 updatePM2 # 更新内存 pm2
|
||||
$ pm2 ping # 确保 pm2 守护进程已经启动
|
||||
$ pm2 sendSignal SIGUSR2 my-app # 向脚本发送系统信号
|
||||
$ pm2 start app.js --no-daemon
|
||||
$ pm2 start app.js --no-vizion
|
||||
$ pm2 start app.js --no-autorestart
|
||||
```
|
||||
|
||||
### 更新 PM2
|
||||
|
||||
我们让它变得简单,版本之间没有重大变化,过程很简单
|
||||
|
||||
```shell
|
||||
$ npm install pm2@latest -g
|
||||
```
|
||||
|
||||
然后更新内存中的PM2
|
||||
|
||||
```shell
|
||||
$ pm2 update
|
||||
```
|
||||
|
||||
另见
|
||||
--------
|
||||
|
||||
- [QUICK START](https://pm2.keymetrics.io/docs/usage/quick-start/) _(pm2.keymetrics.io)_
|
248
docs/ps.md
Normal file
@ -0,0 +1,248 @@
|
||||
ps 备忘清单
|
||||
===
|
||||
|
||||
Linux 为我们提供了一个名为 `ps` 的实用程序,用于查看与系统上的进程相关的信息,它是 `Process Status` 的缩写
|
||||
这份 `ps` 命令备忘清单的快速参考列表,包含常用选项和示例。
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
### 语法
|
||||
<!--rehype:wrap-class=row-span-4-->
|
||||
|
||||
```bash
|
||||
$ ps [options]
|
||||
```
|
||||
|
||||
命令运行示例,列出当前 shell 中的所有进程:
|
||||
|
||||
```bash
|
||||
$ ps
|
||||
|
||||
PID TTY TIME CMD
|
||||
12330 pts/0 00:00:00 bash
|
||||
21621 pts/0 00:00:00 ps
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`PID` | 唯一的进程 ID
|
||||
`TTY` | 用户登录的终端类型
|
||||
`TIME` | 进程运行的 CPU 数量,以分钟和秒为单位
|
||||
`CMD` | 启动进程的命令的名称
|
||||
|
||||
注意:有时当我们执行 `ps` 命令时,它显示 `TIME` 为 `00:00:00`
|
||||
|
||||
---
|
||||
|
||||
ps 命令支持 3 种使用语法风格
|
||||
|
||||
- `Unix` 可以分组并以连字符开头
|
||||
- `BSD` 可以分组但前面没有连字符
|
||||
- `GNU` 长选项,前面有双连字符
|
||||
|
||||
### 示例
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
Option | Function
|
||||
:-- | --
|
||||
`ps -ef / -aux` | 以完整格式列出当前正在运行的进程
|
||||
`ps -ax` | 列出当前正在运行的进程
|
||||
`ps -u <username>` | 列出特定用户的进程
|
||||
`ps -C <command>` | 列出给定命令的进程
|
||||
`ps -p <PID>` | 列出具有给定 PID 的进程
|
||||
`ps -ppid <PPID>` | 列出具有给定 ppid 的进程
|
||||
`pstree` | 在层次结构中显示过程
|
||||
`ps -L` | 列出特定进程的所有线程
|
||||
`ps --sort pmem` | 查找内存泄漏
|
||||
`ps -eo` | 显示安全信息
|
||||
`ps T` | 允许您仅选择与此终端关联的所有进程
|
||||
`ps -U root -u root u` | 显示由 root 运行的进程
|
||||
<!--rehype:className=code-nowrap-->
|
||||
|
||||
### 查看系统上的每个进程
|
||||
|
||||
要使用标准语法查看系统上的每个进程:
|
||||
|
||||
```bash
|
||||
$ ps -e # 列出所有进程
|
||||
$ ps -ef
|
||||
$ ps -eF
|
||||
$ ps -ely
|
||||
```
|
||||
|
||||
要使用 BSD 语法查看系统上的每个进程:
|
||||
|
||||
```bash
|
||||
$ ps ax # 以 BSD 格式列出所有进程
|
||||
$ ps axu
|
||||
```
|
||||
|
||||
### 打印进程树
|
||||
|
||||
```bash
|
||||
$ ps -ejH
|
||||
$ ps axjf
|
||||
```
|
||||
|
||||
### 仅打印 PID 42 的名称
|
||||
|
||||
```bash
|
||||
$ ps -q 42 -o comm=
|
||||
```
|
||||
|
||||
### 获取有关线程的信息
|
||||
|
||||
```bash
|
||||
$ ps -eLf
|
||||
$ ps axms
|
||||
```
|
||||
|
||||
### 列出当前用户拥有的所有进程
|
||||
|
||||
```bash
|
||||
$ ps x
|
||||
```
|
||||
|
||||
### 获取安全信息
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ ps -eo euser,ruser,suser,fuser,f,comm,label
|
||||
$ ps axZ
|
||||
$ ps -eM
|
||||
```
|
||||
|
||||
### 查看以 root 身份运行的每个进程
|
||||
|
||||
查看以 root 身份运行的每个进程(真实且有效的 ID)用户格式:
|
||||
|
||||
```bash
|
||||
$ ps -U root -u root u
|
||||
```
|
||||
|
||||
### 查看具有用户定义格式的每个进程
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```bash
|
||||
$ ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
|
||||
$ ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
|
||||
$ ps -Ao pid,tt,user,fname,tmout,f,wchan
|
||||
```
|
||||
|
||||
### 仅打印 syslogd 的进程 ID
|
||||
|
||||
```bash
|
||||
$ ps -C syslogd -o pid=
|
||||
```
|
||||
|
||||
### 显示面向用户的格式
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
```bash
|
||||
$ ps u
|
||||
|
||||
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
|
||||
refs 11400 1.1 0.0 34853544 5816 s025 Ss Tue02PM 0:02.82 /bin/zsh --login
|
||||
refs 34561 0.6 0.0 34822644 3152 s016 S+ 14Dec22 115:59.28 zsh (figterm)
|
||||
refs 21377 0.5 0.0 34973972 7076 s028 S+ Wed09AM 4:32.19 zsh (figterm)
|
||||
refs 78881 0.5 0.0 34843484 3256 s015 S+ 17Dec22 90:27.10 zsh (figterm)
|
||||
```
|
||||
|
||||
### 列出具有完整格式的进程
|
||||
|
||||
```bash
|
||||
$ ps f
|
||||
$ ps -F
|
||||
```
|
||||
|
||||
### 显示虚拟内存格式
|
||||
|
||||
```bash
|
||||
$ ps v
|
||||
```
|
||||
|
||||
### 按有效用户 ID 或名称显示进程
|
||||
|
||||
```bash
|
||||
$ ps -u user[name or id]
|
||||
# OR
|
||||
$ ps --user user[name or id]
|
||||
$ ps -u root
|
||||
```
|
||||
|
||||
按**真实**用户 ID 或名称显示进程
|
||||
|
||||
```bash
|
||||
$ ps -U user[name or id]
|
||||
# OR
|
||||
$ ps --User user[name or id]
|
||||
```
|
||||
|
||||
### 按实际组 ID 或名称显示进程
|
||||
|
||||
```bash
|
||||
$ ps -G group[name or id]
|
||||
# OR
|
||||
$ ps --Group group[name or id]
|
||||
```
|
||||
|
||||
### 隐藏 ps 命令输出的标题
|
||||
|
||||
```bash
|
||||
$ ps h
|
||||
|
||||
PID TT STAT TIME COMMAND
|
||||
33790 s000 S+ 104:10.45 zsh (figterm)
|
||||
33800 s001 Ss+ 0:02.76 /bin/zsh --login
|
||||
77830 s002 S+ 90:22.51 zsh (figterm)
|
||||
77840 s003 Ss 0:00.66 /bin/zsh --login
|
||||
```
|
||||
|
||||
### 显示命令后的环境
|
||||
|
||||
```bash
|
||||
$ ps e
|
||||
|
||||
PID TTY STAT TIME COMMAND
|
||||
886 tty2 Ssl+ 0:00 /usr/li....
|
||||
```
|
||||
|
||||
### 重复 ps 命令输出的标题行
|
||||
|
||||
```bash
|
||||
$ ps --headers -A
|
||||
PID TTY TIME CMD
|
||||
1 ? 00:00:01 systemd
|
||||
2 ? 00:00:00 kthreadd
|
||||
3 ? 00:00:00 rcu_gp
|
||||
```
|
||||
|
||||
### 显示进程树
|
||||
|
||||
```bash
|
||||
$ ps --forest -A
|
||||
PID TTY TIME CMD
|
||||
2 ? 00:00:00 kthreadd
|
||||
3 ? 00:00:00 \_ rcu_gp
|
||||
4 ? 00:00:00 \_ rcu_par_gp
|
||||
960 ? 00:00:00 \_ goa-identity-se
|
||||
1118 ? 00:00:00 \_ at-spi-bus-laun
|
||||
1124 ? 00:00:00 | \_ dbus-daemon
|
||||
```
|
||||
|
||||
您可以使用 -H 选项打印进程层次结构
|
||||
|
||||
```bash
|
||||
$ ps -H -A
|
||||
PID TTY TIME CMD
|
||||
2 ? 00:00:00 kthreadd
|
||||
3 ? 00:00:00 rcu_gp
|
||||
1832 ? 00:00:37 gnome-terminal-
|
||||
1840 pts/0 00:00:00 bash
|
||||
1925 pts/1 00:00:00 bash
|
||||
2867 pts/1 00:00:00 su
|
||||
2868 pts/1 00:00:00 bash
|
||||
```
|
163
docs/pycharm.md
Normal file
@ -0,0 +1,163 @@
|
||||
PyCharm 键盘快捷键备忘清单
|
||||
===
|
||||
|
||||
这个 [PyCharm](https://resources.jetbrains.com/storage/products/pycharm/docs/PyCharm_ReferenceCard.pdf) 快速参考备忘单显示了它的键盘快捷键和命令
|
||||
|
||||
快捷键
|
||||
---
|
||||
|
||||
### 创建和编辑
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Alt` + `Enter` | 显示意图动作
|
||||
`Ctrl` + `Space` | 基本代码完成
|
||||
`Ctrl` + `Shift` + `Space` | 智能代码完成
|
||||
`Ctrl` + `Alt` + `Space` | 类型名称完成
|
||||
`Ctrl` + `Shift` + `Enter` | 完整声明
|
||||
`Ctrl` + `P` / `Alt` + `Q` | 参数信息/上下文信息
|
||||
`Ctrl` + `Shift` + `I` | 快速定义
|
||||
`Ctrl` + `Q` / `Shift` + `F1` | 快速/外部文档
|
||||
`Alt` + `Insert` | 生成代码
|
||||
`Ctrl` + `O` / `Ctrl` + `I` | 覆盖/实施成员
|
||||
`Ctrl` + `Alt` + `T` | 围绕着……
|
||||
`Ctrl` + `/` | 注释行注释
|
||||
`Ctrl` + `W` / `Ctrl` + `Shift` + `W` | 扩展/收缩选择
|
||||
`Ctrl` + `Alt` + `O` | 优化导入
|
||||
`Ctrl` + `Alt` + `I` | 自动缩进行
|
||||
`Ctrl` + `X` / `Ctrl` + `C` / `Ctrl` + `V` | 剪切/复制/粘贴
|
||||
`Ctrl` + `Shift` + `C` | 复制文档路径
|
||||
`Ctrl` + `Shift` + `V` | 从剪贴板历史粘贴
|
||||
`Ctrl` + `D` | 复制当前行或选择
|
||||
`Ctrl` + `Shift` + `Up` / `Down` | 向上/向下移动线
|
||||
`Ctrl` + `Y` | 删除插入符处的行
|
||||
`Ctrl` + `Shift` + `J` / `Ctrl` + `Enter` | 加入/分割线
|
||||
`Shift` + `Enter` | 开始新行
|
||||
`Ctrl` + `Shift` + `U` | 切换大小写
|
||||
`Ctrl` + `NumPad` `+` / `-` | 展开/折叠代码块
|
||||
`Ctrl` + `Shift` + `NumPad` `+` / `-` | 全部展开/折叠
|
||||
`Ctrl` + `S` | 保存全部
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 版本控制
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Alt` + <code>`</code> | VCS 操作弹出...
|
||||
`Ctrl` + `K` | 提交
|
||||
`Ctrl` + `T` | 更新项目
|
||||
`Alt` + `Shift` + `C` | 近期变动
|
||||
`Ctrl` + `Alt` + `Z` | 恢复
|
||||
`Ctrl` + `Shift` + `K` | 推…
|
||||
`Ctrl` + `Alt` + `Shift` + `Down` / `Up` | 下一个/上一个更改
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 掌握您的 IDE
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Ctrl`+`Shift`+`A` | 寻找行动...
|
||||
`Alt`+`[0-9]` | 打开一个工具窗口
|
||||
`Ctrl`+`Alt`+`Y` | 同步
|
||||
`Ctrl`+<code>`</code> | 快速切换方案...
|
||||
`Ctrl`+`Alt`+`S` | 设置...
|
||||
`F4` / `Alt`+`Home` | 跳转到源/导航栏
|
||||
`F12` | 跳转到最后一个工具窗口
|
||||
`Shift`+`Esc` / `Ctrl`+`Shift`+`F12` | 隐藏活动/所有工具窗口
|
||||
`Alt`+`Right` / `Alt`+`Left` | 转到下一个/上一个编辑器选项卡
|
||||
`Esc` | 转到编辑器(从工具窗口)
|
||||
`Ctrl`+`Shift`+`F4` / `Ctrl`+`F4` | 关闭活动标签/窗口
|
||||
<!--rehype:className=shortcuts left-align-->
|
||||
|
||||
### 找到一切
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Shift` + `Shift` | 到处搜索
|
||||
`Ctrl` + `F` / `R` | 查找/替换
|
||||
`Ctrl` + `Shift` + `F` / `R` | 在路径中查找/在路径中替换
|
||||
`F3` / `Shift` + `F3` | 下/上一个事件
|
||||
`Ctrl` + `F3` | 在插入符处查找单词
|
||||
`Ctrl` + `N` / `Ctrl` + `Shift` + `N` | 去班级/档案
|
||||
`Ctrl` + `F12` | 转到文件成员
|
||||
`Ctrl` + `Alt` + `Shift` + `N` | 转到符号
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 从符号导航
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Ctrl` + `B` | 声明
|
||||
`Ctrl` + `Shift` + `B` | 类型声明 _(仅限 JavaScript)_
|
||||
`Ctrl` + `U` | 超级方法
|
||||
`Ctrl` + `Alt` + `B` | 实施
|
||||
`Alt` + `F7` / `Ctrl` + `F7` | 查找用法/在文件中查找用法
|
||||
`Ctrl` + `Shift` + `F7` | 突出显示文件中的用法
|
||||
`Ctrl` + `Alt` + `F7` | 显示用法
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 重构和清理
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Ctrl` + `Alt` + `Shift` + `T` | 重构这个……
|
||||
`F5` /`F6` | 复制…/移动…
|
||||
`Alt` + `Delete` | 安全删除…
|
||||
`Shift` + `F6` | 改名…
|
||||
`Ctrl` + `F6` | 更改签名…
|
||||
`Ctrl` + `Alt` + `N` | 排队…
|
||||
`Ctrl` + `Alt` + `M` | 提取方法
|
||||
`Ctrl` + `Alt` + `V` / `P` | 引入变量/参数
|
||||
`Ctrl` + `Alt` + `F` / `C` | 引入字段/常量
|
||||
`Ctrl` + `Alt` + `L` | 重新格式化代码
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 分析和探索
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Ctrl` + `F1` | 显示错误描述
|
||||
`F2` / `Shift` + `F2` | 下一个/上一个突出显示的错误
|
||||
`Ctrl` + `Alt` + `Shift` + `I` | 按名称运行检查...
|
||||
`Ctrl` + `H` / `Ctrl` + `Alt` + `H` | 类型/调用层次结构
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 在上下文中导航
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Alt`+`F1` | 选择...
|
||||
`Ctrl`+`E` / `Ctrl`+`Shift`+`E` | 最近查看/最近位置
|
||||
`Ctrl`+`Shift`+`Back` | 最后编辑位置
|
||||
`Ctrl`+`Alt`+`Left` / `Right` | 向后/向前导航
|
||||
`Alt`+`Up` / `Down` | 转到上一个/下一个方法
|
||||
`Ctrl`+`G` | 转到行/列...
|
||||
`Ctrl`+`]` / `[` | 转到代码块结束/开始
|
||||
`Alt`+`Shift`+`F` | 添加到收藏夹
|
||||
`F11` | 切换书签
|
||||
`Ctrl`+`F11` | 使用助记符切换书签
|
||||
`Ctrl`+`[0-9]` | 转到编号书签
|
||||
`Shift`+`F11` | 显示书签
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 构建、运行和调试
|
||||
|
||||
:-- | --
|
||||
:-- | --
|
||||
`Ctrl` + `Shift` + `F10` | 运行上下文配置
|
||||
`Alt` + `Shift` + `F10`/`F9` | 运行/调试所选配置
|
||||
`Shift` + `F10`/`F9` | 运行/调试当前配置
|
||||
`F8` / `F7` | 跨过/进入
|
||||
`Shift` + `F7` | 智能步入
|
||||
`Shift` + `F8` | 走出去
|
||||
`Alt` + `F9` / `Ctrl` + `Alt` + `F9` | 运行到光标/强制运行到光标
|
||||
`Alt` + `F10` | 显示执行点
|
||||
`Alt` + `F8` | 评估表达...
|
||||
`Ctrl` + `F2` | 停止
|
||||
`Ctrl` + `Shift` + `F2` | 停止后台进程...
|
||||
`F9` | 恢复程序
|
||||
`Ctrl` + `F8` | 切换行断点
|
||||
`Ctrl` + `Alt` + `Shift` + `F8` | 切换临时行断点
|
||||
`Ctrl` + `Shift` + `F8` | 编辑/查看断点
|
||||
<!--rehype:className=shortcuts-->
|
@ -441,6 +441,18 @@ Enter your name: Tom
|
||||
True
|
||||
```
|
||||
|
||||
### 转义符号
|
||||
|
||||
| 转义符号 | 对应的操作 |
|
||||
|---|---|
|
||||
| `\\` | 输出反斜杠 |
|
||||
| `\'` | 输出单引号 |
|
||||
| `\"` | 输出双引号 |
|
||||
| `\n` | 换行 |
|
||||
| `\t` | 水平制表符 |
|
||||
| `\r` | 光标回到首位 |
|
||||
| `\b` | 退格 |
|
||||
|
||||
Python F 字符串(自 Python 3.6+ 起)
|
||||
----------------
|
||||
|
||||
|
@ -838,6 +838,16 @@ H2 部分
|
||||
|
||||
默认表格末尾列`右对齐`,添加 `<!--rehype:className=left-align-->` 类让其`左对齐`
|
||||
|
||||
### 强制 code 不换行
|
||||
|
||||
| Command | Description |
|
||||
| ---- | ---- |
|
||||
| `adb remount` | Remounts file system with read/write access |
|
||||
| `adb reboot bootloader` | Reboots the device into fastboot |
|
||||
<!--rehype:className=show-header code-nowrap-->
|
||||
|
||||
添加 `<!--rehype:className=code-nowrap-->` 注释
|
||||
|
||||
列表
|
||||
---
|
||||
|
||||
|
@ -1,7 +1,13 @@
|
||||
React Native 备忘清单
|
||||
===
|
||||
|
||||
[](https://npmjs.org/package/react-native)
|
||||
[](https://www.npmjs.com/package/react-native)
|
||||
[](https://github.com/facebook/react-native/network/dependents)
|
||||
[](https://github.com/facebook/react-native)
|
||||
|
||||
适合初学者的综合 [React Native](https://reactnative.dev/) 备忘清单,在开始 [React Native](https://reactnative.dev/) 之前需要先掌握 [react](./react.md) 库
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
---
|
||||
@ -24,8 +30,8 @@ $ ruby --version
|
||||
|
||||
<red>注意:</red> macOS 12.5.1 附带了 Ruby <pur>**2.6.8**</pur>,这不是 React Native 所要求的,React Native 70+ 需要 Ruby <yel>**2.7.5**</yel>,可以使用下面工具切换版本:
|
||||
|
||||
- [rbenv](https://github.com/rbenv/rbenv)
|
||||
- [RVM](https://rvm.io/)
|
||||
- [rbenv](https://github.com/rbenv/rbenv) _推荐_
|
||||
- [RVM](https://rvm.io/) _推荐_
|
||||
- [chruby](https://github.com/postmodern/chruby)
|
||||
- 带有 [asdf-ruby](https://github.com/asdf-vm/asdf-ruby) 插件的 [asdf-vm](https://github.com/asdf-vm)
|
||||
<!--rehype:className=cols-2-->
|
||||
@ -35,9 +41,11 @@ $ ruby --version
|
||||
```bash
|
||||
$ npx react-native init MyApp
|
||||
# 指定 React Native 版本创建
|
||||
$ npx react-native init MyApp --version X.XX.X
|
||||
$ npx react-native init MyApp \
|
||||
--version X.XX.X
|
||||
# 创建 typescript 版本项目
|
||||
$ npx react-native init MyTSApp --template react-native-template-typescript
|
||||
$ npx react-native init MyTSApp \
|
||||
--template react-native-template-typescript
|
||||
```
|
||||
|
||||
安装依赖
|
||||
@ -52,8 +60,10 @@ $ bundle exec pod install # 以安装 iOS 依赖项
|
||||
运行你的 React Native 应用程序
|
||||
|
||||
```bash
|
||||
# 启动监听打包 JS 服务
|
||||
# 启动监听打包 JS 服务,默认端口 8081
|
||||
$ npx react-native start
|
||||
# 指定 8088 端口
|
||||
$ npx react-native start --port=8088
|
||||
# 启动 iOS 模拟器运行你的应用
|
||||
$ npx react-native run-ios
|
||||
```
|
||||
@ -68,7 +78,7 @@ $ npx react-native run-ios
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### macOS 安装 Android 环境
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
您将需要 Node、Watchman、React Native 命令行界面、JDK 和 Android Studio
|
||||
|
||||
@ -141,11 +151,14 @@ $ npx react-native start
|
||||
$ npx react-native run-ios
|
||||
```
|
||||
|
||||
---
|
||||
### 打开 React Native Debug 菜单
|
||||
|
||||
:- | --
|
||||
:- | --
|
||||
`⌘` + `M` | 打开<yel>开发者</yel>菜单
|
||||
`⌘` + `M`(Android) | 打开<yel>开发者</yel>菜单
|
||||
`⌘` + `D`(iOS) | 打开<yel>开发者</yel>菜单
|
||||
`Ctrl` + `D`(Linux) | 打开<yel>开发者</yel>菜单
|
||||
<pur>摇动您的设备</pur> | 打开<yel>开发者</yel>菜单
|
||||
按两次 `R` 键 | 构建并运行
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
|
@ -1,17 +1,24 @@
|
||||
React 备忘清单
|
||||
===
|
||||
|
||||
适合初学者的综合 React 备忘清单。
|
||||
[](https://npmjs.org/package/react)
|
||||
[](https://www.npmjs.com/package/react)
|
||||
[](https://github.com/facebook/react/network/dependents)
|
||||
[](https://github.com/facebook/react)
|
||||
|
||||
适合初学者的综合 React 备忘清单
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
----
|
||||
|
||||
### 介绍
|
||||
|
||||
React 是一个用于构建用户界面的 JavaScript 库。
|
||||
React 是一个用于构建用户界面的 JavaScript 库
|
||||
|
||||
- [React 官方文档](https://reactjs.org/) _(reactjs.org)_
|
||||
- [Styled Components 备忘清单](./styled-components.md) _(jaywcjlove.github.io)_
|
||||
- [TypeScript JSX 备忘清单](./typescript.md#jsx) _(jaywcjlove.github.io)_
|
||||
|
||||
```js
|
||||
import {createRoot} from 'react-dom/client'
|
||||
|
1071
docs/reactrouter.md
Normal file
3594
docs/redis.md
Normal file
14
docs/rust.md
@ -223,6 +223,18 @@ fn main(){
|
||||
}
|
||||
```
|
||||
|
||||
### 区间表达式
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
产生式/句法规则 | 句法 | 类型 | 区间语义
|
||||
:- | :- | :- | :-
|
||||
RangeExpr | `start..end` | std::ops::Range | start ≤ x < end
|
||||
RangeFromExpr | `start..` | std::ops::RangeFrom | start ≤ x
|
||||
RangeToExpr | `..end` | std::ops::RangeTo | x < end
|
||||
RangeFullExpr | `..` | std::ops::RangeFull | -
|
||||
RangeInclusiveExpr | `start..=end`| std::ops::RangeInclusive | start ≤ x ≤ end
|
||||
RangeToInclusiveExpr | `..=end` | std::ops::RangeToInclusive | x ≤ end
|
||||
|
||||
Rust 类型
|
||||
--------
|
||||
|
||||
@ -791,7 +803,7 @@ let left_shift = h << 4; // => 32
|
||||
示例 | 意义
|
||||
:- | :-
|
||||
`c && d` | 两者都是真的_(AND)_
|
||||
`c || d` | 要么是真的_(OR)_
|
||||
`c \|\| d` | 要么是真的_(OR)_
|
||||
`!c` | `c` 为假 _(NOT)_
|
||||
|
||||
----
|
||||
|
@ -1,7 +1,13 @@
|
||||
Sass
|
||||
===
|
||||
|
||||
这是一份快速参考备忘单,列出了 [SASS](https://sass-lang.com) 最有用的功能。
|
||||
[](https://www.npmjs.com/package/sass)
|
||||
[](https://www.npmjs.com/package/sass)
|
||||
[](https://github.com/sass/dart-sass/network/dependents)
|
||||
[](https://github.com/sass/dart-sass)
|
||||
|
||||
这是一份快速参考备忘单,列出了 [SASS](https://sass-lang.com) 最有用的功能
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
Sass 基础
|
||||
--------
|
||||
|
@ -1,7 +1,13 @@
|
||||
Styled Components 备忘清单
|
||||
====
|
||||
|
||||
此快速参考备忘单提供了使用 CSS in JS 工具的各种方法。
|
||||
[](https://npmjs.org/package/styled-components)
|
||||
[](https://www.npmjs.com/package/styled-components)
|
||||
[](https://github.com/styled-components/styled-components/network/dependents)
|
||||
[](https://github.com/styled-components/styled-components)
|
||||
|
||||
此快速参考备忘单提供了使用 CSS in JS 工具的各种方法
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
----
|
||||
|
@ -1,7 +1,13 @@
|
||||
Stylus 备忘清单
|
||||
===
|
||||
|
||||
本备忘单旨在快速理解 [stylus](https://github.com/stylus/stylus) 所涉及的主要概念,显示了它的常用方法使用清单。
|
||||
[](https://npmjs.org/package/stylus)
|
||||
[](https://www.npmjs.com/package/stylus)
|
||||
[](https://github.com/stylus/stylus/network/dependents)
|
||||
[](https://github.com/stylus/stylus)
|
||||
|
||||
本备忘单旨在快速理解 [stylus](https://github.com/stylus/stylus) 所涉及的主要概念,显示了它的常用方法使用清单
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
---
|
||||
|
@ -114,6 +114,25 @@ Sublime Text 备忘清单
|
||||
`⇧ ⌃ 2` | 将文件移动到组 2
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 书签
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `F2` | 切换书签
|
||||
`F2` | 下一个书签
|
||||
`Shift` `F2` | 上一个书签
|
||||
`Ctrl` `Shift` `F2` | 清除书签
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 查找/替换
|
||||
|
||||
快捷键 | 说明
|
||||
:- | -
|
||||
`Ctrl` `F` | 查找
|
||||
`Ctrl` `H` | 代替
|
||||
`Ctrl` `Shift` `F` | 在文件中查找
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 文本操作
|
||||
|
||||
快捷键 | 说明
|
||||
@ -148,3 +167,4 @@ $ subl README.md
|
||||
|
||||
- [Sublime Text 官网](https://www.sublimetext.com/) _(sublimetext.com)_
|
||||
- [Sublime 编辑器快捷键](https://jaywcjlove.github.io/handbook/Shortcuts/sublime.html) _(jaywcjlove.github.io)_
|
||||
- [Keyboard shortcuts for Sublime Text](http://docs.sublimetext.info/en/latest/reference/keyboard_shortcuts_win.html) _(docs.sublimetext.info)_
|
||||
|
@ -1,4 +1,4 @@
|
||||
Systemd
|
||||
Systemd 备忘清单
|
||||
===
|
||||
|
||||
最常用的 [Systemd](https://systemd.io/) 命令备忘单快速参考
|
||||
|
3238
docs/tailwindcss.md
Normal file
@ -1,7 +1,13 @@
|
||||
TypeScript 备忘清单
|
||||
===
|
||||
|
||||
包含最重要基础、泛型、方法、class 等 TypeScript 强类型编程语言语法的快速参考备忘单。初学者的完整快速参考。
|
||||
[](https://www.npmjs.com/package/typescript)
|
||||
[](https://www.npmjs.com/package/typescript)
|
||||
[](https://github.com/Microsoft/TypeScript/network/dependents)
|
||||
[](https://github.com/Microsoft/TypeScript)
|
||||
|
||||
包含最重要基础、泛型、方法、class 等 TypeScript 强类型编程语言语法的快速参考备忘单。初学者的完整快速参考
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门 Interface
|
||||
----
|
||||
@ -1265,6 +1271,24 @@ class Select<T> extends React.Component<SelectProps<T>, any> {}
|
||||
const Form = () => <Select<string> items={['a', 'b']} />;
|
||||
```
|
||||
|
||||
### 函数组件 ref
|
||||
<!--rehype:wrap-class=col-span-3-->
|
||||
|
||||
```tsx
|
||||
import { FC, ForwardedRef, forwardRef, PropsWithRef } from "react";
|
||||
|
||||
function InternalProgress(props: ProgressProps, ref?: ForwardedRef<HTMLDivElement>) {
|
||||
return (
|
||||
<div {...props} ref={ref}>
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export interface ProgressProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {}
|
||||
export const Progress: FC<PropsWithRef<ProgressProps>> = forwardRef<HTMLDivElement>(InternalProgress)
|
||||
```
|
||||
|
||||
各种各样的技巧
|
||||
---
|
||||
|
||||
@ -1326,21 +1350,27 @@ const point = [3, 4] as const
|
||||
```
|
||||
|
||||
### satisfies
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
`satisfies` 允许将验证表达式的类型与某种类型匹配,而无需更改该表达式的结果类型。
|
||||
|
||||
```ts
|
||||
type Colors = 'red' | 'green' | 'blue';
|
||||
type RGB = [
|
||||
red: number,
|
||||
green: number,
|
||||
blue: number
|
||||
];
|
||||
type Palette = Record<Colors, string | RGB>
|
||||
|
||||
type RGB = [red: number, green: number, blue: number];
|
||||
|
||||
const palette: Record<Colors, string | RGB> = {
|
||||
const palette: Palette = {
|
||||
red: [255, 0, 0],
|
||||
green: '#00ff00',
|
||||
blue: [0, 0, 255],
|
||||
};
|
||||
|
||||
// 通常的方式会推导出 redComponent 为 string | number | undefined
|
||||
// 通常的方式会推导出 redComponent 为
|
||||
// => string | number | undefined
|
||||
const redComponent = palette.red.at(0);
|
||||
```
|
||||
|
||||
@ -1356,10 +1386,10 @@ const palette = {
|
||||
// undefined | number
|
||||
const redComponent = palette.red.at(0)
|
||||
```
|
||||
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 范型实例化表达式
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
不使用的情况下:
|
||||
|
||||
@ -1403,6 +1433,207 @@ const makeStringBox = makeBox<string>;
|
||||
makeStringBox(42);
|
||||
```
|
||||
|
||||
### 识别全局修改模块
|
||||
|
||||
```ts
|
||||
declare global {
|
||||
interface String {
|
||||
fancyFormat(opts: FancyOption): string;
|
||||
}
|
||||
}
|
||||
export interface FancyOption {
|
||||
fancinessLevel: number;
|
||||
}
|
||||
```
|
||||
|
||||
.d.ts 模版
|
||||
---
|
||||
|
||||
### Module: Plugin
|
||||
|
||||
例如,当您想使用扩展另一个库的 JavaScript 代码时
|
||||
|
||||
```ts
|
||||
import { greeter } from "super-greeter";
|
||||
// 普通欢迎 API
|
||||
greeter(2);
|
||||
greeter("Hello world");
|
||||
// 现在我们在运行时用一个新函数扩展对象
|
||||
import "hyper-super-greeter";
|
||||
greeter.hyperGreet();
|
||||
```
|
||||
|
||||
"`super-greeter`" 的定义:
|
||||
|
||||
```ts
|
||||
/* 此示例说明如何为您的函数设置多个重载 */
|
||||
export interface GreeterFunction {
|
||||
(name: string): void
|
||||
(time: number): void
|
||||
}
|
||||
/* 此示例显示如何导出接口指定的函数 */
|
||||
export const greeter: GreeterFunction;
|
||||
```
|
||||
|
||||
我们可以像下面这样扩展现有模块:
|
||||
|
||||
```ts
|
||||
/* 导入这个模块添加到的模块 */
|
||||
import { greeter } from "super-greeter";
|
||||
/* 声明与上面导入的模块相同的模块,然后我们扩展 greeter 函数的现有声明 */
|
||||
export module "super-greeter" {
|
||||
export interface GreeterFunction {
|
||||
/** Greets even better! */
|
||||
hyperGreet(): void;
|
||||
}
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### 全局库模板 Global .d.ts
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
全局库可能如下所示:
|
||||
|
||||
```ts
|
||||
function createGreeting(s) {
|
||||
return "Hello, " + s;
|
||||
}
|
||||
```
|
||||
|
||||
或者像这样:
|
||||
|
||||
```ts
|
||||
window.createGreeting = function (s) {
|
||||
return "Hello, " + s;
|
||||
};
|
||||
```
|
||||
|
||||
<pur>类型声明示例</pur>
|
||||
|
||||
```ts
|
||||
/* 可以作为 myLib(3) 此处包含这些调用签名 */
|
||||
declare function myLib(a: string): string;
|
||||
declare function myLib(a: number): number;
|
||||
/* 如果你希望这个库的名称是一个有效的类型名称,你可以在这里这样做例如,这允许我们写 'var x: myLib'; 确保这确实有意义! 如果没有,只需删除此声明并在下面的命名空间内添加类型 */
|
||||
interface myLib {
|
||||
name: string;
|
||||
length: number;
|
||||
extras?: string[];
|
||||
}
|
||||
/* 如果您的库在全局变量上公开了属性,请将它们放在此处。 您还应该在此处放置类型(接口和类型别名) */
|
||||
declare namespace myLib {
|
||||
// 我们可以写 'myLib.timeout = 50;'
|
||||
let timeout: number;
|
||||
// 我们可以访问 'myLib.version',但不能更改它
|
||||
const version: string;
|
||||
// 我们可以通过 'let c = new myLib.Cat(42)' 创建一些类或参考例如 '函数 f(c: myLib.Cat) { ... }
|
||||
class Cat {
|
||||
constructor(n: number);
|
||||
// 我们可以从 'Cat' 实例中读取 'c.age'
|
||||
readonly age: number;
|
||||
// 我们可以从 'Cat' 实例调用 'c.purr()'
|
||||
purr(): void;
|
||||
}
|
||||
// 我们可以将变量声明为
|
||||
// 'var s: myLib.CatSettings = { weight: 5, name: "Maru" };'
|
||||
interface CatSettings {
|
||||
weight: number;
|
||||
name: string;
|
||||
tailLength?: number;
|
||||
}
|
||||
// 我们可以写 'const v: myLib.VetID = 42;'
|
||||
// 或 'const v: myLib.VetID = "bob";'
|
||||
type VetID = string | number;
|
||||
// 我们可以调用 'myLib.checkCat(c)' 或 'myLib.checkCat(c, v);'
|
||||
function checkCat(c: Cat, s?: VetID);
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### Module: Function
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```ts
|
||||
import greeter from "super-greeter";
|
||||
greeter(2);
|
||||
greeter("Hello world");
|
||||
```
|
||||
|
||||
要处理通过 `UMD` 和模块导入:
|
||||
|
||||
```ts
|
||||
/* 如果此模块是一个 UMD 模块,在模块加载器环境之外加载时公开全局变量“myFuncLib”,请在此处声明该全局变量。 否则,删除此声明 */
|
||||
export as namespace myFuncLib;
|
||||
/* 此声明指定该函数是从文件中导出的对象 */
|
||||
export = Greeter;
|
||||
/* 此示例说明如何为您的函数设置多个重载 */
|
||||
declare function Greeter(name: string): Greeter.NamedReturnType;
|
||||
declare function Greeter(length: number): Greeter.LengthReturnType;
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
如果你也想从你的模块中公开类型,你可以把它们放在这个块中。 通常你会想要描述函数返回类型的形状; 如本例所示,应在此处声明该类型,请注意,如果您决定包含此命名空间,则模块可能会被错误地导入为命名空间对象,除非 `--esModuleInterop` 已打开: `import * as x from '[~THE MODULE~]';` 错误的!不要这样做!
|
||||
|
||||
```ts
|
||||
declare namespace Greeter {
|
||||
export interface LengthReturnType {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
export interface NamedReturnType {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
}
|
||||
/**
|
||||
* 如果模块也有属性,在这里声明它们。 例如,这个声明说这个代码是合法的:
|
||||
* import f = require('super-greeter');
|
||||
* console.log(f.defaultName);
|
||||
*/
|
||||
export const defaultName: string;
|
||||
export let defaultLength: number;
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
### Module: Class
|
||||
|
||||
例如,当您想要使用如下所示的 `JavaScript` 代码时:
|
||||
|
||||
```ts
|
||||
const Greeter = require("super-greeter");
|
||||
const greeter = new Greeter();
|
||||
greeter.greet();
|
||||
```
|
||||
|
||||
要处理通过 `UMD` 和模块导入:
|
||||
|
||||
```ts
|
||||
export as namespace "super-greeter";
|
||||
/* 此声明指定类构造函数是从文件中导出的对象 */
|
||||
export = Greeter;
|
||||
/* 在此类中编写模块的方法和属性 */
|
||||
declare class Greeter {
|
||||
constructor(customGreeting?: string);
|
||||
greet: void;
|
||||
myMethod(opts: MyClass.MyClassMethodOptions): number;
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
如果你也想从你的模块中公开类型,你可以把它们放在这个块中,如果您决定包含此命名空间,则模块可能会被错误地导入为命名空间对象,除非 --esModuleInterop 已打开:
|
||||
`import * as x from '[~THE MODULE~]';` 错误的! 不要这样做!
|
||||
|
||||
```ts
|
||||
declare namespace MyClass {
|
||||
export interface MyClassMethodOptions {
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
}
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
CLI
|
||||
---
|
||||
|
||||
@ -1434,7 +1665,7 @@ $ tsc app.ts util.ts --target esnext --outfile index.js
|
||||
`--init` _boolean_ | 初始化 TypeScript 项目并创建 tsconfig.json 文件
|
||||
`--listFilesOnly` _boolean_ | 打印作为编译一部分的文件名,然后停止处理
|
||||
`--locale` _string_ | 设置来自 TypeScript 的消息传递语言。 这不影响发射
|
||||
`--project` _string_ | 编译项目给定其配置文件的路径,或带有“tsconfig.json”的文件夹
|
||||
`--project` _string_ | 编译项目给定其配置文件的路径,或带有 'tsconfig.json' 的文件夹
|
||||
`--showConfig` _boolean_ | 打印最终配置而不是构建
|
||||
`--version` _boolean_ | 打印编译器的版本
|
||||
<!--rehype:className=style-list-->
|
||||
|
@ -5,16 +5,16 @@ VSCode 备忘清单
|
||||
|
||||
## Windows
|
||||
|
||||
### 一般的
|
||||
### 通用
|
||||
|
||||
| - | - |
|
||||
|-----------------------------|------------------------|
|
||||
| `Ctrl` `Shift` `P` _/_ `F1` | 显示命令面板 |
|
||||
| `Ctrl` `P` | 快速打开,转到文件 |
|
||||
| `Ctrl` `Shift` `N` | 新窗户 |
|
||||
| `Ctrl` `Shift` `W` | 关闭窗口 |
|
||||
| `Ctrl` `,` | 用户设置 |
|
||||
| `Ctrl` `K` `Ctrl` `S` | 键盘快捷键 |
|
||||
| `Ctrl` `Shift` `N` | 打开新窗口 |
|
||||
| `Ctrl` `Shift` `W` | 关闭当前窗口 |
|
||||
| `Ctrl` `,` | 打开用户设置 |
|
||||
| `Ctrl` `K` `Ctrl` `S` | 打开键盘快捷键设置 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 基本编辑
|
||||
@ -36,16 +36,16 @@ VSCode 备忘清单
|
||||
| `Ctrl` `End` | 转到文件末尾 |
|
||||
| `Ctrl` `↑` _/_ `↓` | 向上/向下滚动行 |
|
||||
| `Alt` `PgUp` _/_ `PgDn` | 向上/向下滚动页面 |
|
||||
| `Ctrl` `Shift` `[` | 折叠(折叠)区域 |
|
||||
| `Ctrl` `Shift` `]` | 展开(展开)区域 |
|
||||
| `Ctrl` `K` `Ctrl` `[` | 折叠(折叠)所有子区域 |
|
||||
| `Ctrl` `K` `Ctrl` `]` | 展开(展开)所有子区域 |
|
||||
| `Ctrl` `K` `Ctrl` `0` | 折叠(折叠)所有区域 |
|
||||
| `Ctrl` `K` `Ctrl` `J` | 展开(展开)所有区域 |
|
||||
| `Ctrl` `Shift` `[` | 折叠区域 |
|
||||
| `Ctrl` `Shift` `]` | 展开区域 |
|
||||
| `Ctrl` `K` `Ctrl` `[` | 折叠所有子区域 |
|
||||
| `Ctrl` `K` `Ctrl` `]` | 展开所有子区域 |
|
||||
| `Ctrl` `K` `Ctrl` `0` | 折叠所有区域 |
|
||||
| `Ctrl` `K` `Ctrl` `J` | 展开所有区域 |
|
||||
| `Ctrl` `K` `Ctrl` `C` | 添加行注释 |
|
||||
| `Ctrl` `K` `Ctrl` `U` | 删除行注释 |
|
||||
| `Ctrl` `/` | 切换行注释 |
|
||||
| `Shift` `Alt` `A` | 切换块评论 |
|
||||
| `Shift` `Alt` `A` | 切换块注释 |
|
||||
| `Alt` `Z` | 切换自动换行 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
@ -54,28 +54,28 @@ VSCode 备忘清单
|
||||
| - | - |
|
||||
|----------------------|--------------------|
|
||||
| `Ctrl` `T` | 显示所有符号 |
|
||||
| `Ctrl` `G` | 去线 |
|
||||
| `Ctrl` `G` | 跳转到指定行数 |
|
||||
| `Ctrl` `P` | 转到文件 |
|
||||
| `Ctrl` `Shift` `O` | 转到符号 |
|
||||
| `Ctrl` `Shift` `M` | 显示问题面板 |
|
||||
| `F8` | 转到下一个错误 |
|
||||
| `Shift` `F8` | 转到上一个错误 |
|
||||
| `Ctrl` `Shift` `Tab` | 浏览编辑组历史 |
|
||||
| `Alt` `←` _/_ `→` | 后退/前进 |
|
||||
| `Ctrl` `M` | 切换 Tab 移动焦点 |
|
||||
| `Alt` `←` _/_ `→` | 后退/前进 |
|
||||
| `Ctrl` `M` | 切换按 Tab 移动焦点 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 搜索和替换
|
||||
|
||||
| - | - |
|
||||
|---------------------------|---------------------------------|
|
||||
| `Ctrl` `F` | 寻找 |
|
||||
| `Ctrl` `H` | 代替 |
|
||||
| `Ctrl` `F` | 查找 |
|
||||
| `Ctrl` `H` | 替换 |
|
||||
| `F3` _/_ `Shift` `F3` | 查找下一个/上一个 |
|
||||
| `Alt` `Enter` | 选择所有出现的查找匹配项 |
|
||||
| `Ctrl` `D` | 将选择添加到下一个查找匹配项 |
|
||||
| `Ctrl` `K` `Ctrl` `D` | 将最后一个选择移动到下一个查找匹配项 |
|
||||
| `Alt` `C` _/_ `R` _/_ `W` | 切换区分大小写/正则表达式/整个单词 |
|
||||
| `Ctrl` `D` | 将所选内容设置为查找关键词 |
|
||||
| `Ctrl` `K` `Ctrl` `D` | 将上一个选择移动到下一个查找匹配项 |
|
||||
| `Alt` `C` _/_ `R` _/_ `W` | 切换区分大小写/正则表达式/全字匹配 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
### 多光标和选择
|
||||
@ -90,7 +90,7 @@ VSCode 备忘清单
|
||||
| `Ctrl` `Shift` `L` | 选择当前选择的所有匹配项 |
|
||||
| `Ctrl` `F2` | 选择当前单词的所有出现 |
|
||||
| `Shift` `Alt` `→` | 展开选择 |
|
||||
| `Shift` `Alt` `←` | 收缩选择 |
|
||||
| `Shift` `Alt` `←` | 收起选择 |
|
||||
| `Shift` `Alt` `<Drag>` | 列(框)选择 |
|
||||
| `Ctrl` `Shift` `Alt` `<Arrow>` | 列(框)选择 |
|
||||
| `Ctrl` `Shift` `Alt` `PgUp` _/_ `PgDn` | 列(框)选择页上/下 |
|
||||
@ -100,17 +100,17 @@ VSCode 备忘清单
|
||||
|
||||
| - | - |
|
||||
|-----------------------------|-----------------|
|
||||
| `Ctrl` `<Space>` `Ctrl` `I` | 触发建议 |
|
||||
| `Ctrl` `Shift` `<Space>` | 触发参数提示 |
|
||||
| `Ctrl` `<Space>` `Ctrl` `I` | 显示建议 |
|
||||
| `Ctrl` `Shift` `<Space>` | 显示参数提示 |
|
||||
| `Shift` `Alt` `F` | 格式化文档 |
|
||||
| `Ctrl` `K` `Ctrl` `F` | 格式选择 |
|
||||
| `Ctrl` `K` `Ctrl` `F` | 格式化所选区域 |
|
||||
| `F12` | 转到定义 |
|
||||
| `Alt` `F12` | 窥视定义 |
|
||||
| `Ctrl` `K` `F12` | 打开定义到一边 |
|
||||
| `Ctrl` `.` | 快速解决 |
|
||||
| `Shift` `F12` | 显示参考 |
|
||||
| `Alt` `F12` | 速览定义 |
|
||||
| `Ctrl` `K` `F12` | 在侧边栏中打开定义 |
|
||||
| `Ctrl` `.` | 快速修复 |
|
||||
| `Shift` `F12` | 显示引用 |
|
||||
| `F2` | 重命名符号 |
|
||||
| `Ctrl` `K` `Ctrl` `X` | 修剪尾随空格 |
|
||||
| `Ctrl` `K` `Ctrl` `X` | 删除尾随空格 |
|
||||
| `Ctrl` `K` `M` | 更改文件语言 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
|
||||
@ -121,8 +121,8 @@ VSCode 备忘清单
|
||||
| `Ctrl` `F4` `Ctrl` `W` | 关闭编辑器 |
|
||||
| `Ctrl` `K` `F` | 关闭文件夹 |
|
||||
| `Ctrl` `\` | 拆分编辑器 |
|
||||
| `Ctrl` `1` _/_ `2` _/_ `3` | 专注于第一、第二或第三编辑组 |
|
||||
| `Ctrl` `K` `Ctrl` `←` _/_ `→` | 专注于上一个/下一个编辑组 |
|
||||
| `Ctrl` `1` _/_ `2` _/_ `3` | 将焦点切换到第一/二/三编辑组 |
|
||||
| `Ctrl` `K` `Ctrl` `←` _/_ `→` | 将焦点切换到上/下一个编辑组 |
|
||||
| `Ctrl` `Shift` `PgUp` _/_ `PgDn` | 向左/向右移动编辑器 |
|
||||
| `Ctrl` `K` `←` _/_ `→` | 移动活动编辑器组 |
|
||||
<!--rehype:className=shortcuts-->
|
||||
@ -137,11 +137,11 @@ VSCode 备忘清单
|
||||
| `Ctrl` `Shift` `S` | 另存为 |
|
||||
| `Ctrl` `K` `S` | 保存所有 |
|
||||
| `Ctrl` `F4` | 关闭 |
|
||||
| `Ctrl` `K` `Ctrl` `W` | 关闭松油 |
|
||||
| `Ctrl` `K` `Ctrl` `W` | 关闭所有 |
|
||||
| `Ctrl` `Shift` `T` | 重新打开关闭的编辑器 |
|
||||
| `Ctrl` `K` `Enter` | 保持预览模式编辑器打开 |
|
||||
| `Ctrl` `Tab` | Open next |
|
||||
| `Ctrl` `Shift` `Tab` | Open previous |
|
||||
| `Ctrl` `Tab` | 打开下一项 |
|
||||
| `Ctrl` `Shift` `Tab` | 打开上一项 |
|
||||
| `Ctrl` `K` `P` | 复制活动文件的路径 |
|
||||
| `Ctrl` `K` `R` | 在资源管理器中显示活动文件 |
|
||||
| `Ctrl` `K` `O` | 在新窗口/实例中显示活动文件 |
|
||||
@ -175,12 +175,12 @@ VSCode 备忘清单
|
||||
| `F9` | 切换断点 |
|
||||
| `F5` | 开始/继续 |
|
||||
| `Shift` `F5` | 停止 |
|
||||
| `Shift` `F11` _/_ `F11` | 进/出 |
|
||||
| `F10` | 跨过去 |
|
||||
| `Shift` `F11` _/_ `F11` | 单步调试/跳出 |
|
||||
| `F10` | 单步跳过 |
|
||||
| `Ctrl` `K` `Ctrl` `I` | 显示悬停 |
|
||||
| `Ctrl` <code>\`</code> | 显示综合终端 |
|
||||
| `Ctrl` `Shift` <code>\`</code> | 创建一个新终端 |
|
||||
| `Ctrl` `C` | 复制选择 |
|
||||
| `Ctrl` `C` | 复制所选内容 |
|
||||
| `Ctrl` `V` | 粘贴到活动终端 |
|
||||
| `Ctrl` `↑` _/_ `↓` | 向上/向下滚动 |
|
||||
| `Shift` `PgUp` _/_ `PgDn` | 向上/向下滚动页面 |
|
||||
|
436
docs/vue.md
@ -1,7 +1,13 @@
|
||||
Vue 3 备忘清单
|
||||
===
|
||||
|
||||
渐进式 JavaScript 框架 [Vue 3](https://cn.vuejs.org/) 备忘清单的快速参考列表,包含常用 API 和示例。
|
||||
[](https://npmjs.org/package/vue)
|
||||
[](https://www.npmjs.com/package/vue)
|
||||
[](https://github.com/vuejs/core/network/dependents)
|
||||
[](https://github.com/vuejs/core)
|
||||
|
||||
渐进式 JavaScript 框架 [Vue 3](https://cn.vuejs.org/) 备忘清单的快速参考列表,包含常用 API 和示例
|
||||
<!--rehype:style=padding-top: 12px;-->
|
||||
|
||||
入门
|
||||
---
|
||||
@ -677,6 +683,434 @@ const value = inject(ProvideKey)
|
||||
|
||||
<!--rehype:className=wrap-text -->
|
||||
|
||||
Vue 中使用 TypeScript
|
||||
---
|
||||
|
||||
### 为组件的 props 标注类型
|
||||
<!--rehype:wrap-class=row-span-4-->
|
||||
|
||||
当使用 `<script setup>` 时,`defineProps()` 宏函数支持从它的参数中推导类型
|
||||
|
||||
```html
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
foo: { type: String, required: true },
|
||||
bar: Number
|
||||
})
|
||||
|
||||
props.foo // string
|
||||
props.bar // number | undefined
|
||||
</script>
|
||||
```
|
||||
|
||||
对同一个文件中的一个接口或对象类型字面量的引用:
|
||||
|
||||
```ts
|
||||
interface Props {/* ... */}
|
||||
|
||||
defineProps<Props>()
|
||||
```
|
||||
|
||||
#### Props 解构默认值
|
||||
|
||||
```ts
|
||||
export interface Props {
|
||||
msg?: string
|
||||
labels?: string[]
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
msg: 'hello',
|
||||
labels: () => ['one', 'two']
|
||||
})
|
||||
```
|
||||
|
||||
使用目前为实验性的响应性语法糖
|
||||
|
||||
```html
|
||||
<script setup lang="ts">
|
||||
interface Props {
|
||||
name: string
|
||||
count?: number
|
||||
}
|
||||
|
||||
// 对 defineProps() 的响应性解构
|
||||
// 默认值会被编译为等价的运行时选项
|
||||
const {
|
||||
name, count = 100
|
||||
} = defineProps<Props>()
|
||||
</script>
|
||||
```
|
||||
|
||||
### 为组件的 emits 标注类型
|
||||
|
||||
```html
|
||||
<script setup lang="ts">
|
||||
// 运行时
|
||||
const emit = defineEmits(['change', 'update'])
|
||||
|
||||
// 基于类型
|
||||
const emit = defineEmits<{
|
||||
(e: 'change', id: number): void
|
||||
(e: 'update', value: string): void
|
||||
}>()
|
||||
</script>
|
||||
```
|
||||
|
||||
### 为 ref() 标注类型
|
||||
|
||||
ref 会根据初始化时的值推导其类型:
|
||||
|
||||
```ts
|
||||
import { ref } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
const year: Ref<string | number> = ref('2020')
|
||||
|
||||
year.value = 2020 // 成功!
|
||||
```
|
||||
|
||||
### 为 reactive() 标注类型
|
||||
|
||||
```ts
|
||||
import { reactive } from 'vue'
|
||||
|
||||
interface Book {
|
||||
title: string
|
||||
year?: number
|
||||
}
|
||||
|
||||
const book: Book = reactive({
|
||||
title: 'Vue 3 指引'
|
||||
})
|
||||
```
|
||||
|
||||
### 为 computed() 标注类型
|
||||
|
||||
你还可以通过泛型参数显式指定类型:
|
||||
|
||||
```ts
|
||||
const double = computed<number>(() => {
|
||||
// 若返回值不是 number 类型则会报错
|
||||
})
|
||||
```
|
||||
|
||||
### 为事件处理函数标注类型
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```html
|
||||
<script setup lang="ts">
|
||||
function handleChange(event) {
|
||||
// `event` 隐式地标注为 `any` 类型
|
||||
console.log(event.target.value)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<input
|
||||
type="text"
|
||||
@change="handleChange" />
|
||||
</template>
|
||||
```
|
||||
|
||||
显式地为事件处理函数的参数标注类型
|
||||
|
||||
```ts
|
||||
function handleChange(event: Event) {
|
||||
const target = event.target as HTMLInputElement
|
||||
console.log(target.value)
|
||||
}
|
||||
```
|
||||
|
||||
### 为 provide / inject 标注类型
|
||||
|
||||
```ts
|
||||
import { provide, inject } from 'vue'
|
||||
import type { InjectionKey } from 'vue'
|
||||
|
||||
const key = Symbol() as InjectionKey<string>
|
||||
// 若提供的是非字符串值会导致错误
|
||||
provide(key, 'foo')
|
||||
// foo 的类型:string | undefined
|
||||
const foo = inject(key)
|
||||
```
|
||||
|
||||
### 为模板引用标注类型
|
||||
|
||||
```html
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
const el = ref<HTMLInputElement | null>(null)
|
||||
|
||||
onMounted(() => {
|
||||
el.value?.focus()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<input ref="el" />
|
||||
</template>
|
||||
```
|
||||
|
||||
### 为组件模板引用标注类型
|
||||
|
||||
```html
|
||||
<!-- MyModal.vue -->
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
const isContentShown = ref(false)
|
||||
const open =
|
||||
() => (isContentShown.value = true)
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
```
|
||||
|
||||
使用 TypeScript 内置的 `InstanceType` 工具类型来获取其实例类
|
||||
|
||||
```html
|
||||
<!-- App.vue -->
|
||||
<script setup lang="ts">
|
||||
import MyModal from './MyModal.vue'
|
||||
|
||||
type Modal = InstanceType<typeof MyModal>
|
||||
|
||||
const modal = ref<Modal | null>(null)
|
||||
|
||||
const openModal = () => {
|
||||
modal.value?.open()
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
### 选项式 API 为组件的 props 标注类型
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```ts
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
// 启用了类型推导
|
||||
props: {
|
||||
name: String,
|
||||
id: [Number, String],
|
||||
msg: { type: String, required: true },
|
||||
metadata: null
|
||||
},
|
||||
mounted() {
|
||||
// 类型:string | undefined
|
||||
this.name
|
||||
// 类型:number|string|undefined
|
||||
this.id
|
||||
// 类型:string
|
||||
this.msg
|
||||
// 类型:any
|
||||
this.metadata
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
使用 PropType 这个工具类型来标记更复杂的 props 类型
|
||||
|
||||
```ts
|
||||
import { defineComponent } from 'vue'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
interface Book {
|
||||
title: string
|
||||
author: string
|
||||
year: number
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
book: {
|
||||
// 提供相对 `Object` 更确定的类型
|
||||
type: Object as PropType<Book>,
|
||||
required: true
|
||||
},
|
||||
// 也可以标记函数
|
||||
callback: Function as PropType<(id: number) => void>
|
||||
},
|
||||
mounted() {
|
||||
this.book.title // string
|
||||
this.book.year // number
|
||||
|
||||
// TS Error: argument of type 'string' is not
|
||||
// assignable to parameter of type 'number'
|
||||
this.callback?.('123')
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### 选项式 API 为组件的 emits 标注类型
|
||||
|
||||
```ts
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
type Payload = { bookName: string }
|
||||
|
||||
export default defineComponent({
|
||||
emits: {
|
||||
addBook(payload: Payload) {
|
||||
// 执行运行时校验
|
||||
return payload.bookName.length > 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit() {
|
||||
this.$emit('addBook', {
|
||||
bookName: 123 // 类型错误
|
||||
})
|
||||
// 类型错误
|
||||
this.$emit('non-declared-event')
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### 选项式 API 为计算属性标记类型
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
计算属性会自动根据其返回值来推导其类型:
|
||||
|
||||
```ts
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
message: 'Hello!'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
greeting() {
|
||||
return this.message + '!'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.greeting // 类型:string
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
在某些场景中,你可能想要显式地标记出计算属性的类型以确保其实现是正确的:
|
||||
|
||||
```ts
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
message: 'Hello!'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 显式标注返回类型
|
||||
greeting(): string {
|
||||
return this.message + '!'
|
||||
},
|
||||
|
||||
// 标注一个可写的计算属性
|
||||
greetingUppercased: {
|
||||
get(): string {
|
||||
return this.greeting.toUpperCase()
|
||||
},
|
||||
set(newValue: string) {
|
||||
this.message = newValue.toUpperCase()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### 选项式 API 为事件处理函数标注类型
|
||||
|
||||
```ts
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
methods: {
|
||||
handleChange(event: Event) {
|
||||
console.log((event.target as HTMLInputElement).value)
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### 选项式 API 扩展全局属性
|
||||
|
||||
```ts
|
||||
import axios from 'axios'
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$http: typeof axios
|
||||
$translate: (key: string) => string
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 类型扩展的位置
|
||||
|
||||
我们可以将这些类型扩展放在一个 `.ts` 文件,或是一个影响整个项目的 `*.d.ts` 文件中
|
||||
|
||||
```ts
|
||||
// 不工作,将覆盖原始类型。
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$translate: (key: string) => string
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```ts
|
||||
// 正常工作。
|
||||
export {}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$translate: (key: string) => string
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 选项式 API 扩展自定义选项
|
||||
|
||||
某些插件,比如 vue-router,提供了一些自定义的组件选项,比如 beforeRouteEnter:
|
||||
|
||||
```ts
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
beforeRouteEnter(to, from, next) {
|
||||
// ...
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
如果没有确切的类型标注,这个钩子函数的参数会隐式地标注为 `any` 类型。我们可以为 `ComponentCustomOptions` 接口扩展自定义的选项来支持:
|
||||
|
||||
```ts
|
||||
import { Route } from 'vue-router'
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomOptions {
|
||||
beforeRouteEnter?(
|
||||
to: Route,
|
||||
from: Route,
|
||||
next: () => void
|
||||
): void
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
API 参考
|
||||
---
|
||||
|
||||
|
11
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wcj/reference",
|
||||
"version": "1.29.0",
|
||||
"version": "1.35.0",
|
||||
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
|
||||
"author": "jaywcjlove",
|
||||
"license": "MIT",
|
||||
@ -21,11 +21,18 @@
|
||||
"url": "https://github.com/jaywcjlove/reference/issues"
|
||||
},
|
||||
"keywords": [],
|
||||
"lint-staged": {
|
||||
"**/*.{mjs,css,json,prettierrc,lintstagedrc}": "prettier --write",
|
||||
"*.md": "markdownlint --fix",
|
||||
"docs/*.md": "markdownlint --fix"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^8.0.1",
|
||||
"lint-staged": "^13.0.3",
|
||||
"prettier": "^2.7.1",
|
||||
"refs-cli": "^1.2.1"
|
||||
"refs-cli": "^1.2.12",
|
||||
"markdownlint": "^0.27.0",
|
||||
"markdownlint-cli": "^0.32.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|