mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-20 14:07:32 +08:00
Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -122,6 +122,8 @@ jobs:
|
|||||||
```
|
```
|
||||||
|
|
||||||
# Create Docker Image
|
# Create Docker Image
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
@ -135,7 +137,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||||
tags: ${{ secrets.DOCKER_USER }}/reference:latest
|
tags: ${{ secrets.DOCKER_USER }}/reference:latest
|
||||||
|
|
||||||
- name: Build and push image:tags
|
- name: Build and push image:tags
|
||||||
@ -144,7 +146,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||||
tags: ${{ secrets.DOCKER_USER }}/reference:${{steps.changelog.outputs.version}}
|
tags: ${{ secrets.DOCKER_USER }}/reference:${{steps.changelog.outputs.version}}
|
||||||
|
|
||||||
# Create Docker Image in Github
|
# Create Docker Image in Github
|
||||||
@ -160,7 +162,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||||
tags: ghcr.io/jaywcjlove/reference:latest
|
tags: ghcr.io/jaywcjlove/reference:latest
|
||||||
|
|
||||||
- name: Build and push image:tags
|
- name: Build and push image:tags
|
||||||
@ -169,7 +171,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64,linux/arm64/v7
|
||||||
tags: ghcr.io/jaywcjlove/reference:${{steps.changelog.outputs.version}}
|
tags: ghcr.io/jaywcjlove/reference:${{steps.changelog.outputs.version}}
|
||||||
|
|
||||||
# # Create Docker Image in Github
|
# # Create Docker Image in Github
|
||||||
|
@ -175,6 +175,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/1834423612" title="kjch">
|
<a href="https://github.com/1834423612" title="kjch">
|
||||||
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/partoneplay" title="partoneplay">
|
||||||
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
|
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
|
||||||
</a>
|
</a>
|
||||||
@ -196,6 +199,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/Brid9e" title="Brid9e">
|
<a href="https://github.com/Brid9e" title="Brid9e">
|
||||||
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Brid9e"/>
|
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Brid9e"/>
|
||||||
</a>
|
</a>
|
||||||
|
<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">
|
<a href="https://github.com/CharlotteZeng" title="hanchZ">
|
||||||
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
|
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
|
||||||
</a>
|
</a>
|
||||||
@ -214,9 +220,18 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
|
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
|
||||||
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
|
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/Lihuagreek" title="Lihuagreek">
|
||||||
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
|
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/likeshop-github" title="LikeShop技术社区">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="LikeShop技术社区"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/LiuYuan-SHU" title="Liuyuan">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Liuyuan"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
|
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
|
||||||
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
|
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
|
||||||
</a>
|
</a>
|
||||||
@ -226,6 +241,12 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/PipecraftNet" title="Pipecraft">
|
<a href="https://github.com/PipecraftNet" title="Pipecraft">
|
||||||
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/whb1998a" title="WHB">
|
||||||
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
||||||
</a>
|
</a>
|
||||||
@ -256,6 +277,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/hweining" title="hweining">
|
<a href="https://github.com/hweining" title="hweining">
|
||||||
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
|
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/k983551019" title="k983551019">
|
||||||
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
|
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
|
||||||
</a>
|
</a>
|
||||||
@ -280,6 +304,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/onewesong" title="onewesong">
|
<a href="https://github.com/onewesong" title="onewesong">
|
||||||
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
|
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/Mowmowj" title="shelton">
|
||||||
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="shelton"/>
|
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="shelton"/>
|
||||||
</a>
|
</a>
|
||||||
|
35
README.md
35
README.md
@ -73,6 +73,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-->
|
[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);-->
|
[Electron](./docs/electron.md)<!--rehype:style=background: rgb(0 72 153);-->
|
||||||
[Emmet](./docs/emmet.md)<!--rehype:style=background: rgb(122 203 23);-->
|
[Emmet](./docs/emmet.md)<!--rehype:style=background: rgb(122 203 23);-->
|
||||||
@ -86,6 +87,7 @@ Quick Reference
|
|||||||
[Less.js](./docs/lessjs.md)<!--rehype:style=background: rgb(29 54 93);&class=tag&data-lang=CSS-->
|
[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-->
|
[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](./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-->
|
[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);-->
|
[RegEx 正则表达式](./docs/regex.md)<!--rehype:style=background: rgb(149 36 155);-->
|
||||||
[TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198);-->
|
[TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198);-->
|
||||||
@ -120,6 +122,7 @@ Quick Reference
|
|||||||
|
|
||||||
## 命令
|
## 命令
|
||||||
|
|
||||||
|
[ADB, Android Debug Bridge](./docs/adb.md)<!--rehype:style=background: rgb(238 0 0);&class=contributing tag&data-lang=Android&data-info=👆看看还缺点儿什么?-->
|
||||||
[Ansible](./docs/ansible.md)<!--rehype:style=background: rgb(238 0 0);&class=contributing tag&data-lang=RedHat&data-info=👆看看还缺点儿什么?-->
|
[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);-->
|
[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++-->
|
[Conan](./docs/conan.md)<!--rehype:style=background: rgb(0 193 9);&class=tag&data-lang=C/C++-->
|
||||||
@ -158,6 +161,7 @@ Quick Reference
|
|||||||
## 数据库
|
## 数据库
|
||||||
|
|
||||||
[MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(1 117 143);&class=tag&data-lang=SQL-->
|
[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-->
|
[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-->
|
[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);-->
|
[Redis](./docs/redis.md)<!--rehype:style=background: rgb(198 47 44);-->
|
||||||
@ -174,6 +178,7 @@ Quick Reference
|
|||||||
[Gitlab](./docs/gitlab.md)<!--rehype:style=background: rgb(226 67 41);-->
|
[Gitlab](./docs/gitlab.md)<!--rehype:style=background: rgb(226 67 41);-->
|
||||||
[Google Chrome](./docs/google-chrome.md)<!--rehype:style=background: rgb(29 116 232);-->
|
[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-->
|
[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-->
|
[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);-->
|
[Sublime Text](./docs/sublime-text.md)<!--rehype:style=background: rgb(223 148 0);-->
|
||||||
[VSCode](./docs/vscode.md)<!--rehype:style=background: rgb(91 163 230);-->
|
[VSCode](./docs/vscode.md)<!--rehype:style=background: rgb(91 163 230);-->
|
||||||
@ -241,6 +246,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/1834423612" title="kjch">
|
<a href="https://github.com/1834423612" title="kjch">
|
||||||
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
<img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/partoneplay" title="partoneplay">
|
||||||
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
|
<img src="https://avatars.githubusercontent.com/u/5189132?v=4" width="42;" alt="partoneplay"/>
|
||||||
</a>
|
</a>
|
||||||
@ -262,6 +270,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/Brid9e" title="Brid9e">
|
<a href="https://github.com/Brid9e" title="Brid9e">
|
||||||
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Brid9e"/>
|
<img src="https://avatars.githubusercontent.com/u/85558909?v=4" width="42;" alt="Brid9e"/>
|
||||||
</a>
|
</a>
|
||||||
|
<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">
|
<a href="https://github.com/CharlotteZeng" title="hanchZ">
|
||||||
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
|
<img src="https://avatars.githubusercontent.com/u/19461184?v=4" width="42;" alt="hanchZ"/>
|
||||||
</a>
|
</a>
|
||||||
@ -280,9 +291,18 @@ Quick Reference
|
|||||||
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
|
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
|
||||||
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
|
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/Lihuagreek" title="Lihuagreek">
|
||||||
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
|
<img src="https://avatars.githubusercontent.com/u/51040740?v=4" width="42;" alt="Lihuagreek"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/likeshop-github" title="LikeShop技术社区">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="LikeShop技术社区"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/LiuYuan-SHU" title="Liuyuan">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Liuyuan"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
|
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski">
|
||||||
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
|
<img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/>
|
||||||
</a>
|
</a>
|
||||||
@ -292,6 +312,12 @@ Quick Reference
|
|||||||
<a href="https://github.com/PipecraftNet" title="Pipecraft">
|
<a href="https://github.com/PipecraftNet" title="Pipecraft">
|
||||||
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
<img src="https://avatars.githubusercontent.com/u/88728670?v=4" width="42;" alt="Pipecraft"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/whb1998a" title="WHB">
|
||||||
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
<img src="https://avatars.githubusercontent.com/u/44045064?v=4" width="42;" alt="WHB"/>
|
||||||
</a>
|
</a>
|
||||||
@ -322,6 +348,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/hweining" title="hweining">
|
<a href="https://github.com/hweining" title="hweining">
|
||||||
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
|
<img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/k983551019" title="k983551019">
|
||||||
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
|
<img src="https://avatars.githubusercontent.com/u/48147837?v=4" width="42;" alt="k983551019"/>
|
||||||
</a>
|
</a>
|
||||||
@ -346,6 +375,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/onewesong" title="onewesong">
|
<a href="https://github.com/onewesong" title="onewesong">
|
||||||
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
|
<img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/>
|
||||||
</a>
|
</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">
|
<a href="https://github.com/Mowmowj" title="shelton">
|
||||||
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="shelton"/>
|
<img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="shelton"/>
|
||||||
</a>
|
</a>
|
||||||
@ -398,6 +430,9 @@ Quick Reference
|
|||||||
[nuomiphp.com](https://reference.tool.nuomiphp.com/)<!--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=👆每天自动同步-->
|
[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=👆实时同步,多线路-->
|
[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=👆每天自动同步-->
|
||||||
|
[ref.qiubit.cc](http://ref.qiubit.cc)<!--rehype:target=_blank&class=contributing&data-info=👆每天自动同步-->
|
||||||
|
[aoh.cc](https://aoh.cc/)<!--rehype:target=_blank-->
|
||||||
<!--rehype:class=home-card home-links-->
|
<!--rehype:class=home-card home-links-->
|
||||||
|
|
||||||
如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 [gh-pages](https://github.com/jaywcjlove/reference/tree/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 版。
|
||||||
|
3
assets/adb.svg
Normal file
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 |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
3
assets/mongodb.svg
Normal file
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/pycharm.svg
Normal file
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
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 |
381
docs/adb.md
Normal file
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>)'
|
||||||
|
```
|
||||||
|
|
||||||
|
查看特定包的日志
|
81
docs/cpp.md
81
docs/cpp.md
@ -545,6 +545,87 @@ 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
|
||||||
|
std::vector<int> vec({1, 2, 3, 4, 5}); // vec中包含1, 2, 3, 4, 5
|
||||||
|
std::for_each(vec.begin(), vec.end(), [](int& ele) -> void
|
||||||
|
{
|
||||||
|
std::cout << ele << " ";
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
C++ 预处理器
|
C++ 预处理器
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
156
docs/feds.md
Normal file
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-->
|
@ -157,12 +157,12 @@ with app.test_request_context():
|
|||||||
|
|
||||||
### HTTP 方法
|
### HTTP 方法
|
||||||
|
|
||||||
默认情况下,路由仅响应 `GET` 请求。您可以使用 `route()` 装饰器的方法参数来处理不同的 `HTTP` 方法
|
默认路由仅响应 `GET` 请求。可以使用 `route()` 装饰器的方法参数来处理不同的 `HTTP` 方法
|
||||||
|
|
||||||
```py
|
```py
|
||||||
from flask import request
|
from flask import request
|
||||||
|
|
||||||
@app.route('/login', methods=['GET', 'POST'])
|
@app.route('/login',methods=['GET','POST'])
|
||||||
def login():
|
def login():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
return do_the_login()
|
return do_the_login()
|
||||||
@ -181,3 +181,75 @@ def login_get():
|
|||||||
def login_post():
|
def login_post():
|
||||||
return do_the_login()
|
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"}
|
||||||
|
```
|
||||||
|
@ -70,7 +70,7 @@ func say(message string) {
|
|||||||
多行注释 */
|
多行注释 */
|
||||||
```
|
```
|
||||||
|
|
||||||
### 如果语句
|
### if 语句
|
||||||
|
|
||||||
```go
|
```go
|
||||||
if true {
|
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-->
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
```go
|
```go
|
||||||
@ -511,7 +511,7 @@ fmt.Println(plus(1, 2))
|
|||||||
fmt.Println(plusPlus(1, 2, 3))
|
fmt.Println(plusPlus(1, 2, 3))
|
||||||
```
|
```
|
||||||
|
|
||||||
### 多次返回
|
### 多返回值
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func vals() (int, int) {
|
func vals() (int, int) {
|
||||||
@ -533,7 +533,7 @@ r1, r2 := func() (string, string) {
|
|||||||
fmt.Println(r1, r2)
|
fmt.Println(r1, r2)
|
||||||
```
|
```
|
||||||
|
|
||||||
### 命名返回
|
### 命名返回值
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func split(sum int) (x, y int) {
|
func split(sum int) (x, y int) {
|
||||||
@ -546,7 +546,7 @@ fmt.Println(x) // => 7
|
|||||||
fmt.Println(y) // => 10
|
fmt.Println(y) // => 10
|
||||||
```
|
```
|
||||||
|
|
||||||
### 变量函数
|
### 可变参数函数
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func sum(nums ...int) {
|
func sum(nums ...int) {
|
||||||
@ -557,7 +557,7 @@ func sum(nums ...int) {
|
|||||||
}
|
}
|
||||||
fmt.Println(total)
|
fmt.Println(total)
|
||||||
}
|
}
|
||||||
sum(1, 2) //=> [1 2] 3
|
sum(1, 2) // => [1 2] 3
|
||||||
sum(1, 2, 3) // => [1 2 3] 6
|
sum(1, 2, 3) // => [1 2 3] 6
|
||||||
nums := []int{1, 2, 3, 4}
|
nums := []int{1, 2, 3, 4}
|
||||||
sum(nums...) // => [1 2 3 4] 10
|
sum(nums...) // => [1 2 3 4] 10
|
||||||
@ -987,7 +987,7 @@ Go 命令
|
|||||||
`GOOS` | 编译系统
|
`GOOS` | 编译系统
|
||||||
`GOARCH` | 编译arch
|
`GOARCH` | 编译arch
|
||||||
`GO111MODULE` | gomod开关
|
`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`
|
`GOSSAFUNC` | 生成 `SSA.html` 文件,展示代码优化的每一步 `GOSSAFUNC=func_name go build`
|
||||||
<!--rehype:className=style-list-arrow-->
|
<!--rehype:className=style-list-arrow-->
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
iptables 备忘清单
|
iptables 备忘清单
|
||||||
====
|
====
|
||||||
|
|
||||||
iptables 是一个配置 Linux 内核 防火墙(opens new window)的命令行工具,是 [netfilter](https://en.wikipedia.org/wiki/Netfilter)(opens new window)项目的一部分。这个快速参考备忘单显示了它的常用命令使用清单
|
iptables 是一个配置 Linux 内核防火墙的命令行工具,是 [netfilter](https://en.wikipedia.org/wiki/Netfilter) 项目的一部分。这个快速参考备忘单显示了它的常用命令使用清单
|
||||||
|
|
||||||
入门
|
入门
|
||||||
---
|
---
|
||||||
|
36
docs/java.md
36
docs/java.md
@ -89,7 +89,7 @@ boolean[] answers = {true, false};
|
|||||||
|
|
||||||
查看: [Arrays](#java-数组)
|
查看: [Arrays](#java-数组)
|
||||||
|
|
||||||
### Swap
|
### 交换变量 Swap
|
||||||
|
|
||||||
```java
|
```java
|
||||||
int a = 1;
|
int a = 1;
|
||||||
@ -101,7 +101,7 @@ b = temp;
|
|||||||
System.out.println(a + " " + b); // 2 1
|
System.out.println(a + " " + b); // 2 1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Type Casting
|
### 类型转换 Type Casting
|
||||||
|
|
||||||
```java
|
```java
|
||||||
// Widening
|
// Widening
|
||||||
@ -344,7 +344,7 @@ for (int a: arr) {
|
|||||||
// 输出: a b c
|
// 输出: a b c
|
||||||
```
|
```
|
||||||
|
|
||||||
### Multidimensional Arrays
|
### 二维数组 Multidimensional Arrays
|
||||||
|
|
||||||
```java
|
```java
|
||||||
int[][] matrix = { {1, 2, 3}, {4, 5} };
|
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
|
// 输出: 1 2 3 4 5 6 7
|
||||||
```
|
```
|
||||||
|
|
||||||
### Sort
|
### 排序 Sort
|
||||||
|
|
||||||
```java
|
```java
|
||||||
char[] chars = {'b', 'a', 'c'};
|
char[] chars = {'b', 'a', 'c'};
|
||||||
@ -547,10 +547,10 @@ for (int i = 0; i < 5; i++) {
|
|||||||
Java 框架搜集
|
Java 框架搜集
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
### Java 搜集
|
### Java 集合
|
||||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
<!--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
|
[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
|
[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
|
### HashSet
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@ -771,7 +790,7 @@ text.split(Pattern.quote("|"));
|
|||||||
`Math.toDegrees(rad)` | 以度为单位的角度弧度
|
`Math.toDegrees(rad)` | 以度为单位的角度弧度
|
||||||
`Math.toRadians(deg)` | 以弧度为单位的角度度
|
`Math.toRadians(deg)` | 以弧度为单位的角度度
|
||||||
|
|
||||||
### Try/Catch/Finally
|
### 异常 Try/Catch/Finally
|
||||||
|
|
||||||
```java
|
```java
|
||||||
try {
|
try {
|
||||||
@ -816,6 +835,9 @@ method.invoke(classLoader, url);
|
|||||||
- `SecureRandom` 实例用于生成安全的伪随机数流
|
- `SecureRandom` 实例用于生成安全的伪随机数流
|
||||||
- `UUID` 表示一个不可变的通用唯一标识符
|
- `UUID` 表示一个不可变的通用唯一标识符
|
||||||
- `Vector` 实现了一个可增长的对象数组
|
- `Vector` 实现了一个可增长的对象数组
|
||||||
|
- `LocalDate` 表示没有时区的日期,只包含年月日,不可变并且线程安全的,java8 及以上版本可用
|
||||||
|
- `LocalTime` 表示没有时区的时间,只包含时分秒,不可变并且线程安全的,java8 及以上版本可用
|
||||||
|
- `LocalDateTime` 表示没有时区的日期时间,同时包含年月日时分秒,不可变并且线程安全的,java8 及以上版本可用
|
||||||
|
|
||||||
另见
|
另见
|
||||||
---
|
---
|
||||||
|
@ -1190,6 +1190,99 @@ console.log(myCat.name);
|
|||||||
myCat.name = 'Yankee';
|
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 绑定
|
JavaScript this 绑定
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ print(a ^ b) -- 64.0
|
|||||||
---
|
---
|
||||||
|
|
||||||
### 运算符
|
### 运算符
|
||||||
<!--rehype:wrap-class=row-span-2-->
|
<!--rehype:wrap-class=row-span-3-->
|
||||||
|
|
||||||
#### 关系运算符
|
#### 关系运算符
|
||||||
|
|
||||||
|
@ -28,15 +28,15 @@ a.txt: b.txt c.txt
|
|||||||
|
|
||||||
### 文件命令
|
### 文件命令
|
||||||
|
|
||||||
文件会以 `GNUmakefile`(不推荐使用)、`Makefile`、`makefile` 查找目录下的名称。
|
make命令会以 `GNUmakefile`(不推荐使用)、`makefile`、`Makefile`(推荐使用)的顺序查找当前目录下的文件。
|
||||||
|
|
||||||
#### 自定义文件名称
|
#### 自定义文件路径
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make target -f NAME
|
$ make target -f FILE
|
||||||
```
|
```
|
||||||
|
|
||||||
我们可以使用 `-f NAME` 来指定需要编译的文件名
|
我们可以使用 `-f FILE` 来指定makefile文件的路径
|
||||||
|
|
||||||
#### 隐式生成
|
#### 隐式生成
|
||||||
|
|
||||||
|
434
docs/mongodb.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)
|
||||||
|
```
|
163
docs/pycharm.md
Normal file
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-->
|
@ -838,6 +838,16 @@ H2 部分
|
|||||||
|
|
||||||
默认表格末尾列`右对齐`,添加 `<!--rehype:className=left-align-->` 类让其`左对齐`
|
默认表格末尾列`右对齐`,添加 `<!--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-->` 注释
|
||||||
|
|
||||||
列表
|
列表
|
||||||
---
|
---
|
||||||
|
|
||||||
|
1071
docs/reactrouter.md
Normal file
1071
docs/reactrouter.md
Normal file
File diff suppressed because it is too large
Load Diff
@ -1350,6 +1350,7 @@ const point = [3, 4] as const
|
|||||||
```
|
```
|
||||||
|
|
||||||
### satisfies
|
### satisfies
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
`satisfies` 允许将验证表达式的类型与某种类型匹配,而无需更改该表达式的结果类型。
|
`satisfies` 允许将验证表达式的类型与某种类型匹配,而无需更改该表达式的结果类型。
|
||||||
|
|
||||||
@ -1385,10 +1386,10 @@ const palette = {
|
|||||||
// undefined | number
|
// undefined | number
|
||||||
const redComponent = palette.red.at(0)
|
const redComponent = palette.red.at(0)
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--rehype:className=wrap-text-->
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
### 范型实例化表达式
|
### 范型实例化表达式
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
不使用的情况下:
|
不使用的情况下:
|
||||||
|
|
||||||
@ -1432,6 +1433,207 @@ const makeStringBox = makeBox<string>;
|
|||||||
makeStringBox(42);
|
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
|
CLI
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -1463,7 +1665,7 @@ $ tsc app.ts util.ts --target esnext --outfile index.js
|
|||||||
`--init` _boolean_ | 初始化 TypeScript 项目并创建 tsconfig.json 文件
|
`--init` _boolean_ | 初始化 TypeScript 项目并创建 tsconfig.json 文件
|
||||||
`--listFilesOnly` _boolean_ | 打印作为编译一部分的文件名,然后停止处理
|
`--listFilesOnly` _boolean_ | 打印作为编译一部分的文件名,然后停止处理
|
||||||
`--locale` _string_ | 设置来自 TypeScript 的消息传递语言。 这不影响发射
|
`--locale` _string_ | 设置来自 TypeScript 的消息传递语言。 这不影响发射
|
||||||
`--project` _string_ | 编译项目给定其配置文件的路径,或带有“tsconfig.json”的文件夹
|
`--project` _string_ | 编译项目给定其配置文件的路径,或带有 'tsconfig.json' 的文件夹
|
||||||
`--showConfig` _boolean_ | 打印最终配置而不是构建
|
`--showConfig` _boolean_ | 打印最终配置而不是构建
|
||||||
`--version` _boolean_ | 打印编译器的版本
|
`--version` _boolean_ | 打印编译器的版本
|
||||||
<!--rehype:className=style-list-->
|
<!--rehype:className=style-list-->
|
||||||
|
@ -5,16 +5,16 @@ VSCode 备忘清单
|
|||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
### 一般的
|
### 通用
|
||||||
|
|
||||||
| - | - |
|
| - | - |
|
||||||
|-----------------------------|------------------------|
|
|-----------------------------|------------------------|
|
||||||
| `Ctrl` `Shift` `P` _/_ `F1` | 显示命令面板 |
|
| `Ctrl` `Shift` `P` _/_ `F1` | 显示命令面板 |
|
||||||
| `Ctrl` `P` | 快速打开,转到文件 |
|
| `Ctrl` `P` | 快速打开,转到文件 |
|
||||||
| `Ctrl` `Shift` `N` | 新窗户 |
|
| `Ctrl` `Shift` `N` | 打开新窗口 |
|
||||||
| `Ctrl` `Shift` `W` | 关闭窗口 |
|
| `Ctrl` `Shift` `W` | 关闭当前窗口 |
|
||||||
| `Ctrl` `,` | 用户设置 |
|
| `Ctrl` `,` | 打开用户设置 |
|
||||||
| `Ctrl` `K` `Ctrl` `S` | 键盘快捷键 |
|
| `Ctrl` `K` `Ctrl` `S` | 打开键盘快捷键设置 |
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
### 基本编辑
|
### 基本编辑
|
||||||
@ -36,16 +36,16 @@ VSCode 备忘清单
|
|||||||
| `Ctrl` `End` | 转到文件末尾 |
|
| `Ctrl` `End` | 转到文件末尾 |
|
||||||
| `Ctrl` `↑` _/_ `↓` | 向上/向下滚动行 |
|
| `Ctrl` `↑` _/_ `↓` | 向上/向下滚动行 |
|
||||||
| `Alt` `PgUp` _/_ `PgDn` | 向上/向下滚动页面 |
|
| `Alt` `PgUp` _/_ `PgDn` | 向上/向下滚动页面 |
|
||||||
| `Ctrl` `Shift` `[` | 折叠(折叠)区域 |
|
| `Ctrl` `Shift` `[` | 折叠区域 |
|
||||||
| `Ctrl` `Shift` `]` | 展开(展开)区域 |
|
| `Ctrl` `Shift` `]` | 展开区域 |
|
||||||
| `Ctrl` `K` `Ctrl` `[` | 折叠(折叠)所有子区域 |
|
| `Ctrl` `K` `Ctrl` `[` | 折叠所有子区域 |
|
||||||
| `Ctrl` `K` `Ctrl` `]` | 展开(展开)所有子区域 |
|
| `Ctrl` `K` `Ctrl` `]` | 展开所有子区域 |
|
||||||
| `Ctrl` `K` `Ctrl` `0` | 折叠(折叠)所有区域 |
|
| `Ctrl` `K` `Ctrl` `0` | 折叠所有区域 |
|
||||||
| `Ctrl` `K` `Ctrl` `J` | 展开(展开)所有区域 |
|
| `Ctrl` `K` `Ctrl` `J` | 展开所有区域 |
|
||||||
| `Ctrl` `K` `Ctrl` `C` | 添加行注释 |
|
| `Ctrl` `K` `Ctrl` `C` | 添加行注释 |
|
||||||
| `Ctrl` `K` `Ctrl` `U` | 删除行注释 |
|
| `Ctrl` `K` `Ctrl` `U` | 删除行注释 |
|
||||||
| `Ctrl` `/` | 切换行注释 |
|
| `Ctrl` `/` | 切换行注释 |
|
||||||
| `Shift` `Alt` `A` | 切换块评论 |
|
| `Shift` `Alt` `A` | 切换块注释 |
|
||||||
| `Alt` `Z` | 切换自动换行 |
|
| `Alt` `Z` | 切换自动换行 |
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
@ -54,28 +54,28 @@ VSCode 备忘清单
|
|||||||
| - | - |
|
| - | - |
|
||||||
|----------------------|--------------------|
|
|----------------------|--------------------|
|
||||||
| `Ctrl` `T` | 显示所有符号 |
|
| `Ctrl` `T` | 显示所有符号 |
|
||||||
| `Ctrl` `G` | 去线 |
|
| `Ctrl` `G` | 跳转到指定行数 |
|
||||||
| `Ctrl` `P` | 转到文件 |
|
| `Ctrl` `P` | 转到文件 |
|
||||||
| `Ctrl` `Shift` `O` | 转到符号 |
|
| `Ctrl` `Shift` `O` | 转到符号 |
|
||||||
| `Ctrl` `Shift` `M` | 显示问题面板 |
|
| `Ctrl` `Shift` `M` | 显示问题面板 |
|
||||||
| `F8` | 转到下一个错误 |
|
| `F8` | 转到下一个错误 |
|
||||||
| `Shift` `F8` | 转到上一个错误 |
|
| `Shift` `F8` | 转到上一个错误 |
|
||||||
| `Ctrl` `Shift` `Tab` | 浏览编辑组历史 |
|
| `Ctrl` `Shift` `Tab` | 浏览编辑组历史 |
|
||||||
| `Alt` `←` _/_ `→` | 后退/前进 |
|
| `Alt` `←` _/_ `→` | 后退/前进 |
|
||||||
| `Ctrl` `M` | 切换 Tab 移动焦点 |
|
| `Ctrl` `M` | 切换按 Tab 移动焦点 |
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
### 搜索和替换
|
### 搜索和替换
|
||||||
|
|
||||||
| - | - |
|
| - | - |
|
||||||
|---------------------------|---------------------------------|
|
|---------------------------|---------------------------------|
|
||||||
| `Ctrl` `F` | 寻找 |
|
| `Ctrl` `F` | 查找 |
|
||||||
| `Ctrl` `H` | 代替 |
|
| `Ctrl` `H` | 替换 |
|
||||||
| `F3` _/_ `Shift` `F3` | 查找下一个/上一个 |
|
| `F3` _/_ `Shift` `F3` | 查找下一个/上一个 |
|
||||||
| `Alt` `Enter` | 选择所有出现的查找匹配项 |
|
| `Alt` `Enter` | 选择所有出现的查找匹配项 |
|
||||||
| `Ctrl` `D` | 将选择添加到下一个查找匹配项 |
|
| `Ctrl` `D` | 将所选内容设置为查找关键词 |
|
||||||
| `Ctrl` `K` `Ctrl` `D` | 将最后一个选择移动到下一个查找匹配项 |
|
| `Ctrl` `K` `Ctrl` `D` | 将上一个选择移动到下一个查找匹配项 |
|
||||||
| `Alt` `C` _/_ `R` _/_ `W` | 切换区分大小写/正则表达式/整个单词 |
|
| `Alt` `C` _/_ `R` _/_ `W` | 切换区分大小写/正则表达式/全字匹配 |
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
### 多光标和选择
|
### 多光标和选择
|
||||||
@ -90,7 +90,7 @@ VSCode 备忘清单
|
|||||||
| `Ctrl` `Shift` `L` | 选择当前选择的所有匹配项 |
|
| `Ctrl` `Shift` `L` | 选择当前选择的所有匹配项 |
|
||||||
| `Ctrl` `F2` | 选择当前单词的所有出现 |
|
| `Ctrl` `F2` | 选择当前单词的所有出现 |
|
||||||
| `Shift` `Alt` `→` | 展开选择 |
|
| `Shift` `Alt` `→` | 展开选择 |
|
||||||
| `Shift` `Alt` `←` | 收缩选择 |
|
| `Shift` `Alt` `←` | 收起选择 |
|
||||||
| `Shift` `Alt` `<Drag>` | 列(框)选择 |
|
| `Shift` `Alt` `<Drag>` | 列(框)选择 |
|
||||||
| `Ctrl` `Shift` `Alt` `<Arrow>` | 列(框)选择 |
|
| `Ctrl` `Shift` `Alt` `<Arrow>` | 列(框)选择 |
|
||||||
| `Ctrl` `Shift` `Alt` `PgUp` _/_ `PgDn` | 列(框)选择页上/下 |
|
| `Ctrl` `Shift` `Alt` `PgUp` _/_ `PgDn` | 列(框)选择页上/下 |
|
||||||
@ -100,17 +100,17 @@ VSCode 备忘清单
|
|||||||
|
|
||||||
| - | - |
|
| - | - |
|
||||||
|-----------------------------|-----------------|
|
|-----------------------------|-----------------|
|
||||||
| `Ctrl` `<Space>` `Ctrl` `I` | 触发建议 |
|
| `Ctrl` `<Space>` `Ctrl` `I` | 显示建议 |
|
||||||
| `Ctrl` `Shift` `<Space>` | 触发参数提示 |
|
| `Ctrl` `Shift` `<Space>` | 显示参数提示 |
|
||||||
| `Shift` `Alt` `F` | 格式化文档 |
|
| `Shift` `Alt` `F` | 格式化文档 |
|
||||||
| `Ctrl` `K` `Ctrl` `F` | 格式选择 |
|
| `Ctrl` `K` `Ctrl` `F` | 格式化所选区域 |
|
||||||
| `F12` | 转到定义 |
|
| `F12` | 转到定义 |
|
||||||
| `Alt` `F12` | 窥视定义 |
|
| `Alt` `F12` | 速览定义 |
|
||||||
| `Ctrl` `K` `F12` | 打开定义到一边 |
|
| `Ctrl` `K` `F12` | 在侧边栏中打开定义 |
|
||||||
| `Ctrl` `.` | 快速解决 |
|
| `Ctrl` `.` | 快速修复 |
|
||||||
| `Shift` `F12` | 显示参考 |
|
| `Shift` `F12` | 显示引用 |
|
||||||
| `F2` | 重命名符号 |
|
| `F2` | 重命名符号 |
|
||||||
| `Ctrl` `K` `Ctrl` `X` | 修剪尾随空格 |
|
| `Ctrl` `K` `Ctrl` `X` | 删除尾随空格 |
|
||||||
| `Ctrl` `K` `M` | 更改文件语言 |
|
| `Ctrl` `K` `M` | 更改文件语言 |
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
@ -121,8 +121,8 @@ VSCode 备忘清单
|
|||||||
| `Ctrl` `F4` `Ctrl` `W` | 关闭编辑器 |
|
| `Ctrl` `F4` `Ctrl` `W` | 关闭编辑器 |
|
||||||
| `Ctrl` `K` `F` | 关闭文件夹 |
|
| `Ctrl` `K` `F` | 关闭文件夹 |
|
||||||
| `Ctrl` `\` | 拆分编辑器 |
|
| `Ctrl` `\` | 拆分编辑器 |
|
||||||
| `Ctrl` `1` _/_ `2` _/_ `3` | 专注于第一、第二或第三编辑组 |
|
| `Ctrl` `1` _/_ `2` _/_ `3` | 将焦点切换到第一/二/三编辑组 |
|
||||||
| `Ctrl` `K` `Ctrl` `←` _/_ `→` | 专注于上一个/下一个编辑组 |
|
| `Ctrl` `K` `Ctrl` `←` _/_ `→` | 将焦点切换到上/下一个编辑组 |
|
||||||
| `Ctrl` `Shift` `PgUp` _/_ `PgDn` | 向左/向右移动编辑器 |
|
| `Ctrl` `Shift` `PgUp` _/_ `PgDn` | 向左/向右移动编辑器 |
|
||||||
| `Ctrl` `K` `←` _/_ `→` | 移动活动编辑器组 |
|
| `Ctrl` `K` `←` _/_ `→` | 移动活动编辑器组 |
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
@ -137,11 +137,11 @@ VSCode 备忘清单
|
|||||||
| `Ctrl` `Shift` `S` | 另存为 |
|
| `Ctrl` `Shift` `S` | 另存为 |
|
||||||
| `Ctrl` `K` `S` | 保存所有 |
|
| `Ctrl` `K` `S` | 保存所有 |
|
||||||
| `Ctrl` `F4` | 关闭 |
|
| `Ctrl` `F4` | 关闭 |
|
||||||
| `Ctrl` `K` `Ctrl` `W` | 关闭松油 |
|
| `Ctrl` `K` `Ctrl` `W` | 关闭所有 |
|
||||||
| `Ctrl` `Shift` `T` | 重新打开关闭的编辑器 |
|
| `Ctrl` `Shift` `T` | 重新打开关闭的编辑器 |
|
||||||
| `Ctrl` `K` `Enter` | 保持预览模式编辑器打开 |
|
| `Ctrl` `K` `Enter` | 保持预览模式编辑器打开 |
|
||||||
| `Ctrl` `Tab` | Open next |
|
| `Ctrl` `Tab` | 打开下一项 |
|
||||||
| `Ctrl` `Shift` `Tab` | Open previous |
|
| `Ctrl` `Shift` `Tab` | 打开上一项 |
|
||||||
| `Ctrl` `K` `P` | 复制活动文件的路径 |
|
| `Ctrl` `K` `P` | 复制活动文件的路径 |
|
||||||
| `Ctrl` `K` `R` | 在资源管理器中显示活动文件 |
|
| `Ctrl` `K` `R` | 在资源管理器中显示活动文件 |
|
||||||
| `Ctrl` `K` `O` | 在新窗口/实例中显示活动文件 |
|
| `Ctrl` `K` `O` | 在新窗口/实例中显示活动文件 |
|
||||||
@ -175,12 +175,12 @@ VSCode 备忘清单
|
|||||||
| `F9` | 切换断点 |
|
| `F9` | 切换断点 |
|
||||||
| `F5` | 开始/继续 |
|
| `F5` | 开始/继续 |
|
||||||
| `Shift` `F5` | 停止 |
|
| `Shift` `F5` | 停止 |
|
||||||
| `Shift` `F11` _/_ `F11` | 进/出 |
|
| `Shift` `F11` _/_ `F11` | 单步调试/跳出 |
|
||||||
| `F10` | 跨过去 |
|
| `F10` | 单步跳过 |
|
||||||
| `Ctrl` `K` `Ctrl` `I` | 显示悬停 |
|
| `Ctrl` `K` `Ctrl` `I` | 显示悬停 |
|
||||||
| `Ctrl` <code>\`</code> | 显示综合终端 |
|
| `Ctrl` <code>\`</code> | 显示综合终端 |
|
||||||
| `Ctrl` `Shift` <code>\`</code> | 创建一个新终端 |
|
| `Ctrl` `Shift` <code>\`</code> | 创建一个新终端 |
|
||||||
| `Ctrl` `C` | 复制选择 |
|
| `Ctrl` `C` | 复制所选内容 |
|
||||||
| `Ctrl` `V` | 粘贴到活动终端 |
|
| `Ctrl` `V` | 粘贴到活动终端 |
|
||||||
| `Ctrl` `↑` _/_ `↓` | 向上/向下滚动 |
|
| `Ctrl` `↑` _/_ `↓` | 向上/向下滚动 |
|
||||||
| `Shift` `PgUp` _/_ `PgDn` | 向上/向下滚动页面 |
|
| `Shift` `PgUp` _/_ `PgDn` | 向上/向下滚动页面 |
|
||||||
|
11
package.json
11
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wcj/reference",
|
"name": "@wcj/reference",
|
||||||
"version": "1.32.0",
|
"version": "1.34.0",
|
||||||
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
|
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
|
||||||
"author": "jaywcjlove",
|
"author": "jaywcjlove",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -21,11 +21,18 @@
|
|||||||
"url": "https://github.com/jaywcjlove/reference/issues"
|
"url": "https://github.com/jaywcjlove/reference/issues"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
"lint-staged": {
|
||||||
|
"**/*.{mjs,css,json,prettierrc,lintstagedrc}": "prettier --write",
|
||||||
|
"*.md": "markdownlint --fix",
|
||||||
|
"docs/*.md": "markdownlint --fix"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"lint-staged": "^13.0.3",
|
"lint-staged": "^13.0.3",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"refs-cli": "^1.2.10"
|
"refs-cli": "^1.2.12",
|
||||||
|
"markdownlint": "^0.26.2",
|
||||||
|
"markdownlint-cli": "^0.32.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
|
Reference in New Issue
Block a user