mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-08-23 22:56:13 +08:00
Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c5f5f0cd19 | ||
![]() |
0b704fd5e3 | ||
![]() |
d7503afff2 | ||
![]() |
381a23490e | ||
![]() |
c1fbb99393 | ||
![]() |
3dd01e372c | ||
![]() |
033709eb8d | ||
![]() |
260f1ec438 | ||
![]() |
b104ca8bfd | ||
![]() |
b3d7fb1ea1 | ||
![]() |
cd599f7798 | ||
![]() |
5b649147ca | ||
![]() |
aa539136fc | ||
![]() |
e57f03ce8d | ||
![]() |
cb33da466e | ||
![]() |
d2b583fc68 | ||
![]() |
6cde7a1b6f | ||
![]() |
57fb87d021 | ||
![]() |
55f4a35a1a | ||
![]() |
c5f73221f4 | ||
![]() |
6d8d80c68e | ||
![]() |
7efa3c1fca | ||
![]() |
fbcd7edf78 | ||
![]() |
33328e5987 | ||
![]() |
3f191de637 | ||
![]() |
d75cda78f5 | ||
![]() |
b5467ec1c2 | ||
![]() |
51c4d2a719 | ||
![]() |
ca80355477 | ||
![]() |
a24330243f | ||
![]() |
acaccae376 | ||
![]() |
0e2da4158f | ||
![]() |
a26f95a1be | ||
![]() |
53b56623a4 | ||
![]() |
b58db5cc58 | ||
![]() |
f00a647c3e | ||
![]() |
869fbc6b40 | ||
![]() |
5910a3f924 | ||
![]() |
fadc13ae70 | ||
![]() |
36b984bb21 | ||
![]() |
f778b3c28e | ||
![]() |
1c0bb6a9a5 | ||
![]() |
b390eaca59 | ||
![]() |
0e9d9ac16d | ||
![]() |
b117f3eab7 | ||
![]() |
8fddbda70d | ||
![]() |
0d236303a7 | ||
![]() |
d1c0ded4f7 | ||
![]() |
4f705878b6 |
@@ -148,7 +148,7 @@ REF_LABEL=网站首页
|
|||||||
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调™">
|
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调™">
|
||||||
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调™"/>
|
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调™"/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/Jack-Zhang-1314" title="fw_qaq">
|
<a href="https://github.com/fwqaaq" title="fw_qaq">
|
||||||
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq"/>
|
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq"/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/mofelee" title="mofelee">
|
<a href="https://github.com/mofelee" title="mofelee">
|
||||||
@@ -166,6 +166,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/sjh42" title="42:p">
|
<a href="https://github.com/sjh42" title="42:p">
|
||||||
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/LufsX" title="LufsX">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/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>
|
||||||
@@ -175,6 +178,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/catcto" title="喵仙人">
|
<a href="https://github.com/catcto" title="喵仙人">
|
||||||
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="喵仙人"/>
|
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="喵仙人"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/heStudio-Network" title="醉、倾城">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="醉、倾城"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/13812700839" title="花殇">
|
<a href="https://github.com/13812700839" title="花殇">
|
||||||
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
|
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -205,9 +211,6 @@ REF_LABEL=网站首页
|
|||||||
<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/LufsX" title="LufsX">
|
|
||||||
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
|
||||||
</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>
|
||||||
@@ -217,6 +220,9 @@ REF_LABEL=网站首页
|
|||||||
<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>
|
||||||
|
<a href="https://github.com/hi-liyan" title="Yan Li">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="Yan Li"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/y52y" title="Zyj">
|
<a href="https://github.com/y52y" title="Zyj">
|
||||||
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -247,6 +253,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/kdxcxs" title="kdxcxs">
|
<a href="https://github.com/kdxcxs" title="kdxcxs">
|
||||||
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
|
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/genius-kim" title="kim">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="kim"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/larry-xue" title="larry">
|
<a href="https://github.com/larry-xue" title="larry">
|
||||||
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -274,6 +283,9 @@ REF_LABEL=网站首页
|
|||||||
<a href="https://github.com/zxx-457" title="zxx-457">
|
<a href="https://github.com/zxx-457" title="zxx-457">
|
||||||
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx-457"/>
|
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx-457"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/eryajf" title="二丫讲梵">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/lvzhenbo" title="吕振波">
|
<a href="https://github.com/lvzhenbo" title="吕振波">
|
||||||
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
|
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
|
||||||
</a>
|
</a>
|
||||||
|
75
README.md
75
README.md
@@ -56,12 +56,9 @@ Quick Reference
|
|||||||
[LaTeX](./docs/latex.md)<!--rehype:style=background: rgb(0 128 128);&class=contributing-->
|
[LaTeX](./docs/latex.md)<!--rehype:style=background: rgb(0 128 128);&class=contributing-->
|
||||||
[Laravel 8](./docs/laravel.md)<!--rehype:style=background: rgb(249 50 44);&class=contributing tag&data-lang=PHP-->
|
[Laravel 8](./docs/laravel.md)<!--rehype:style=background: rgb(249 50 44);&class=contributing tag&data-lang=PHP-->
|
||||||
[Markdown](./docs/markdown.md)<!--rehype:style=background: rgb(103 61 156);-->
|
[Markdown](./docs/markdown.md)<!--rehype:style=background: rgb(103 61 156);-->
|
||||||
[MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(1 117 143);&class=tag&data-lang=SQL-->
|
|
||||||
[MATLAB](./docs/matlab.md)<!--rehype:style=background: rgb(0 118 168);&class=contributing-->
|
[MATLAB](./docs/matlab.md)<!--rehype:style=background: rgb(0 118 168);&class=contributing-->
|
||||||
[Oracle](./docs/oracle.md)<!--rehype:style=background: rgb(255 0 0);-->
|
|
||||||
[PHP](./docs/php.md)<!--rehype:style=background: rgb(79 91 147);-->
|
[PHP](./docs/php.md)<!--rehype:style=background: rgb(79 91 147);-->
|
||||||
[Python](./docs/python.md)<!--rehype:style=background: rgb(43 91 132);-->
|
[Python](./docs/python.md)<!--rehype:style=background: rgb(43 91 132);-->
|
||||||
[PostgreSQL](./docs/postgres.md)<!--rehype:style=background: rgb(43 109 163);&class=tag&data-lang=SQL-->
|
|
||||||
[Ruby](./docs/ruby.md)<!--rehype:style=background: rgb(204 52 45);-->
|
[Ruby](./docs/ruby.md)<!--rehype:style=background: rgb(204 52 45);-->
|
||||||
[Rust](./docs/rust.md)<!--rehype:style=background: rgb(71 71 71);-->
|
[Rust](./docs/rust.md)<!--rehype:style=background: rgb(71 71 71);-->
|
||||||
[Swift](./docs/swift.md)<!--rehype:style=background: rgb(240 81 57);-->
|
[Swift](./docs/swift.md)<!--rehype:style=background: rgb(240 81 57);-->
|
||||||
@@ -91,6 +88,7 @@ Quick Reference
|
|||||||
[TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198);-->
|
[TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198);-->
|
||||||
[Vue 2](./docs/vue2.md)<!--rehype:style=background: rgb(64 184 131);-->
|
[Vue 2](./docs/vue2.md)<!--rehype:style=background: rgb(64 184 131);-->
|
||||||
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=contributing-->
|
[Vue 3](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131);&class=contributing-->
|
||||||
|
[</> htmx](./docs/htmx.md)<!--rehype:style=background: rgb(52 101 164);&class=contributing-->
|
||||||
<!--rehype:class=home-card-->
|
<!--rehype:class=home-card-->
|
||||||
|
|
||||||
## Nodejs
|
## Nodejs
|
||||||
@@ -127,6 +125,7 @@ Quick Reference
|
|||||||
[Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
[Cron](./docs/cron.md)<!--rehype:style=background: rgb(239 68 68);-->
|
[Cron](./docs/cron.md)<!--rehype:style=background: rgb(239 68 68);-->
|
||||||
[CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192);&class=contributing-->
|
[CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192);&class=contributing-->
|
||||||
|
[Make](./docs/make.md)<!--rehype:style=background: rgb(99 99 99);&class=contributing-->
|
||||||
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62);-->
|
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||||
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
[Find](./docs/find.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Find](./docs/find.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
@@ -134,6 +133,7 @@ Quick Reference
|
|||||||
[Htop](./docs/htop.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Htop](./docs/htop.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
[Homebrew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87);&class=tag&data-lang=macOS-->
|
[Homebrew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87);&class=tag&data-lang=macOS-->
|
||||||
[Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
|
[iptables](./docs/iptables.md)<!--rehype:style=background: rgb(32 74 135);-->
|
||||||
[jq](./docs/jq.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=JSON-->
|
[jq](./docs/jq.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=JSON-->
|
||||||
[Lsof](./docs/lsof.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Lsof](./docs/lsof.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
|
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
|
||||||
@@ -151,9 +151,19 @@ Quick Reference
|
|||||||
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);-->
|
[tar](./docs/tar.md)<!--rehype:style=background: rgb(215 89 62);-->
|
||||||
<!--rehype:class=home-card-->
|
<!--rehype:class=home-card-->
|
||||||
|
|
||||||
|
## 数据库
|
||||||
|
|
||||||
|
[MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(1 117 143);&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-->
|
||||||
|
[Redis](./docs/redis.md)<!--rehype:style=background: rgb(198 47 44);-->
|
||||||
|
<!--rehype:class=home-card-->
|
||||||
|
|
||||||
## 快捷键
|
## 快捷键
|
||||||
|
|
||||||
[Adobe Photoshop](./docs/adobe-photoshop.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Adobe Lightroom](./docs/adobe-lightroom.md)<!--rehype:style=background: rgb(49 168 255);-->
|
||||||
|
[Adobe Photoshop](./docs/adobe-photoshop.md)<!--rehype:style=background: rgb(49 168 255);-->
|
||||||
|
[Adobe XD](./docs/adobe-xd.md)<!--rehype:style=background: rgb(255 97 246);-->
|
||||||
[Android Studio](./docs/android-studio.md)<!--rehype:style=background: rgb(16 185 129);-->
|
[Android Studio](./docs/android-studio.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
[Firefox](./docs/firefox.md)<!--rehype:style=background: rgb(253 53 76);-->
|
[Firefox](./docs/firefox.md)<!--rehype:style=background: rgb(253 53 76);-->
|
||||||
[Gmail](./docs/gmail.md)<!--rehype:style=background: rgb(234 67 54);-->
|
[Gmail](./docs/gmail.md)<!--rehype:style=background: rgb(234 67 54);-->
|
||||||
@@ -169,6 +179,7 @@ Quick Reference
|
|||||||
## 其它
|
## 其它
|
||||||
|
|
||||||
[Quick Reference](./docs/quickreference.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=排版说明-->
|
[Quick Reference](./docs/quickreference.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=排版说明-->
|
||||||
|
[Aspect Ratio](./docs/aspect-ratio.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||||
[Github Actions](./docs/github-actions.md)<!--rehype:style=background: rgb(121 184 255);-->
|
[Github Actions](./docs/github-actions.md)<!--rehype:style=background: rgb(121 184 255);-->
|
||||||
[Gitlab CI/CD](./docs/gitlab-ci.md)<!--rehype:style=background: rgb(226 67 41);&class=contributing-->
|
[Gitlab CI/CD](./docs/gitlab-ci.md)<!--rehype:style=background: rgb(226 67 41);&class=contributing-->
|
||||||
[Colors Named](./docs/colors-named.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=CSS-->
|
[Colors Named](./docs/colors-named.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=CSS-->
|
||||||
@@ -198,7 +209,7 @@ Quick Reference
|
|||||||
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调™">
|
<!--GAMFC--><a href="https://github.com/jaywcjlove" title="小弟调调™">
|
||||||
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调™"/>
|
<img src="https://avatars.githubusercontent.com/u/1680273?v=4" width="42;" alt="小弟调调™"/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/Jack-Zhang-1314" title="fw_qaq">
|
<a href="https://github.com/fwqaaq" title="fw_qaq">
|
||||||
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq"/>
|
<img src="https://avatars.githubusercontent.com/u/82551626?v=4" width="42;" alt="fw_qaq"/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/mofelee" title="mofelee">
|
<a href="https://github.com/mofelee" title="mofelee">
|
||||||
@@ -216,6 +227,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/sjh42" title="42:p">
|
<a href="https://github.com/sjh42" title="42:p">
|
||||||
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/LufsX" title="LufsX">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/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>
|
||||||
@@ -225,6 +239,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/catcto" title="喵仙人">
|
<a href="https://github.com/catcto" title="喵仙人">
|
||||||
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="喵仙人"/>
|
<img src="https://avatars.githubusercontent.com/u/5467932?v=4" width="42;" alt="喵仙人"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/heStudio-Network" title="醉、倾城">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/119711513?v=4" width="42;" alt="醉、倾城"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/13812700839" title="花殇">
|
<a href="https://github.com/13812700839" title="花殇">
|
||||||
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
|
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -255,9 +272,6 @@ Quick Reference
|
|||||||
<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/LufsX" title="LufsX">
|
|
||||||
<img src="https://avatars.githubusercontent.com/u/33221883?v=4" width="42;" alt="LufsX"/>
|
|
||||||
</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>
|
||||||
@@ -267,6 +281,9 @@ Quick Reference
|
|||||||
<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>
|
||||||
|
<a href="https://github.com/hi-liyan" title="Yan Li">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/40056492?v=4" width="42;" alt="Yan Li"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/y52y" title="Zyj">
|
<a href="https://github.com/y52y" title="Zyj">
|
||||||
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
<img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -297,6 +314,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/kdxcxs" title="kdxcxs">
|
<a href="https://github.com/kdxcxs" title="kdxcxs">
|
||||||
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
|
<img src="https://avatars.githubusercontent.com/u/18746192?v=4" width="42;" alt="kdxcxs"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/genius-kim" title="kim">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/119488561?v=4" width="42;" alt="kim"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/larry-xue" title="larry">
|
<a href="https://github.com/larry-xue" title="larry">
|
||||||
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
<img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="larry"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -324,6 +344,9 @@ Quick Reference
|
|||||||
<a href="https://github.com/zxx-457" title="zxx-457">
|
<a href="https://github.com/zxx-457" title="zxx-457">
|
||||||
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx-457"/>
|
<img src="https://avatars.githubusercontent.com/u/114141362?v=4" width="42;" alt="zxx-457"/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://github.com/eryajf" title="二丫讲梵">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="42;" alt="二丫讲梵"/>
|
||||||
|
</a>
|
||||||
<a href="https://github.com/lvzhenbo" title="吕振波">
|
<a href="https://github.com/lvzhenbo" title="吕振波">
|
||||||
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
|
<img src="https://avatars.githubusercontent.com/u/32427677?v=4" width="42;" alt="吕振波"/>
|
||||||
</a>
|
</a>
|
||||||
@@ -340,18 +363,32 @@ Quick Reference
|
|||||||
## 国内镜像网站
|
## 国内镜像网站
|
||||||
<!--rehype:wrap-style=text-align: center;max-width: 650px;margin: 0 auto;&class=home-title-reset-->
|
<!--rehype:wrap-style=text-align: center;max-width: 650px;margin: 0 auto;&class=home-title-reset-->
|
||||||
|
|
||||||
由于中国国内访问,时常打不开,你可以访问下面镜像网站。推荐自己的[镜像网站](https://github.com/jaywcjlove/reference/issues/102#issue-1451649637)
|
由于中国国内访问,时常打不开,你可以访问下面镜像网站。推荐自己的[镜像网站](https://github.com/jaywcjlove/reference/discussions/206#discussion-4625735)
|
||||||
|
|
||||||
[quickref.cn](https://quickref.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[quickref.cn](https://quickref.cn)<!--rehype:target=_blank-->
|
||||||
[ecdata.cn](http://ref.ecdata.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[ecdata.cn](http://ref.ecdata.cn)<!--rehype:target=_blank-->
|
||||||
[aibk.cn](https://quickref.aibk.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[aibk.cn](https://quickref.aibk.cn)<!--rehype:target=_blank-->
|
||||||
[jgeek.cn](http://reference.jgeek.cn/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[jgeek.cn](http://reference.jgeek.cn/)<!--rehype:target=_blank-->
|
||||||
[laoleng.vip](http://bbs.laoleng.vip/reference/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[laoleng.vip](http://bbs.laoleng.vip/reference/)<!--rehype:target=_blank-->
|
||||||
[liujiapeng.com](https://www.liujiapeng.com/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[liujiapeng.com](https://www.liujiapeng.com/)<!--rehype:target=_blank-->
|
||||||
[dbyun.net](https://www.dbyun.net/reference/index.html)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[dbyun.net](https://www.dbyun.net/reference/index.html)<!--rehype:target=_blank-->
|
||||||
[dc6.fun](https://dc6.fun/reference/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[dc6.fun](https://dc6.fun/reference/)<!--rehype:target=_blank-->
|
||||||
[if010.com](https://quickref.if010.com/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
[if010.com](https://quickref.if010.com/)<!--rehype:target=_blank-->
|
||||||
<!--rehype:class=home-card&style=margin:2.2rem 0;display: flex;justify-content: center;gap: 1rem;flex-wrap: wrap;-->
|
[pipecraft.net](https://quickref.pipecraft.net/)<!--rehype:target=_blank&class=contributing&data-info=👆需要梯子-->
|
||||||
|
[isteed.cc](https://ref.isteed.cc/)<!--rehype:target=_blank-->
|
||||||
|
[cas-air.cn](https://www.ccommunity.cas-air.cn/index.html)<!--rehype:target=_blank&class=contributing&data-info=👆非镜像,另起炉灶-->
|
||||||
|
[1han.wiki](https://code.1han.wiki/)<!--rehype:target=_blank-->
|
||||||
|
[linzhe.top](https://linzhe.top/)<!--rehype:target=_blank-->
|
||||||
|
[xushanxiang.com](https://xushanxiang.com/ref/)<!--rehype:target=_blank-->
|
||||||
|
[winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)<!--rehype:target=_blank&class=contributing&data-info=👆需要梯子-->
|
||||||
|
[isteed.cc](https://ref.isteed.cc/)<!--rehype:target=_blank-->
|
||||||
|
[hestudio.org](https://quickref.hestudio.org)<!--rehype:target=_blank-->
|
||||||
|
[surcode.cn](https://ref.surcode.cn)<!--rehype:target=_blank-->
|
||||||
|
[hestudio.org](https://quickref.hestudio.org)<!--rehype:target=_blank-->
|
||||||
|
[cms.im](https://quickref.cms.im/)<!--rehype:target=_blank-->
|
||||||
|
[nuomiphp.com](https://reference.tool.nuomiphp.com/)<!--rehype:target=_blank-->
|
||||||
|
[eryajf.net](https://ref.eryajf.net/)<!--rehype:target=_blank-->
|
||||||
|
<!--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/adobe-lightroom.svg
Normal file
3
assets/adobe-lightroom.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
|
||||||
|
<path d="M19.75.3H4.25C1.9.3 0 2.2 0 4.55v14.9c0 2.35 1.9 4.25 4.25 4.25h15.5c2.35 0 4.25-1.9 4.25-4.25V4.55C24 2.2 22.1.3 19.75.3zm-6.99 16.389c0 .051-.029.09-.06.121a.17.17 0 0 1-.101.029H6.26c-.11 0-.16-.061-.16-.18V6.44c-.01-.07.04-.13.11-.14h2c.05-.01.11.03.11.08v8.43h4.62c.101 0 .131.049.11.14l-.29 1.739zm6.25-7.859v1.95c0 .08-.05.11-.16.11-.649-.04-1.3.08-1.89.34-.2.09-.39.21-.54.37v5.1c0 .1-.04.14-.13.14h-1.95c-.08.01-.15-.04-.16-.119V11.14c0-.24 0-.49-.01-.75s-.01-.52-.02-.78c-.01-.22-.03-.44-.061-.66-.01-.05.02-.1.07-.11.01-.01.02-.01.04 0h1.75c.1 0 .18.07.21.16.04.07.07.15.08.23.02.1.039.21.05.31.01.11.021.23.021.36.299-.35.66-.64 1.069-.86.46-.25.97-.37 1.49-.36.069-.01.13.04.14.11l.001.04z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 830 B |
2
assets/adobe-xd.svg
Normal file
2
assets/adobe-xd.svg
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 230 225">
|
||||||
|
<path fill="currentColor" d="M191.816406,0 C212.904623,-3.87384253e-15 230,17.0953772 230,38.1835938 L230,186.066406 C230,207.154623 212.904623,224.25 191.816406,224.25 L38.1835938,224.25 C17.0953772,224.25 2.58256169e-15,207.154623 0,186.066406 L0,38.1835938 C-2.58256169e-15,17.0953772 17.0953772,3.87384253e-15 38.1835938,0 L191.816406,0 Z M195.077284,49.091346 L194.968125,49.0996094 L175.526836,49.0996094 C174.910508,49.0996094 174.601445,49.4607813 174.601445,50.1795313 L174.601445,80.5754688 L173.781172,80.5035938 L172.659922,80.41375 L171.669844,80.3436719 L171.080469,80.3095313 L170.550391,80.2861719 L170.077813,80.2708984 L169.664531,80.2664063 C160.200391,80.2664063 152.125234,82.1180859 145.440859,85.8214453 L144.91168,86.1089453 C138.763421,89.5141795 133.664216,94.5369517 130.166523,100.633086 C126.671624,106.792265 124.861878,113.763817 124.919648,120.845234 L124.923242,121.532539 C125.011289,129.971563 126.759648,137.020703 130.165625,142.677266 C133.543408,148.383655 138.57396,152.930169 144.591836,155.715391 C151.05183,158.667646 158.088508,160.143302 165.190313,160.035078 L166.254063,160.023398 C170.866829,159.944136 175.465136,159.483464 180.001953,158.646094 C185.345985,157.661087 190.569912,156.10972 195.585352,154.018242 C196.182744,153.743842 196.550536,153.130974 196.511641,152.474727 L196.358906,150.159453 L196.071406,146.156914 C195.952813,144.392383 195.893516,142.742852 195.893516,141.211914 L195.893516,50.025 C195.930082,49.7701021 195.844423,49.5128727 195.662338,49.3307875 C195.480252,49.1487023 195.223023,49.0630429 194.968125,49.0996094 Z M121.116289,57.8451797 C120.918558,57.505081 120.519883,57.3365583 120.138164,57.4317187 L99.9260156,57.4317187 C99.5008674,57.3901695 99.0726792,57.4705716 98.6915625,57.6635156 C98.4049609,57.9411328 98.1929297,58.2861328 98.0743359,58.6670703 C95.989605,62.7301089 93.855056,66.7673925 91.6711719,70.7780078 C89.4592187,74.8407422 87.2984766,78.8792187 85.1916406,82.8907422 C83.046362,86.9730975 80.9632439,91.0878173 78.9430078,95.2334766 L78.7884766,95.2334766 C76.817187,91.0868307 74.6810973,87.0205574 72.3853125,83.044375 C70.0538061,79.0056478 67.7650584,74.9423869 65.5194531,70.8552734 C63.2562891,66.7422266 61.1988672,62.6273828 59.3471875,58.5125391 C59.1073047,58.1630469 58.7901562,57.8728516 58.4217969,57.6635156 C57.9815263,57.4848886 57.5072287,57.4053935 57.0328125,57.4317187 L35.2780469,57.4317187 C34.9257161,57.4076934 34.5826053,57.5507949 34.3517578,57.8180469 C34.1469141,58.0767969 34.198125,58.4110156 34.5062891,58.8207031 L63.5132422,107.884375 L33.7354297,156.795312 C33.5281595,157.114603 33.4456497,157.499009 33.5036328,157.875234 C33.5359766,158.128594 33.6366016,158.164531 33.8046094,158.154648 L34.1064844,158.127695 L34.198125,158.125 L55.3356641,158.125 L55.6860547,158.119609 C56.5278906,158.091758 57.1325391,157.921055 57.4964062,157.103477 C59.7587305,153.094326 61.9702615,149.056724 64.1304687,144.991641 C66.2894141,140.929805 68.4753125,136.840117 70.6881641,132.725273 C72.8822374,128.642268 75.0168509,124.527589 77.0913281,120.382539 L77.2458594,120.382539 C79.492198,124.571384 81.7809354,128.737353 84.1117187,132.879805 L84.9724219,134.419727 C86.9211424,137.916516 88.8200324,141.440844 90.6685156,144.991641 C92.7350026,148.972723 94.7924298,152.958502 96.8407813,156.948945 C97.3645703,157.824023 98.224375,157.994727 99.4175,158.026172 L99.8523438,158.033359 L121.989844,158.033359 C122.132695,158.01 122.261172,158.004609 122.376172,158.004609 L122.588203,158.01 L122.7625,158.012695 C122.919727,158.006406 123.022148,157.965078 123.069766,157.797969 C123.167695,157.40625 123.112891,156.992969 122.915234,156.640781 L92.2111328,106.341758 L120.909922,58.9734375 L120.99168,58.8997656 C121.263231,58.6151174 121.314021,58.1852783 121.116289,57.8451797 Z M168.892773,98.1641797 C169.949193,98.1613542 171.005057,98.212933 172.056172,98.3187109 C172.916134,98.4008331 173.7676,98.5556177 174.601445,98.7814063 L174.601445,140.902852 L174.125273,141.034922 C173.169038,141.283616 172.192412,141.445986 171.207148,141.520078 C169.971797,141.623398 168.634922,141.675787 167.195625,141.675787 C164.498244,141.68816 161.81606,141.271154 159.249844,140.440156 C156.820509,139.673501 154.602403,138.353156 152.770312,136.583164 C150.855907,134.659039 149.381532,132.342646 148.448828,129.793672 C147.303124,126.630834 146.753878,123.282959 146.828945,119.919844 L146.832539,119.401445 C146.901719,114.600195 147.955586,110.709961 149.992344,107.730742 C152.03261,104.703627 154.823739,102.257983 158.092656,100.633086 C161.448702,98.9729615 165.148754,98.1271298 168.892773,98.1641797 Z"/></svg>
|
After Width: | Height: | Size: 4.6 KiB |
11
assets/redis.svg
Normal file
11
assets/redis.svg
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<svg viewBox="0 0 256 220" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" height="1em" width="1em">
|
||||||
|
<path d="M245.97 168.943c-13.662 7.121-84.434 36.22-99.501 44.075-15.067 7.856-23.437 7.78-35.34 2.09-11.902-5.69-87.216-36.112-100.783-42.597C3.566 169.271 0 166.535 0 163.951v-25.876s98.05-21.345 113.879-27.024c15.828-5.679 21.32-5.884 34.79-.95 13.472 4.936 94.018 19.468 107.331 24.344l-.006 25.51c.002 2.558-3.07 5.364-10.024 8.988" fill="#912626"/>
|
||||||
|
<path d="M245.965 143.22c-13.661 7.118-84.431 36.218-99.498 44.072-15.066 7.857-23.436 7.78-35.338 2.09-11.903-5.686-87.214-36.113-100.78-42.594-13.566-6.485-13.85-10.948-.524-16.166 13.326-5.22 88.224-34.605 104.055-40.284 15.828-5.677 21.319-5.884 34.789-.948 13.471 4.934 83.819 32.935 97.13 37.81 13.316 4.881 13.827 8.9.166 16.02" fill="#C6302B"/>
|
||||||
|
<path d="M245.97 127.074c-13.662 7.122-84.434 36.22-99.501 44.078-15.067 7.853-23.437 7.777-35.34 2.087-11.903-5.687-87.216-36.112-100.783-42.597C3.566 127.402 0 124.67 0 122.085V96.206s98.05-21.344 113.879-27.023c15.828-5.679 21.32-5.885 34.79-.95C162.142 73.168 242.688 87.697 256 92.574l-.006 25.513c.002 2.557-3.07 5.363-10.024 8.987" fill="#912626"/>
|
||||||
|
<path d="M245.965 101.351c-13.661 7.12-84.431 36.218-99.498 44.075-15.066 7.854-23.436 7.777-35.338 2.087-11.903-5.686-87.214-36.112-100.78-42.594-13.566-6.483-13.85-10.947-.524-16.167C23.151 83.535 98.05 54.148 113.88 48.47c15.828-5.678 21.319-5.884 34.789-.949 13.471 4.934 83.819 32.933 97.13 37.81 13.316 4.88 13.827 8.9.166 16.02" fill="#C6302B"/>
|
||||||
|
<path d="M245.97 83.653c-13.662 7.12-84.434 36.22-99.501 44.078-15.067 7.854-23.437 7.777-35.34 2.087-11.903-5.687-87.216-36.113-100.783-42.595C3.566 83.98 0 81.247 0 78.665v-25.88s98.05-21.343 113.879-27.021c15.828-5.68 21.32-5.884 34.79-.95C162.142 29.749 242.688 44.278 256 49.155l-.006 25.512c.002 2.555-3.07 5.361-10.024 8.986" fill="#912626"/>
|
||||||
|
<path d="M245.965 57.93c-13.661 7.12-84.431 36.22-99.498 44.074-15.066 7.854-23.436 7.777-35.338 2.09C99.227 98.404 23.915 67.98 10.35 61.497-3.217 55.015-3.5 50.55 9.825 45.331 23.151 40.113 98.05 10.73 113.88 5.05c15.828-5.679 21.319-5.883 34.789-.948 13.471 4.935 83.819 32.934 97.13 37.811 13.316 4.876 13.827 8.897.166 16.017" fill="#C6302B"/>
|
||||||
|
<path d="m159.283 32.757-22.01 2.285-4.927 11.856-7.958-13.23-25.415-2.284 18.964-6.839-5.69-10.498 17.755 6.944 16.738-5.48-4.524 10.855 17.067 6.391m-28.251 57.518L89.955 73.238l58.86-9.035-17.783 26.072m-56.95-50.928c17.375 0 31.46 5.46 31.46 12.194 0 6.736-14.085 12.195-31.46 12.195s-31.46-5.46-31.46-12.195c0-6.734 14.085-12.194 31.46-12.194" fill="#FFF"/>
|
||||||
|
<path d="m185.295 35.998 34.836 13.766-34.806 13.753-.03-27.52" fill="#621B1C"/>
|
||||||
|
<path d="m146.755 51.243 38.54-15.245.03 27.519-3.779 1.478-34.791-13.752" fill="#9A2928"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
354
docs/adobe-lightroom.md
Normal file
354
docs/adobe-lightroom.md
Normal file
@@ -0,0 +1,354 @@
|
|||||||
|
Adobe Lightroom 键盘快捷键
|
||||||
|
===
|
||||||
|
|
||||||
|
Adobe Lightroom CC 中 251 个键盘快捷键的可视化备忘单
|
||||||
|
|
||||||
|
键盘快捷键
|
||||||
|
--------
|
||||||
|
|
||||||
|
### 使用面板
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Tab` | 显示/隐藏侧面板
|
||||||
|
`Shift` `Tab` | 显示/隐藏所有面板
|
||||||
|
`T` | 显示/隐藏工具栏
|
||||||
|
`F5` | 显示/隐藏模块选择器
|
||||||
|
`F6` | 显示/隐藏胶片
|
||||||
|
`F7` | 显示/隐藏左侧面板
|
||||||
|
`F8` | 显示/隐藏右侧面板
|
||||||
|
`Alt` `(click a panel)` | 切换独奏模式
|
||||||
|
`Shift` `(click a panel)` | 在不关闭单独面板的情况下打开一个新面板
|
||||||
|
`Ctrl` `(click a panel)` | 打开/关闭所有面板
|
||||||
|
`Ctrl` `Shift` `0-5` | 打开/关闭左侧面板,从上到下
|
||||||
|
`Ctrl` `0-9` | 打开/关闭右侧面板、库和开发模块,从上到下
|
||||||
|
`Ctrl` `1-7` | 从上到下打开/关闭右面板、幻灯片、打印和 Web 模块
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 导航模块
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `Alt` `1` | 转到库模块
|
||||||
|
`Ctrl` `Alt` `2` | 转到开发模块
|
||||||
|
`Ctrl` `Alt` `3` | 转到幻灯片模块
|
||||||
|
`Ctrl` `Alt` `4` | 转到打印模块
|
||||||
|
`Ctrl` `Alt` `5` | 转到网络模块
|
||||||
|
`Ctrl` `Alt` `Left/Right` | 返回/前进
|
||||||
|
`Ctrl` `Alt` `Up` | 返回上一个模块
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 使用辅助窗口
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`F11` | 打开辅助窗口
|
||||||
|
`Shift` `G` | 进入网格视图
|
||||||
|
`Shift` `E` | 进入正常的放大镜视图
|
||||||
|
`Ctrl` `Shift` `Enter` | 进入锁定的放大镜视图
|
||||||
|
`Shift` `C` | 进入比较视图
|
||||||
|
`Shift` `N` | 进入调查视图
|
||||||
|
`Ctrl` `Alt` `Shift` `Enter` | 进入幻灯片视图
|
||||||
|
`Shift` `F11` | 进入全屏模式(需要第二台显示器)
|
||||||
|
`Shift` `\` | 显示/隐藏过滤栏
|
||||||
|
`Ctrl` `Shift` `+/-` | 放大/缩小
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 在开发模块中工作
|
||||||
|
<!--rehype:wrap-class=row-span-5-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`V` | 转换为灰度
|
||||||
|
`Ctrl` `U` | 自动音调
|
||||||
|
`Ctrl` `Shift` `U` | 自动白平衡
|
||||||
|
`Ctrl` `E` | 在 Photoshop 中编辑
|
||||||
|
`Ctrl` `Shift` `C/V` | 复制/粘贴开发设置
|
||||||
|
`Ctrl` `Alt` `V` | 粘贴上一张照片的设置
|
||||||
|
`Ctrl` `Alt` `Shift` `Left` | 将之后的设置复制到之前
|
||||||
|
`Ctrl` `Alt` `Shift` `Right` | 将之前的设置复制到之后
|
||||||
|
`Ctrl` `Alt` `Shift` `Up` | 交换前后设置
|
||||||
|
`Up/Down` | 以小增量增加/减少选定的滑块
|
||||||
|
`Shift` `Up/Down` | 以较大的增量增加/减少选定的滑块
|
||||||
|
`./,` | 循环浏览基本面板设置(向前/向后)
|
||||||
|
`(double-click slider name)` | 重置滑块
|
||||||
|
`Alt` `(click group name)` | 重置一组滑块
|
||||||
|
`Ctrl` `Shift` `R` | 重置所有设置
|
||||||
|
`Ctrl` `Shift` `S` | 同步设置
|
||||||
|
`Ctrl` `Alt` `S` | 绕过同步设置对话框同步设置
|
||||||
|
`Ctrl` `(click Sync button)` | 切换自动同步
|
||||||
|
`Ctrl` `Alt` `Shift` `A` | 启用自动同步
|
||||||
|
`Ctrl` `Alt` `Shift` `M` | 匹配总曝光量
|
||||||
|
`W` | 选择白平衡工具(来自任何模块)
|
||||||
|
`R` | 选择裁剪工具(来自任何模块)
|
||||||
|
`A` | 选择裁剪工具时限制纵横比
|
||||||
|
`Shift` `A` | 裁剪为与上一次裁剪相同的纵横比
|
||||||
|
`Alt` `(drag)` | 从照片中心裁剪
|
||||||
|
`O` | 循环作物网格覆盖
|
||||||
|
`Shift` `O` | 循环裁剪网格叠加方向
|
||||||
|
`X` | 在纵向和横向之间切换裁剪
|
||||||
|
`Ctrl` `Alt` `R` | 重置作物
|
||||||
|
`Shift` `T` | 选择 Guided Upright 工具
|
||||||
|
`Q` | 选择 Sopt 删除工具
|
||||||
|
`Shift` `T` | 选择污点去除工具时在克隆和修复模式之间切换笔刷
|
||||||
|
`K` | 选择调整画笔工具(来自任何模块)
|
||||||
|
`M` | 选择渐变滤镜工具
|
||||||
|
`Shift` `T` | 选择渐变/径向滤镜时在编辑和画笔模式之间切换蒙版
|
||||||
|
`]/[` | 增大/减小画笔大小
|
||||||
|
`Shift` `]/[` | 增加/减少笔刷羽化
|
||||||
|
`/` | 在局部调整刷A和B之间切换
|
||||||
|
`Alt` `(drag)` | 暂时从画笔 A 或 B 切换到橡皮擦
|
||||||
|
`Shift` `(drag)` | 绘制水平线或垂直线
|
||||||
|
`H` | 显示/隐藏局部调整引脚
|
||||||
|
`O` | 显示/隐藏局部调整蒙版覆盖
|
||||||
|
`Shift` `O` | 循环局部调整蒙版叠加颜色
|
||||||
|
`Ctrl` `Alt` `Shift` `T` | 选择目标调整工具以应用色调曲线调整
|
||||||
|
`Ctrl` `Alt` `Shift` `H` | 选择目标调整工具以应用色相调整
|
||||||
|
`Ctrl` `Alt` `Shift` `S` | 选择目标调整工具以应用饱和度调整
|
||||||
|
`Ctrl` `Alt` `Shift` `L` | 选择目标调整工具以应用亮度调整
|
||||||
|
`Ctrl` `Alt` `Shift` `G` | 选择目标调整工具以应用灰度混合调整
|
||||||
|
`Ctrl` `Alt` `Shift` `N` | 取消选择目标调整工具
|
||||||
|
`J` | 显示剪辑
|
||||||
|
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||||
|
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||||
|
`Space/Z` | 在放大镜和 1:1 缩放预览之间切换
|
||||||
|
`Ctrl` `+/-` | 放大/缩小
|
||||||
|
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||||
|
`Y` | 查看左/右之前和之后
|
||||||
|
`Alt` `Y` | 查看顶部/底部之前和之后
|
||||||
|
`Shift` `Y` | 在分屏中查看之前和之后
|
||||||
|
`\` | 仅查看之前
|
||||||
|
`Ctrl` `N` | 创建新快照
|
||||||
|
`Ctrl` `Shift` `N` | 创建新预设
|
||||||
|
`Ctrl` `Alt` `N` | 创建一个新的预设文件夹
|
||||||
|
`Ctrl` `J` | 打开开发视图选项
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 更改视图和屏幕模式
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`E` | 进入图书馆放大镜视图
|
||||||
|
`G` | 进入库网格视图
|
||||||
|
`C` | 进入图书馆比较视图
|
||||||
|
`N` | 进入图书馆调查视图
|
||||||
|
`D` | 在修改照片模块中打开选定的照片
|
||||||
|
`L` | 通过 Lights Out 模式向前循环
|
||||||
|
`Shift` `L` | 通过 Lights Out 模式向后循环
|
||||||
|
`Ctrl` `Shift` `L` | 切换灯光昏暗模式
|
||||||
|
`F` | 循环屏幕模式
|
||||||
|
`Ctrl` `Shift` `F` | 在普通和全屏之间切换,隐藏面板
|
||||||
|
`Ctrl` `Alt` `F` | 进入普通屏幕模式
|
||||||
|
`I` | 循环信息叠加
|
||||||
|
`Ctrl` `I` | 显示/隐藏信息覆盖
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 管理照片和目录
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `Shift` `I` | 从磁盘导入照片
|
||||||
|
`Ctrl` `O` | 打开目录
|
||||||
|
`Ctrl` `,` | 打开首选项
|
||||||
|
`Ctrl` `Alt` `,` | 打开目录设置
|
||||||
|
`Ctrl` `Shift` `T` | 创建新的子文件夹(分段联机捕获)
|
||||||
|
`Ctrl` `T` | 隐藏/显示系绳捕获栏
|
||||||
|
`Ctrl` `Shift` `N` | 在库模块中创建一个新文件夹
|
||||||
|
`Ctrl` `'` | 创建虚拟副本(仅限库和开发模块)
|
||||||
|
`Ctrl` `R` | 在资源管理器/Finder 中显示(仅限库和开发模块)
|
||||||
|
`Right/Left` | 转到胶片中的下一张/上一张照片
|
||||||
|
`Shift/Ctrl` `Click` | 选择多个文件夹或集合(在库、幻灯片、打印和 Web 模块中)
|
||||||
|
`F2` | 重命名照片(在图库模块中)
|
||||||
|
`Delete` | 删除所选照片
|
||||||
|
`Alt` `Backspace` | 从目录中删除所选照片
|
||||||
|
`Ctrl` `Alt` `Shift` `Backspace` | 删除所选照片并移至废纸篓
|
||||||
|
`Ctrl` `Backspace` | 删除被拒绝的照片
|
||||||
|
`Ctrl` `E` | 在 Photoshop 中编辑
|
||||||
|
`Ctrl` `Alt` `E` | 在其他编辑器中打开
|
||||||
|
`Ctrl` `Shift` `E` | 导出所选照片
|
||||||
|
`Ctrl` `Alt` `Shift` `E` | 使用以前的设置导出
|
||||||
|
`Ctrl` `Alt` `Shift` `,` | 打开插件管理器
|
||||||
|
`Ctrl` `P` | 打印所选照片
|
||||||
|
`Ctrl` `Shift` `P` | 打开页面设置对话框
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 比较图库模块中的照片
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`E/Enter` | 切换到放大视图
|
||||||
|
`G/Esc` | 切换到网格视图
|
||||||
|
`C` | 切换到比较视图
|
||||||
|
`N` | 切换到调查视图
|
||||||
|
`Space/E` | 从网格切换到放大视图
|
||||||
|
`Down` | 在比较视图中交换选择和候选照片
|
||||||
|
`Up` | 在比较视图中选择下一张照片和候选照片
|
||||||
|
`Z` | 切换缩放视图
|
||||||
|
`Ctrl` `+/-` | 在放大镜视图中放大/缩小
|
||||||
|
`PgUp/PgDown` | 在放大视图中向上/向下滚动放大的照片
|
||||||
|
`Home/End` | 转到网格视图的开头/结尾
|
||||||
|
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||||
|
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||||
|
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||||
|
`=/-` | 增加/减少网格缩略图大小
|
||||||
|
`PgUp/PgDown` | 向上/向下滚动网格缩略图
|
||||||
|
`Ctrl` `Shift` `H` | 切换单元格附加功能
|
||||||
|
`Ctrl` `Alt` `Shift` `H` | 显示/隐藏徽章
|
||||||
|
`J` | 循环网格视图
|
||||||
|
`Ctrl` `J` | 打开库视图选项
|
||||||
|
`Ctrl` `(click)` | 选择多张离散照片
|
||||||
|
`Shift` `(click)` | 选择多张连续照片
|
||||||
|
`Ctrl` `A` | 选择所有照片
|
||||||
|
`Ctrl` `D` | 取消选择所有照片
|
||||||
|
`Ctrl` `Shift` `D` | 仅选择活动照片
|
||||||
|
`/` | 取消选择现用照片
|
||||||
|
`Shift` `Left/Right` | 将上一张/下一张照片添加到选择
|
||||||
|
`Ctrl` `Alt` `A` | 选择标记的照片
|
||||||
|
`Ctrl` `Alt` `Shift` `D` | 取消选择未标记的照片
|
||||||
|
`Ctrl` `G` | 分组入栈
|
||||||
|
`Ctrl` `Shift` `G` | 拆叠
|
||||||
|
`S` | 切换堆栈
|
||||||
|
`Shift` `S` | 移动到堆栈顶部
|
||||||
|
`Shift` `[` | 在堆栈中向上移动
|
||||||
|
`Shift` `]` | 在堆栈中向下移动
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 评级和过滤照片
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`1-5` | 设置星级
|
||||||
|
`Shift` `1-5` | 设置星级并转到下一张照片
|
||||||
|
`0` | 删除星级
|
||||||
|
`Shift` `0` | 删除星级并转到下一张照片
|
||||||
|
`]/[` | 将评分提高/降低一颗星
|
||||||
|
`6` | 分配一个红色标签
|
||||||
|
`7` | 分配黄色标签
|
||||||
|
`8` | 分配一个绿色标签
|
||||||
|
`9` | 分配一个蓝色标签
|
||||||
|
`Shift` `6-9` | 分配颜色标签并转到下一张照片
|
||||||
|
`P` | 将照片标记为精选
|
||||||
|
`Shift` `P` | 将照片标记为精选并转到下一张照片
|
||||||
|
`X` | 将照片标记为拒绝
|
||||||
|
`Shift` `X` | 将照片标记为拒绝并转到下一张照片
|
||||||
|
`U` | 取消标记照片
|
||||||
|
`Shift` `U` | 取消标记照片并转到下一张照片
|
||||||
|
`Ctrl` `Up/Down` | 增加/减少标志状态
|
||||||
|
<code>\`</code> | 循环标志设置
|
||||||
|
`Ctrl` `Alt` `R` | 优化照片
|
||||||
|
`\` | 显示/隐藏库过滤器栏
|
||||||
|
`Shift` `(click filter labels)` | 在过滤器栏中打开多个过滤器
|
||||||
|
`Shift` `L` | 打开/关闭过滤器
|
||||||
|
`Ctrl` `F` | 在图库模块中查找照片
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 使用集合
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `N` | 在 Library 模块中创建一个新的集合
|
||||||
|
`B` | 添加到快速收藏
|
||||||
|
`Shift` `B` | 添加到快速收藏并转到下一张照片
|
||||||
|
`Ctrl` `B` | 显示快速收藏
|
||||||
|
`Ctrl` `Alt` `B` | 保存快速收藏
|
||||||
|
`Ctrl` `Shift` `B` | 清除快速收藏
|
||||||
|
`Ctrl` `Alt` `Shift` `B` | 设为目标集合
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 在库模块中使用元数据和关键字
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `K` | 添加关键字
|
||||||
|
`Ctrl` `Shift` `K` | 修改关键字
|
||||||
|
`Ctrl` `Alt` `Shift` `K` | 设置关键字快捷方式
|
||||||
|
`Shift` `K` | 从所选照片中添加/删除关键字快捷方式
|
||||||
|
`Ctrl` `Alt` `K` | 启用绘画
|
||||||
|
`Alt` `1-9` | 将关键字集中的关键字添加到所选照片
|
||||||
|
`Alt` `0` | 通过关键字集向前循环
|
||||||
|
`Alt` `Shift` `0` | 通过关键字集循环反向词
|
||||||
|
`Ctrl` `Alt` `Shift` `C/V` | 复制/粘贴元数据
|
||||||
|
`Ctrl` `S` | 将元数据保存到文件
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 在幻灯片模块中工作
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Enter` | 播放幻灯片
|
||||||
|
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||||
|
`Space` | 暂停幻灯片放映
|
||||||
|
`Alt` `Enter` | 预览幻灯片
|
||||||
|
`Esc` | 结束幻灯片放映
|
||||||
|
`Right` | 转到下一张幻灯片
|
||||||
|
`Left` | 转到上一张幻灯片
|
||||||
|
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||||
|
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||||
|
`Ctrl` `Shift` `H` | 显示/隐藏指南
|
||||||
|
`Ctrl` `J` | 导出 PDF 幻灯片放映
|
||||||
|
`Ctrl` `Shift` `J` | 导出 JPEG 幻灯片放映
|
||||||
|
`Ctrl` `Alt` `J` | 导出视频幻灯片
|
||||||
|
`Ctrl` `N` | 创建新的幻灯片放映模板
|
||||||
|
`Ctrl` `Shift` `N` | 创建新的幻灯片放映模板文件夹
|
||||||
|
`Ctrl` `S` | 保存幻灯片放映设置
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 在打印模块中工作
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `P` | 打印
|
||||||
|
`Ctrl` `Alt` `P` | 打印一份
|
||||||
|
`Ctrl` `Shift` `P` | 打开页面设置对话框
|
||||||
|
`Ctrl` `Alt` `Shift` `P` | 打开打印设置对话框
|
||||||
|
`Ctrl` `Shift` `Left` | 转到第一页
|
||||||
|
`Ctrl` `Shift` `Right` | 转到最后一页
|
||||||
|
`Ctrl` `Left` | 转到上一页
|
||||||
|
`Ctrl` `Right` | 转到下一页
|
||||||
|
`Ctrl` `Shift` `H` | 显示/隐藏指南
|
||||||
|
`Ctrl` `R` | 显示/隐藏标尺
|
||||||
|
`Ctrl` `Shift` `J` | 显示/隐藏页面出血
|
||||||
|
`Ctrl` `Shift` `M` | 显示/隐藏边距和装订线
|
||||||
|
`Ctrl` `Shift` `K` | 显示/隐藏图像单元格
|
||||||
|
`Ctrl` `Shift` `U` | 显示/隐藏尺寸
|
||||||
|
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||||
|
`Ctrl` `]` | 向右旋转照片(顺时针)
|
||||||
|
`Ctrl` `[` | 向左旋转照片(逆时针)
|
||||||
|
`Ctrl` `N` | 创建一个新的打印模板
|
||||||
|
`Ctrl` `Shift` `N` | 创建一个新的打印模板文件夹
|
||||||
|
`Ctrl` `S` | 保存打印设置
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 在 Web 模块中工作
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `R` | 重新加载网络画廊
|
||||||
|
`Ctrl` `Alt` `P` | 在浏览器中预览
|
||||||
|
`Ctrl` `Enter` | 播放即兴幻灯片
|
||||||
|
`Ctrl` `J` | 导出网络画廊
|
||||||
|
`Ctrl` `N` | 创建新的 Web 画廊模板
|
||||||
|
`Ctrl` `Shift` `N` | 创建新的 Web 画廊模板文件夹
|
||||||
|
`Ctrl` `S` | 保存 Web 画廊设置
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 使用帮助
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `/` | 显示当前模块快捷方式
|
||||||
|
`(click)` | 隐藏当前模块快捷方式
|
||||||
|
`Ctrl` `Alt` `/` | 转到当前模块帮助
|
||||||
|
`F1` | 打开社区帮助
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
另见
|
||||||
|
--------
|
||||||
|
|
||||||
|
- [Keyboard shortcuts for Adobe Lightroom CC](https://helpx.adobe.com/lightroom/help/keyboard-shortcuts.html) _(helpx.adobe.com)_
|
@@ -8,8 +8,8 @@ Adobe Photoshop 中 283 个[键盘快捷键](https://helpx.adobe.com/photoshop/u
|
|||||||
|
|
||||||
### 热门快捷方式
|
### 热门快捷方式
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `T` | 自由变换
|
`Ctrl` `T` | 自由变换
|
||||||
`[` | 减小画笔大小
|
`[` | 减小画笔大小
|
||||||
`]` | 增加画笔大小
|
`]` | 增加画笔大小
|
||||||
@@ -29,8 +29,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用功能键
|
### 使用功能键
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`F1` | 开始帮助
|
`F1` | 开始帮助
|
||||||
`F2` | 剪切
|
`F2` | 剪切
|
||||||
`F3` | 复制
|
`F3` | 复制
|
||||||
@@ -49,8 +49,8 @@ Shortcut | Action
|
|||||||
### 选择工具
|
### 选择工具
|
||||||
<!--rehype:wrap-class=row-span-3-->
|
<!--rehype:wrap-class=row-span-3-->
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`V` | 移动工具
|
`V` | 移动工具
|
||||||
`M` | 矩形选框工具
|
`M` | 矩形选框工具
|
||||||
`L` | 套索工具
|
`L` | 套索工具
|
||||||
@@ -88,8 +88,8 @@ Shortcut | Action
|
|||||||
### 查看图片
|
### 查看图片
|
||||||
<!--rehype:wrap-class=row-span-2-->
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `Tab` | 循环浏览打开的文档
|
`Ctrl` `Tab` | 循环浏览打开的文档
|
||||||
`Ctrl` `Shift` `Tab` | 切换到上一个文档
|
`Ctrl` `Shift` `Tab` | 切换到上一个文档
|
||||||
`Ctrl` `Shift` `W` | 在 Photoshop 中关闭文件并打开 Bridge
|
`Ctrl` `Shift` `W` | 在 Photoshop 中关闭文件并打开 Bridge
|
||||||
@@ -110,8 +110,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用木偶变形
|
### 使用木偶变形
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Esc` | 完全取消
|
`Esc` | 完全取消
|
||||||
`Ctrl` `Z` | 撤消最后一次引脚调整
|
`Ctrl` `Z` | 撤消最后一次引脚调整
|
||||||
`Ctrl` `A` | 选择所有引脚
|
`Ctrl` `A` | 选择所有引脚
|
||||||
@@ -121,8 +121,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用优化边缘
|
### 使用优化边缘
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `Alt` `R` | 打开优化边缘对话框
|
`Ctrl` `Alt` `R` | 打开优化边缘对话框
|
||||||
`F` | 通过预览模式向前循环
|
`F` | 通过预览模式向前循环
|
||||||
`Shift` `F` | 通过预览模式向后循环
|
`Shift` `F` | 通过预览模式向后循环
|
||||||
@@ -134,8 +134,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用滤镜库
|
### 使用滤镜库
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `Alt` `F` | 重新应用上次使用的过滤器
|
`Ctrl` `Alt` `F` | 重新应用上次使用的过滤器
|
||||||
`Ctrl` | 将取消按钮更改为默认值
|
`Ctrl` | 将取消按钮更改为默认值
|
||||||
`Alt` | 将取消按钮更改为重置
|
`Alt` | 将取消按钮更改为重置
|
||||||
@@ -147,8 +147,8 @@ Shortcut | Action
|
|||||||
### 使用液化滤镜
|
### 使用液化滤镜
|
||||||
<!--rehype:wrap-class=row-span-2-->
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`W` | 向前扭曲工具
|
`W` | 向前扭曲工具
|
||||||
`R` | 重构工具
|
`R` | 重构工具
|
||||||
`C` | 顺时针旋转工具
|
`C` | 顺时针旋转工具
|
||||||
@@ -168,8 +168,8 @@ Shortcut | Action
|
|||||||
### 使用消失点
|
### 使用消失点
|
||||||
<!--rehype:wrap-class=row-span-2-->
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`X` | 缩放 2 倍(临时)
|
`X` | 缩放 2 倍(临时)
|
||||||
`Ctrl` `+` | 放大
|
`Ctrl` `+` | 放大
|
||||||
`Ctrl` `-` | 缩小
|
`Ctrl` `-` | 缩小
|
||||||
@@ -191,8 +191,8 @@ Shortcut | Action
|
|||||||
### 使用 Camera Raw 对话框
|
### 使用 Camera Raw 对话框
|
||||||
<!--rehype:wrap-class=row-span-5-->
|
<!--rehype:wrap-class=row-span-5-->
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Z` | 缩放工具
|
`Z` | 缩放工具
|
||||||
`H` | 手工具
|
`H` | 手工具
|
||||||
`I` | 白平衡工具
|
`I` | 白平衡工具
|
||||||
@@ -251,8 +251,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用黑白对话框
|
### 使用黑白对话框
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `Shift` `Alt` `B` | 打开黑白对话框
|
`Ctrl` `Shift` `Alt` `B` | 打开黑白对话框
|
||||||
`Up/Down` | 将所选值增加/减少 1%
|
`Up/Down` | 将所选值增加/减少 1%
|
||||||
`Shift` `Up/Down` | 将所选值增加/减少 10%
|
`Shift` `Up/Down` | 将所选值增加/减少 10%
|
||||||
@@ -260,16 +260,16 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 编辑路径
|
### 编辑路径
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` | 从路径选择、笔、添加锚点、删除锚点或将点工具转换为直接选择工具
|
`Ctrl` | 从路径选择、笔、添加锚点、删除锚点或将点工具转换为直接选择工具
|
||||||
`Alt` | 当指针位于锚点或方向点上时,从钢笔工具切换到自由钢笔工具以转换点工具
|
`Alt` | 当指针位于锚点或方向点上时,从钢笔工具切换到自由钢笔工具以转换点工具
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
### 变换选区、选区边框和路径
|
### 变换选区、选区边框和路径
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Alt` | 从中心变换或反射
|
`Alt` | 从中心变换或反射
|
||||||
`Shift` | 约束
|
`Shift` | 约束
|
||||||
`Ctrl` | 歪曲
|
`Ctrl` | 歪曲
|
||||||
@@ -281,8 +281,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用曲线
|
### 使用曲线
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `M` | 打开曲线对话框
|
`Ctrl` `M` | 打开曲线对话框
|
||||||
`+` | 选择曲线上的下一个点
|
`+` | 选择曲线上的下一个点
|
||||||
`-` | 选择曲线上的前一点
|
`-` | 选择曲线上的前一点
|
||||||
@@ -294,8 +294,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 用于绘画
|
### 用于绘画
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Alt` `Shift` `0-9` | 混合器画笔更改混合设置
|
`Alt` `Shift` `0-9` | 混合器画笔更改混合设置
|
||||||
`0-9` | 混合刷改变湿设置
|
`0-9` | 混合刷改变湿设置
|
||||||
`00` | 搅拌刷变湿并混合至零
|
`00` | 搅拌刷变湿并混合至零
|
||||||
@@ -311,8 +311,8 @@ Shortcut | Action
|
|||||||
### 用于混合模式
|
### 用于混合模式
|
||||||
<!--rehype:wrap-class=row-span-2-->
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `-/+` | 循环混合模式
|
`Ctrl` `-/+` | 循环混合模式
|
||||||
`Shift` `Alt` `N` | 普通的
|
`Shift` `Alt` `N` | 普通的
|
||||||
`Shift` `Alt` `I` | 溶解
|
`Shift` `Alt` `I` | 溶解
|
||||||
@@ -344,8 +344,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 格式类型
|
### 格式类型
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `Shift` `L/C/R` | 左对齐、居中或右对齐
|
`Ctrl` `Shift` `L/C/R` | 左对齐、居中或右对齐
|
||||||
`Ctrl` `Shift` `X` | 选择 100% 水平比例
|
`Ctrl` `Shift` `X` | 选择 100% 水平比例
|
||||||
`Ctrl` `Shift` `Alt` `X` | 选择 100% 垂直比例
|
`Ctrl` `Shift` `Alt` `X` | 选择 100% 垂直比例
|
||||||
@@ -363,8 +363,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用面板
|
### 使用面板
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Shift` `Enter` | 应用值并保持文本框处于活动状态
|
`Shift` `Enter` | 应用值并保持文本框处于活动状态
|
||||||
`Tab` | 显示/隐藏所有面板
|
`Tab` | 显示/隐藏所有面板
|
||||||
`Shift` `Tab` | 显示/隐藏除工具箱和选项栏之外的所有面板
|
`Shift` `Tab` | 显示/隐藏除工具箱和选项栏之外的所有面板
|
||||||
@@ -374,8 +374,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用调整图层
|
### 使用调整图层
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Alt` `3` | 选择红色通道进行调整
|
`Alt` `3` | 选择红色通道进行调整
|
||||||
`Alt` `4` | 选择绿色通道进行调整
|
`Alt` `4` | 选择绿色通道进行调整
|
||||||
`Alt` `5` | 选择蓝色通道进行调整
|
`Alt` `5` | 选择蓝色通道进行调整
|
||||||
@@ -385,8 +385,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用画笔面板
|
### 使用画笔面板
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`,/.` | 选择上一个/下一个画笔大小
|
`,/.` | 选择上一个/下一个画笔大小
|
||||||
`Shift` `,/.` | 选择第一个/最后一个画笔
|
`Shift` `,/.` | 选择第一个/最后一个画笔
|
||||||
`Caps Lock` | 显示画笔的精确十字线
|
`Caps Lock` | 显示画笔的精确十字线
|
||||||
@@ -395,8 +395,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用克隆源面板
|
### 使用克隆源面板
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Alt` `Shift` | 显示克隆源(覆盖 iamge)
|
`Alt` `Shift` | 显示克隆源(覆盖 iamge)
|
||||||
`Alt` `Shift` `(arrows)` | 轻推克隆源
|
`Alt` `Shift` `(arrows)` | 轻推克隆源
|
||||||
`Alt` `Shift` `</>` | 旋转克隆源
|
`Alt` `Shift` `</>` | 旋转克隆源
|
||||||
@@ -405,8 +405,8 @@ Shortcut | Action
|
|||||||
|
|
||||||
### 使用图层面板
|
### 使用图层面板
|
||||||
|
|
||||||
Shortcut | Action
|
快捷键 | 说明
|
||||||
---|---
|
:- | -
|
||||||
`Ctrl` `Shift` `N` | 新层
|
`Ctrl` `Shift` `N` | 新层
|
||||||
`Ctrl` `J` | 通过复制新建图层
|
`Ctrl` `J` | 通过复制新建图层
|
||||||
`Ctrl` `Shift` `J` | 通过剪切新建图层
|
`Ctrl` `Shift` `J` | 通过剪切新建图层
|
||||||
|
194
docs/adobe-xd.md
Normal file
194
docs/adobe-xd.md
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
Adobe XD 键盘快捷键
|
||||||
|
===
|
||||||
|
|
||||||
|
Adobe XD 中 97 个键盘快捷键的可视化备忘单
|
||||||
|
|
||||||
|
键盘快捷键
|
||||||
|
--------
|
||||||
|
|
||||||
|
### 编辑菜单键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `Z` | 撤消
|
||||||
|
`Ctrl` `Shift` `Z` | 重做
|
||||||
|
`Ctrl` `X` | 剪切
|
||||||
|
`Ctrl` `C` | 复制
|
||||||
|
`Ctrl` `V` | 粘贴
|
||||||
|
`Ctrl` `Alt` `V` | 粘贴外观(设计模式)或粘贴交互(原型模式)
|
||||||
|
`Ctrl` `D` | 复制
|
||||||
|
`Del` | 删除
|
||||||
|
`Ctrl` `A` | 全选
|
||||||
|
`Ctrl` `Shift` `A` | 取消全选
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 文件菜单键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `N` | 新的
|
||||||
|
`Ctrl` `Shift` `O` | 打开...
|
||||||
|
`Alt` `F4` | 关闭
|
||||||
|
`Ctrl` `S` | 节省...
|
||||||
|
`Ctrl` `Shift` `S` | 另存为...
|
||||||
|
`Ctrl` `Shift` `E` | 出口批量
|
||||||
|
`Ctrl` `E` | 导出选择
|
||||||
|
`Ctrl` `Shift` `I` | 进口
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 笔/路径键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`P` | 切换到钢笔工具
|
||||||
|
`Alt` | 不对称控制点
|
||||||
|
`Shift` | 捕捉控制点角度
|
||||||
|
`Shift` | 捕捉锚点角度
|
||||||
|
`Ctrl` `Alt` `U` | 添加
|
||||||
|
`Ctrl` `Alt` `S` | 减去
|
||||||
|
`Ctrl` `Alt` `I` | 相交
|
||||||
|
`Ctrl` `Alt` `X` | 排除重叠
|
||||||
|
`Ctrl` `8` | 转换为路径
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 图层(对象)、组和画板的键
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `G` | 图层组
|
||||||
|
`Ctrl` `Shift` `G` | 取消组合图层
|
||||||
|
`Ctrl` `K` | 制作组件
|
||||||
|
`Ctrl` `L` | 锁定/解锁图层
|
||||||
|
`Ctrl` `,` | 隐藏/显示图层
|
||||||
|
`Ctrl` `Shift` `M` | 有形状的面具
|
||||||
|
`Ctrl` `R` | 制作重复网格
|
||||||
|
`1-9` | 更改图层不透明度
|
||||||
|
`Ctrl` `;` | 显示/隐藏画板指南
|
||||||
|
`Ctrl` `Shift` `;` | 锁定画板指南
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 对齐键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `Shift` `Left` | 左边
|
||||||
|
`Shift` `C` | 中心(水平)
|
||||||
|
`Ctrl` `Shift` `Right` | 正确的
|
||||||
|
`Ctrl` `Shift` `Up` | 顶部
|
||||||
|
`Shift` `M` | 中间(垂直)
|
||||||
|
`Ctrl` `Shift` `Down` | 底部
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 排列键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `Shift` `]` | 置于最前面
|
||||||
|
`Ctrl` `]` | 向前进
|
||||||
|
`Ctrl` `[` | 向后发送
|
||||||
|
`Ctrl` `Shift` `[` | 发送到后台
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 分发键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `Shift` `H` | 水平的
|
||||||
|
`Ctrl` `Shift` `V` | 竖的
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 文本键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `B` | 粗体
|
||||||
|
`Ctrl` `I` | 斜体
|
||||||
|
`Ctrl` `Shift` `.` | 增加字体大小
|
||||||
|
`Ctrl` `Shift` `,` | 减小字体大小
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 操作菜单键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Alt` | 从中心
|
||||||
|
`Shift` | 约束
|
||||||
|
`Enter` | 编辑文字
|
||||||
|
`Shift` | 约束旋转(15 度)
|
||||||
|
`Shift` | 线约束旋转(45 度)
|
||||||
|
`Shift` `Alt` | 从中心约束
|
||||||
|
`Ctrl` | 直接选择
|
||||||
|
`Ctrl` `Tab` | 在设计和原型模式之间切换
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 工具菜单键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`V` | 选择
|
||||||
|
`R` | 长方形
|
||||||
|
`E` | 椭圆
|
||||||
|
`Y` | 多边形
|
||||||
|
`L` | 线
|
||||||
|
`P` | 笔
|
||||||
|
`T` | 文本
|
||||||
|
`A` | 画板
|
||||||
|
`Z` | 快速移动
|
||||||
|
`Ctrl` `3` | 缩放到所选内容
|
||||||
|
`I` | 滴管
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 界面和查看选项的键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `+` | 放大
|
||||||
|
`Ctrl` `-` | 缩小
|
||||||
|
`Ctrl` `0` | 缩放以适合
|
||||||
|
`Ctrl` `1` | 缩放至 `100%`
|
||||||
|
`Ctrl` `2` | 缩放至 `200%`
|
||||||
|
`Space` | 平底锅
|
||||||
|
`Ctrl` `Shift` `Y` | 资产
|
||||||
|
`Ctrl` `Y` | 图层
|
||||||
|
`Ctrl` `Shift` `'` | 显示布局网格
|
||||||
|
`Ctrl` `'` | 显示方形网格
|
||||||
|
`Ctrl` `Tab` | 在设计和原型模式之间切换
|
||||||
|
`Up/Down` | 将字段中的值增加或减少 `1`
|
||||||
|
`Shift` `Up/Down` | 将字段中的值增加或减少 `10`
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 设计规范要点
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `+/-` | 快速移动
|
||||||
|
`Ctrl` `0` | 重置缩放
|
||||||
|
`(arrows)` | 平底锅
|
||||||
|
`Shift` `(arrows)` | 更快的锅
|
||||||
|
`Esc` | 从规范视图转到用户体验流程视图
|
||||||
|
`Esc` | 在 UX 流视图中从画板上移除焦点
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 矢量编辑键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Enter` | 开始编辑选定的矢量对象
|
||||||
|
`Esc` | 停止编辑选定的矢量对象
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
### 原型制作的关键
|
||||||
|
|
||||||
|
快捷键 | 说明
|
||||||
|
:- | -
|
||||||
|
`Ctrl` `A` | 查看原型模式下的所有连接
|
||||||
|
`Ctrl` `Enter` | 预览
|
||||||
|
`Ctrl` `Shift` `E` | 在线分享原型
|
||||||
|
`Left/Right` | 在预览或共享原型中浏览画板
|
||||||
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
另见
|
||||||
|
--------
|
||||||
|
|
||||||
|
- [Keyboard shortcuts for Adobe XD](https://helpx.adobe.com/xd/help/keyboard-shortcuts.html) _(helpx.adobe.com)_
|
249
docs/aspect-ratio.md
Normal file
249
docs/aspect-ratio.md
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
Aspect Ratio 备忘清单
|
||||||
|
===
|
||||||
|
|
||||||
|
此备忘单列出了一些常见的宽高比及其像素分辨率
|
||||||
|
|
||||||
|
入门
|
||||||
|
----
|
||||||
|
<!--rehype:body-class=cols-2-->
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
|
- 宽高比是屏幕或图像的宽度和高度之间的比率
|
||||||
|
- 它通常写成由冒号或“x”分隔的两个数字,例如:16:9 或 16x9
|
||||||
|
- 这被解释为宽度为 W 像素,高度为每个 H 像素。
|
||||||
|
- 分辨率是像素数(颜色的各个点)
|
||||||
|
<!--rehype:className=style-round-->
|
||||||
|
|
||||||
|
宽高比列表
|
||||||
|
--------
|
||||||
|
|
||||||
|
### 1080p
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 864 x 1080
|
||||||
|
1.25 (5:4) | 1350 x 1080
|
||||||
|
1.33 (4:3) | 1440 x 1080
|
||||||
|
1.66 (5:3) | 1800 x 1080
|
||||||
|
1.78 (16:9) | 1920 x 1080
|
||||||
|
1.85 | 1920 x 1038
|
||||||
|
1.90 | 1920 x 1011
|
||||||
|
2.00 | 1920 x 960
|
||||||
|
2.35 | 1920 x 817
|
||||||
|
2.37 | 1920 x 810
|
||||||
|
2.39 | 1920 x 803
|
||||||
|
2.40 | 1920 x 800
|
||||||
|
2.44 | 1920 x 787
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 720p
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 576 x 720
|
||||||
|
1.25 (5:4) | 900 x 720
|
||||||
|
1.33 (4:3) | 960 x 720
|
||||||
|
1.66 (5:3) | 1200 x 720
|
||||||
|
1.78 (16:9) | 1280 x 720
|
||||||
|
1.85 | 1280 x 692
|
||||||
|
1.90 | 1280 x 674
|
||||||
|
2.00 | 1280 x 640
|
||||||
|
2.35 | 1280 x 545
|
||||||
|
2.37 | 1280 x 540
|
||||||
|
2.39 | 1280 x 536
|
||||||
|
2.40 | 1280 x 533
|
||||||
|
2.44 | 1280 x 525
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### Cinema DCP 4K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
Flat (1.85) | 3996 x 2160
|
||||||
|
Scope (2.39) | 4096 x 1716
|
||||||
|
Full Container (1.90) | 4096 x 2160
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### Cinema DCP 2K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
Flat (1.85) | 1998 x 1080
|
||||||
|
Scope (2.39) | 2048 x 858
|
||||||
|
Full Container (1.90) | 2048 x 1080
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 8K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 3686 x 4608
|
||||||
|
1.25 (5:4) | 5760 x 4608
|
||||||
|
1.33 (4:3) | 6144 x 4608
|
||||||
|
1.66 (5:3) | 7680 x 4608
|
||||||
|
1.78 (16:9) | 8192 x 4608
|
||||||
|
1.85 | 8192 x 4428
|
||||||
|
1.90 | 8192 x 4320
|
||||||
|
2.00 | 8192 x 4096
|
||||||
|
2.35 | 8192 x 3486
|
||||||
|
2.37 | 8192 x 3456
|
||||||
|
2.39 | 8192 x 3428
|
||||||
|
2.40 | 8192 x 3413
|
||||||
|
2.44 | 8192 x 3357
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 6K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 2765 x 3456
|
||||||
|
1.25 (5:4) | 4320 x 3456
|
||||||
|
1.33 (4:3) | 4608 x 3456
|
||||||
|
1.66 (5:3) | 5760 x 3456
|
||||||
|
1.78 (16:9) | 6144 x 3456
|
||||||
|
1.85 | 6144 x 3321
|
||||||
|
1.90 | 6144 x 3234
|
||||||
|
2.00 | 6144 x 3072
|
||||||
|
2.35 | 6144 x 2614
|
||||||
|
2.37 | 6144 x 2592
|
||||||
|
2.39 | 6144 x 2571
|
||||||
|
2.40 | 6144 x 2560
|
||||||
|
2.44 | 6144 x 2518
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 4K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 2765 x 3456
|
||||||
|
1.25 (5:4) | 4320 x 3456
|
||||||
|
1.33 (4:3) | 4608 x 3456
|
||||||
|
1.66 (5:3) | 5760 x 3456
|
||||||
|
1.78 (16:9) | 6144 x 3456
|
||||||
|
1.85 | 6144 x 3321
|
||||||
|
1.90 | 6144 x 3234
|
||||||
|
2.00 | 6144 x 3072
|
||||||
|
2.35 | 6144 x 2614
|
||||||
|
2.37 | 6144 x 2592
|
||||||
|
2.39 | 6144 x 2571
|
||||||
|
2.40 | 6144 x 2560
|
||||||
|
2.44 | 6144 x 2518
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 3K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 1382 x 1728
|
||||||
|
1.25 (5:4) | 2160 x 1728
|
||||||
|
1.33 (4:3) | 2304 x 1728
|
||||||
|
1.66 (5:3) | 2880 x 1728
|
||||||
|
1.78 (16:9) | 3072 x 1728
|
||||||
|
1.85 | 3072 x 1661
|
||||||
|
1.90 | 3072 x 1620
|
||||||
|
2.00 | 3072 x 1536
|
||||||
|
2.35 | 3072 x 1307
|
||||||
|
2.37 | 3072 x 1296
|
||||||
|
2.39 | 3072 x 1285
|
||||||
|
2.40 | 3072 x 1280
|
||||||
|
2.44 | 3072 x 1259
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 2K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 922 x 1152
|
||||||
|
1.25 (5:4) | 1440 x 1152
|
||||||
|
1.33 (4:3) | 1536 x 1152
|
||||||
|
1.66 (5:3) | 1920 x 1152
|
||||||
|
1.78 (16:9) | 2048 x 1152
|
||||||
|
1.85 | 2048 x 1107
|
||||||
|
1.90 | 2048 x 1078
|
||||||
|
2.00 | 2048 x 1024
|
||||||
|
2.35 | 2048 x 871
|
||||||
|
2.37 | 2048 x 864
|
||||||
|
2.39 | 2048 x 858
|
||||||
|
2.40 | 2048 x 853
|
||||||
|
2.44 | 2048 x 838
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 8K UHD
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 2765 x 3456
|
||||||
|
1.25 (5:4) | 5400 x 3456
|
||||||
|
1.33 (4:3) | 5760 x 3456
|
||||||
|
1.66 (5:3) | 7200 x 3456
|
||||||
|
1.78 (16:9) | 7680 x 4320
|
||||||
|
1.85 | 7680 x 4151
|
||||||
|
1.90 | 7680 x 4042
|
||||||
|
2.00 | 7680 x 3840
|
||||||
|
2.35 | 7680 x 3268
|
||||||
|
2.37 | 7680 x 3240
|
||||||
|
2.39 | 7680 x 3213
|
||||||
|
2.40 | 7680 x 3200
|
||||||
|
2.44 | 7680 x 3148
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 5K
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 2304 x 2880
|
||||||
|
1.25 (5:4) | 3600 x 2880
|
||||||
|
1.33 (4:3) | 3840 x 2880
|
||||||
|
1.66 (5:3) | 4800 x 2880
|
||||||
|
1.78 (16:9) | 5120 x 2880
|
||||||
|
1.85 | 5120 x 2768
|
||||||
|
1.90 | 5120 x 2700
|
||||||
|
2.00 | 5120 x 2560
|
||||||
|
2.35 | 5120 x 2179
|
||||||
|
2.37 | 5120 x 2160
|
||||||
|
2.39 | 5120 x 2142
|
||||||
|
2.40 | 5120 x 2133
|
||||||
|
2.44 | 5120 x 2098
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 4K UHD
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 1728 x 2160
|
||||||
|
1.25 (5:4) | 2700 x 2160
|
||||||
|
1.33 (4:3) | 2880 x 2160
|
||||||
|
1.66 (5:3) | 3600 x 2160
|
||||||
|
1.78 (16:9) | 3840 x 2160
|
||||||
|
1.85 | 3840 x 2076
|
||||||
|
1.90 | 3840 x 2021
|
||||||
|
2.00 | 3840 x 1920
|
||||||
|
2.35 | 3840 x 1634
|
||||||
|
2.37 | 3840 x 1620
|
||||||
|
2.39 | 3840 x 1607
|
||||||
|
2.40 | 3840 x 1600
|
||||||
|
2.44 | 3840 x 1574
|
||||||
|
<!--rehype:className=show-header-->
|
||||||
|
|
||||||
|
### 3K UHD
|
||||||
|
|
||||||
|
纵横比 | 分辨率
|
||||||
|
:-- | --
|
||||||
|
0.80 (4:5) | 1296 x 1620
|
||||||
|
1.25 (5:4) | 2025 x 1620
|
||||||
|
1.33 (4:3) | 2160 x 1620
|
||||||
|
1.66 (5:3) | 2700 x 1620
|
||||||
|
1.78 (16:9) | 2880 x 1620
|
||||||
|
1.85 | 2880 x 1557
|
||||||
|
1.90 | 2880 x 1516
|
||||||
|
2.00 | 2880 x 1440
|
||||||
|
2.35 | 2880 x 1226
|
||||||
|
2.37 | 2880 x 1215
|
||||||
|
2.39 | 2880 x 1205
|
||||||
|
2.40 | 2880 x 1200
|
||||||
|
2.44 | 2880 x 1180
|
||||||
|
<!--rehype:className=show-header-->
|
22
docs/css.md
22
docs/css.md
@@ -1487,6 +1487,7 @@ br + br {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### CSS 重置
|
### CSS 重置
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
```css
|
```css
|
||||||
html {
|
html {
|
||||||
@@ -1501,6 +1502,25 @@ html {
|
|||||||
|
|
||||||
有助于在不同的浏览器之间强制样式一致性,并为样式元素提供干净的盒子
|
有助于在不同的浏览器之间强制样式一致性,并为样式元素提供干净的盒子
|
||||||
|
|
||||||
|
### 设置光标样式
|
||||||
|
|
||||||
|
```css
|
||||||
|
body {
|
||||||
|
caret-color: red;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 设置整个页面灰色
|
||||||
|
<!--rehype:wrap-style=-webkit-filter: grayscale(.95);-->
|
||||||
|
|
||||||
|
```css
|
||||||
|
html {
|
||||||
|
-webkit-filter: grayscale(.95);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
上面示例设置了当前卡片灰色
|
||||||
|
|
||||||
### 使用图像作为光标
|
### 使用图像作为光标
|
||||||
|
|
||||||
```css
|
```css
|
||||||
@@ -1624,7 +1644,7 @@ div {
|
|||||||
|
|
||||||
### 定义容器的长宽比
|
### 定义容器的长宽比
|
||||||
|
|
||||||
```
|
```css
|
||||||
div {
|
div {
|
||||||
aspect-ratio: 1/1
|
aspect-ratio: 1/1
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Electron 备忘清单
|
Electron 备忘清单
|
||||||
====
|
====
|
||||||
|
|
||||||
此快速参考备忘单提供了 Electron v21 API 说明和使用示例。
|
[](https://www.npmjs.com/package/electron)
|
||||||
|
[](https://www.npmjs.com/package/electron)
|
||||||
|
[](https://github.com/electron/electron/network/dependents)
|
||||||
|
[](https://github.com/electron/electron)
|
||||||
|
|
||||||
|
此快速参考备忘单提供了 Electron v21 API 说明和使用示例
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
----
|
----
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Express 备忘清单
|
Express 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
这是用于 Node.js 的快速、不拘一格、极简主义的 Web 框架,包含 [Express.js](http://expressjs.com/) 的 API 参考列表和一些示例。
|
[](https://npmjs.org/package/express)
|
||||||
|
[](https://www.npmjs.com/package/express)
|
||||||
|
[](https://github.com/expressjs/express/network/dependents)
|
||||||
|
[](https://github.com/expressjs/express)
|
||||||
|
|
||||||
|
这是用于 Node.js 的快速、不拘一格、极简主义的 Web 框架,包含 [Express.js](http://expressjs.com/) 的 API 参考列表和一些示例
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
---
|
---
|
||||||
|
@@ -414,7 +414,7 @@ toJSON(job)
|
|||||||
```yml
|
```yml
|
||||||
steps:
|
steps:
|
||||||
...
|
...
|
||||||
- name: The job has succeeded
|
- name: 作业已成功
|
||||||
if: ${{ success() }}
|
if: ${{ success() }}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -423,7 +423,7 @@ steps:
|
|||||||
```yml
|
```yml
|
||||||
steps:
|
steps:
|
||||||
...
|
...
|
||||||
- name: The job has failed
|
- name: 作业失败
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
308
docs/htmx.md
Normal file
308
docs/htmx.md
Normal file
@@ -0,0 +1,308 @@
|
|||||||
|
\</> htmx 备忘清单
|
||||||
|
===
|
||||||
|
|
||||||
|
[](https://npmjs.org/package/htmx.org)
|
||||||
|
[](https://www.npmjs.com/package/htmx.org)
|
||||||
|
[](https://github.com/bigskysoftware/htmx/network/dependents)
|
||||||
|
[](https://github.com/bigskysoftware/htmx)
|
||||||
|
|
||||||
|
适合初学者的综合 [htmx](https://htmx.org/) 备忘清单
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
|
入门
|
||||||
|
---
|
||||||
|
|
||||||
|
### 快速开始
|
||||||
|
|
||||||
|
[htmx](https://htmx.org/) 是 [intercooler.js](http://intercoolerjs.org/) 的继承者
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="https://unpkg.com/htmx.org@1.8.4"></script>
|
||||||
|
<!-- 有一个按钮POST,通过AJAX点击 -->
|
||||||
|
<button hx-post="/clicked" hx-swap="outerHTML">
|
||||||
|
点击我
|
||||||
|
</button>
|
||||||
|
```
|
||||||
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
|
`hx-post` 和 `hx-swap` 属性告诉 `htmx`:
|
||||||
|
|
||||||
|
> 当用户单击此按钮时,向 `/clicked` 发出 `AJAX` 请求,并用响应替换整个按钮
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm install htmx.org
|
||||||
|
```
|
||||||
|
|
||||||
|
安装 `htmx` 将导入添加到您的 `index.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
import 'htmx.org';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 点击编辑提交
|
||||||
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
|
有一个按钮,可以从 `/contacts/1/edit` 获取联系人的编辑 UI
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div hx-target="this" hx-swap="outerHTML">
|
||||||
|
<div><label>名字</label>: Joe</div>
|
||||||
|
<div><label>姓</label>: Blow</div>
|
||||||
|
<div><label>邮箱</label>: joe@blow.com</div>
|
||||||
|
<button hx-get="/contact/1/edit" class="btn btn-primary">
|
||||||
|
点击编辑
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
这将返回一个可用于编辑联系人的表单
|
||||||
|
|
||||||
|
```html
|
||||||
|
<form hx-put="/contact/1" hx-target="this" hx-swap="outerHTML">
|
||||||
|
<div>
|
||||||
|
<label>名字</label>
|
||||||
|
<input type="text" name="firstName" value="Joe">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>姓</label>
|
||||||
|
<input type="text" name="lastName" value="Blow">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>邮箱</label>
|
||||||
|
<input type="email" name="email" value="joe@blow.com">
|
||||||
|
</div>
|
||||||
|
<button class="btn">提交</button>
|
||||||
|
<button class="btn" hx-get="/contact/1">取消</button>
|
||||||
|
</form>
|
||||||
|
```
|
||||||
|
|
||||||
|
表单按照通常的 `REST-ful` 模式将 `PUT` 发回 `/contacts/1`
|
||||||
|
|
||||||
|
### 删除行
|
||||||
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
|
```html
|
||||||
|
<table class="table delete-row-example">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th> <th>Email</th> <th>Status</th> <th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody hx-confirm="Are you sure?" hx-target="closest tr" hx-swap="outerHTML swap:1s">
|
||||||
|
...
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
```
|
||||||
|
|
||||||
|
表体有一个 `hx-confirm` 属性来确认删除动作。 它还将所有按钮的目标设置为最近的 `tr`,即最近的表格行(`hx-target` 继承自 DOM 中的父级)`hx-swap` 中的交换规范表示将整个目标换出并收到响应后等待 1 秒。最后一点是为了让我们可以使用以下 CSS:
|
||||||
|
|
||||||
|
```css
|
||||||
|
tr.htmx-swapping td {
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 1s ease-out;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
在交换/删除之前淡出该行。每行都有一个带有 `hx-delete` 属性的按钮,该属性包含发出 `DELETE` 请求以从服务器中删除该行的 `url`。此请求以空内容响应,表明该行应替换为空内容
|
||||||
|
|
||||||
|
```html
|
||||||
|
<tr>
|
||||||
|
<td>Angie MacDowell</td>
|
||||||
|
<td>angie@macdowell.org</td>
|
||||||
|
<td>Active</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-danger" hx-delete="/contact/1">
|
||||||
|
Delete
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 延迟加载
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div hx-get="/graph" hx-trigger="load">
|
||||||
|
<img
|
||||||
|
alt="正在加载中..."
|
||||||
|
class="htmx-indicator"
|
||||||
|
width="150"
|
||||||
|
src="/img/bars.svg"/>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
当我们加载图表时显示进度指示器。 然后通过稳定的 CSS(`htmx-settling`) 过渡加载图形并逐渐淡入视图
|
||||||
|
|
||||||
|
```css
|
||||||
|
.htmx-settling img {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
transition: opacity 300ms ease-in;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
API 参考
|
||||||
|
---
|
||||||
|
<!--rehype:body-class=cols-2-->
|
||||||
|
|
||||||
|
### 核心属性参考
|
||||||
|
|
||||||
|
属性 | 说明
|
||||||
|
:- | --
|
||||||
|
`hx-boost` | 添加或删除链接和表单的[渐进增强](https://en.wikipedia.org/wiki/Progressive_enhancement)
|
||||||
|
`hx-get` | 向指定的 URL 发出 `GET`
|
||||||
|
`hx-post` | 向指定的 URL 发出 `POST`
|
||||||
|
`hx-push-url` | 将 URL 推入浏览器地址栏,创建一个新的历史条目
|
||||||
|
`hx-select` | 从响应中选择要换入的内容
|
||||||
|
`hx-select-oob` | 从带外(目标以外的某个地方)的响应中选择要换入的内容
|
||||||
|
`hx-swap` | 控制内容的交换方式(`outerHTML`、`beforeEnd`、`afterend`,...)
|
||||||
|
`hx-swap-oob` | 将响应中的内容标记为带外(应该在目标以外的地方交换)
|
||||||
|
`hx-target` | 指定要交换的目标元素
|
||||||
|
`hx-trigger` | 指定触发请求的事件
|
||||||
|
`hx-vals` | 向参数添加值以随请求一起提交(JSON 格式)
|
||||||
|
<!--rehype:className=left-align-->
|
||||||
|
|
||||||
|
使用 htmx 时最常用的属性
|
||||||
|
|
||||||
|
### 附加属性参考
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
属性 | 说明
|
||||||
|
:- | --
|
||||||
|
`hx-confirm` | 在发出请求之前显示一个 `confim()` 对话框
|
||||||
|
`hx-delete` | 向指定的 URL 发出 `DELETE`
|
||||||
|
`hx-disable` | 禁用给定节点和任何子节点的 htmx 处理
|
||||||
|
`hx-disinherit` | 控制和禁用子节点的自动属性继承
|
||||||
|
`hx-encoding` | 更改请求编码类型
|
||||||
|
`hx-ext` | 用于此元素的扩展
|
||||||
|
`hx-headers` | 添加到将与请求一起提交的标头
|
||||||
|
`hx-history-elt` | 在历史导航期间要快照和恢复的元素
|
||||||
|
`hx-include` | 在请求中包含额外数据
|
||||||
|
`hx-indicator` | 在请求期间放置 `htmx-request` 类的元素
|
||||||
|
`hx-params` | 过滤将与请求一起提交的参数
|
||||||
|
`hx-patch` | 向指定的 URL 发出 PATCH
|
||||||
|
`hx-preserve` | 指定在请求之间保持不变的元素
|
||||||
|
`hx-prompt` | 在提交请求之前显示一个 `prompt()`
|
||||||
|
`hx-put` | 向指定的 URL 发出 PUT
|
||||||
|
`hx-replace-url` | 替换浏览器地址栏中的 URL
|
||||||
|
`hx-request` | 配置请求的各个方面
|
||||||
|
`hx-sse` | 已移至分机。 [旧版本的文档](https://htmx.org/attributes/hx-sse)
|
||||||
|
`hx-sync` | 控制不同元素发出的请求如何同步
|
||||||
|
`hx-validate` | 强制元素在请求之前验证自己
|
||||||
|
~~`hx-vars`~~ | 将值动态添加到参数以随请求提交(已弃用,请使用 `hx-vals`)
|
||||||
|
`hx-ws` | 已移至分机。[旧版本的文档](https://htmx.org/attributes/hx-ws)
|
||||||
|
<!--rehype:className=left-align-->
|
||||||
|
|
||||||
|
列出了 htmx 中可用的所有其他属性
|
||||||
|
|
||||||
|
### CSS 类参考
|
||||||
|
|
||||||
|
Class | 说明
|
||||||
|
:- | --
|
||||||
|
`htmx-added` | 在交换之前应用于新的内容,在它被解决之后移除
|
||||||
|
`htmx-indicator` | 一个动态生成的类,当存在 `htmx-request` 类时将切换可见<br /> _(不透明度:`1`)_
|
||||||
|
`htmx-request` | 在请求进行时应用于元素或使用 `hx-indicator` 指定的元素
|
||||||
|
`htmx-settling` | 内容交换后应用于目标,内容确定后删除。<br /> _可以通过 `hx-swap` 修改持续时间_
|
||||||
|
`htmx-swapping` | 在交换任何内容之前应用于目标,在交换之后移除。<br /> _可以通过 `hx-swap` 修改持续时间_
|
||||||
|
|
||||||
|
### 事件参考
|
||||||
|
<!--rehype:wrap-class=row-span-3-->
|
||||||
|
|
||||||
|
事件 | 说明
|
||||||
|
:- | --
|
||||||
|
`htmx:abort` | 将此事件发送到元素以中止请求
|
||||||
|
`htmx:afterOnLoad` | AJAX 请求完成处理成功响应后触发
|
||||||
|
`htmx:afterProcessNode` | 在 htmx 初始化节点后触发
|
||||||
|
`htmx:afterRequest` | AJAX 请求完成后触发
|
||||||
|
`htmx:afterSettle` | DOM 稳定后触发
|
||||||
|
`htmx:afterSwap` | 换入新内容后触发
|
||||||
|
`htmx:beforeOnLoad` | 在任何响应处理发生之前触发
|
||||||
|
`htmx:beforeProcessNode` | 在 htmx 初始化节点之前触发
|
||||||
|
`htmx:beforeRequest` | 在发出 AJAX 请求之前触发
|
||||||
|
`htmx:beforeSwap` | 在交换完成之前触发,允许您配置交换
|
||||||
|
`htmx:beforeSend` | 在发送 ajax 请求之前触发
|
||||||
|
`htmx:configRequest` | 在请求之前触发,允许您自定义参数、标头
|
||||||
|
`htmx:confirm` | 在元素上发生触发器后触发<br /> _允许您取消(或延迟)发出 AJAX 请求_
|
||||||
|
`htmx:historyCacheError` | 在缓存写入期间因错误而触发
|
||||||
|
`htmx:historyCacheMiss` | 在历史子系统中的缓存未命中时触发
|
||||||
|
`htmx:historyCacheMissError` | 远程检索不成功时触发
|
||||||
|
`htmx:historyCacheMissLoad` | 在成功的远程检索时触发
|
||||||
|
`htmx:historyRestore` | 当 htmx 处理历史恢复操作时触发
|
||||||
|
`htmx:beforeHistorySave` | 在内容保存到历史缓存之前触发
|
||||||
|
`htmx:load` | 当新内容添加到 DOM 时触发
|
||||||
|
`htmx:noSSESourceError` | 当元素在其触发器中引用 SSE 事件<br/> _但未定义父 SSE 源时触发_
|
||||||
|
`htmx:onLoadError` | htmx中onLoad处理异常时触发
|
||||||
|
`htmx:oobAfterSwap` | 在交换了一个带元素之后触发
|
||||||
|
`htmx:oobBeforeSwap` | 在带外元素交换完成之前触发,允许您配置交换
|
||||||
|
`htmx:oobErrorNoTarget` | 当带外元素在当前 DOM 中没有匹配的 ID 时触发
|
||||||
|
`htmx:prompt` | 显示提示后触发
|
||||||
|
`htmx:pushedIntoHistory` | 在 url 被推送到历史记录后触发
|
||||||
|
`htmx:responseError` | 当发生 HTTP 响应错误<br/> _(非 200 或 300 响应代码)时触发_
|
||||||
|
`htmx:sendError` | 当网络错误阻止 HTTP 请求发生时触发
|
||||||
|
`htmx:sseError` | 当 SSE 源发生错误时触发
|
||||||
|
`htmx:swapError` | 在交换阶段发生错误时触发
|
||||||
|
`htmx:targetError` | 指定无效目标时触发
|
||||||
|
`htmx:timeout` | 发生请求超时时触发
|
||||||
|
`htmx:validation:validate` | 在验证元素之前触发
|
||||||
|
`htmx:validation:failed` | 当元素验证失败时触发
|
||||||
|
`htmx:validation:halted` | 当请求由于验证错误而停止时触发
|
||||||
|
`htmx:xhr:abort` | 当 `ajax` 请求中止时触发
|
||||||
|
`htmx:xhr:loadend` | `ajax` 请求结束时触发
|
||||||
|
`htmx:xhr:loadstart` | `ajax` 请求开始时触发
|
||||||
|
`htmx:xhr:progress` | 在支持进度事件的 `ajax` 请求期间定期触发
|
||||||
|
|
||||||
|
### JavaScript API 参考
|
||||||
|
|
||||||
|
方法 | 说明
|
||||||
|
:- | --
|
||||||
|
`htmx.addClass()` | 向给定元素添加一个类
|
||||||
|
`htmx.ajax()` | 发出一个 htmx 风格的 ajax 请求
|
||||||
|
`htmx.closest()` | 找到与选择器匹配的给定元素的最近父级
|
||||||
|
`htmx.config` | 保存当前 htmx 配置对象的属性
|
||||||
|
`htmx.createEventSource` | 包含为 htmx 创建 SSE EventSource 对象的函数的属性
|
||||||
|
`htmx.createWebSocket` | 包含为 htmx 创建 WebSocket 对象的函数的属性
|
||||||
|
`htmx.defineExtension()` | 定义一个 htmx 扩展
|
||||||
|
`htmx.find()` | 查找与选择器匹配的单个元素
|
||||||
|
`htmx.findAll()` \| `htmx.findAll(elt, selector)` | 查找与给定选择器匹配的所有元素
|
||||||
|
`htmx.logAll()` | 安装将记录所有 htmx 事件的记录器
|
||||||
|
`htmx.logger` | 设置为当前记录器的属性(默认为空)
|
||||||
|
`htmx.off()` | 从给定元素中删除事件侦听器
|
||||||
|
`htmx.on()` | 在给定元素上创建事件侦听器,并返回它
|
||||||
|
`htmx.onLoad()` | 为 htmx:load 事件添加回调处理程序
|
||||||
|
`htmx.parseInterval()` | 将间隔声明解析为毫秒值
|
||||||
|
`htmx.process()` | 处理给定元素及其子元素,连接任何 htmx 行为
|
||||||
|
`htmx.remove()` | 删除给定的元素
|
||||||
|
`htmx.removeClass()` | 从给定元素中删除一个类
|
||||||
|
`htmx.removeExtension()` | 删除一个 htmx 扩展
|
||||||
|
`htmx.takeClass()` | 从给定元素的其他元素中获取一个类
|
||||||
|
`htmx.toggleClass()` | 从给定元素切换一个类
|
||||||
|
`htmx.trigger()` | 在元素上触发事件
|
||||||
|
`htmx.values()` | 返回与给定元素关联的输入值
|
||||||
|
|
||||||
|
### 请求标头参考
|
||||||
|
|
||||||
|
标头 | 说明
|
||||||
|
:- | --
|
||||||
|
`HX-Boosted` | 表示请求是通过使用 `hx-boost` 的元素发出的
|
||||||
|
`HX-Current-URL` | 浏览器的当前 `URL`
|
||||||
|
`HX-History-Restore-Request` | 如果请求是在本地历史缓存未命中后进行历史恢复,则为 `true`
|
||||||
|
`HX-Prompt` | 用户对 `hx` 提示的响应
|
||||||
|
`HX-Request` | 总是 `true`
|
||||||
|
`HX-Target` | 目标元素的 id(如果存在)
|
||||||
|
`HX-Trigger-Name` | 触发元素的名称(如果存在)
|
||||||
|
`HX-Trigger` | 触发元素的 id(如果存在)
|
||||||
|
|
||||||
|
### 响应标头参考
|
||||||
|
|
||||||
|
标头 | 说明
|
||||||
|
:- | --
|
||||||
|
[`HX-Location`](https://htmx.org/headers/hx-location) | 允许您执行不执行整页重新加载的客户端重定向
|
||||||
|
[`HX-Push-Url`](https://htmx.org/headers/hx-push-url) | 将一个新的 `url` 推入历史堆栈
|
||||||
|
`HX-Redirect` | 可用于将客户端重定向到新位置
|
||||||
|
`HX-Refresh` | 如果设置为 `true`,客户端将完全刷新页面
|
||||||
|
[`HX-Replace-Url`](https://htmx.org/headers/hx-replace-url) | 替换地址栏中的当前 `URL`
|
||||||
|
`HX-Reswap` | 允许您指定如何交换响应<br /> _有关可能的值,请参阅 [`hx-swap`](https://htmx.org/attributes/hx-swap)_
|
||||||
|
`HX-Retarget` | 将内容更新的目标更新为页面上不同元素的 CSS 选择器
|
||||||
|
[`HX-Trigger`](https://htmx.org/headers/hx-trigger) | 允许您触发客户端事件<br /> _请[参阅文档](https://htmx.org/headers/hx-trigger)以获取更多信息_
|
||||||
|
[`HX-Trigger-After-Settle`](https://htmx.org/headers/hx-trigger) | 允许您触发客户端事件<br /> _请[参阅文档](https://htmx.org/headers/hx-trigger)以获取更多信息_
|
||||||
|
[`HX-Trigger-After-Swap`](https://htmx.org/headers/hx-trigger) | 允许您触发客户端事件<br /> _请[参阅文档](https://htmx.org/headers/hx-trigger)以获取更多信息_
|
779
docs/iptables.md
Normal file
779
docs/iptables.md
Normal file
@@ -0,0 +1,779 @@
|
|||||||
|
iptables 备忘清单
|
||||||
|
====
|
||||||
|
|
||||||
|
iptables 是一个配置 Linux 内核 防火墙(opens new window)的命令行工具,是 [netfilter](https://en.wikipedia.org/wiki/Netfilter)(opens new window)项目的一部分。这个快速参考备忘单显示了它的常用命令使用清单
|
||||||
|
|
||||||
|
入门
|
||||||
|
---
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
iptables 使用三个不同的链来允许或阻止流量:输入(input)、输出(output)和转发(forward)
|
||||||
|
|
||||||
|
- 输入(input) —— 此链用于控制传入连接的行为
|
||||||
|
- 输出(output) —— 此链用于传出连接
|
||||||
|
- 转发(forward) —— 这条链用于传入的连接,这些连接实际上不是在本地传递的,比如路由和 NATing
|
||||||
|
|
||||||
|
### 安装 iptables
|
||||||
|
|
||||||
|
CentOS 7 上默认安装了 firewalld 作为防火墙,使用 iptables 建议关闭并禁用 firewalld。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ systemctl stop firewalld
|
||||||
|
$ systemctl disable firewalld
|
||||||
|
```
|
||||||
|
|
||||||
|
安装 iptables
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ yum install -y iptables-services
|
||||||
|
```
|
||||||
|
|
||||||
|
### 服务管理
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ systemctl status iptables # 查看服务状态
|
||||||
|
$ systemctl enable iptables # 启用服务
|
||||||
|
$ systemctl disable iptables # 禁用服务
|
||||||
|
$ systemctl start iptables # 启动服务
|
||||||
|
$ systemctl restart iptables # 重启服务
|
||||||
|
$ systemctl stop iptables # 关闭服务
|
||||||
|
```
|
||||||
|
|
||||||
|
### 命令参数
|
||||||
|
<!--rehype:wrap-class=row-span-3-->
|
||||||
|
|
||||||
|
基本语法:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables(选项)(参数)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
参数 | 作用
|
||||||
|
:- | --
|
||||||
|
`-P` | 设置默认策略: <br/>_iptables -P INPUT (DROP_
|
||||||
|
`-F` | 清空规则链
|
||||||
|
`-L` | 查看规则链
|
||||||
|
`-A` | 在规则链的末尾加入新规则
|
||||||
|
`-I` | `num` 在规则链的头部加入新规则
|
||||||
|
`-D` | `num` 删除某一条规则
|
||||||
|
`-s` | 匹配来源地址 `IP/MASK` <br/>加叹号"!"表示除这个 `IP` 外
|
||||||
|
`-d` | 匹配目标地址
|
||||||
|
`-i` | 网卡名称 匹配从这块网卡流入的数据
|
||||||
|
`-o` | 网卡名称 匹配从这块网卡流出的数据
|
||||||
|
`-p` | 匹配协议,如 tcp,udp,icmp
|
||||||
|
`--dport num` | 匹配目标端口号
|
||||||
|
`--sport num` | 匹配来源端口号
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -t 表名 <-A/I/D/R> 规则链名 [规则号] <-i/o 网卡名> -p 协议名 <-s 源IP/源子网> --sport 源端口 <-d 目标IP/目标子网> --dport 目标端口 -j 动作
|
||||||
|
```
|
||||||
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
|
### 开始配置规则
|
||||||
|
|
||||||
|
默认情况下,所有链都配置为接受规则,因此在强化过程中,建议从拒绝所有配置开始,然后只打开需要的端口:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables --policy INPUT DROP
|
||||||
|
$ iptables --policy OUTPUT DROP
|
||||||
|
$ iptables --policy FORWARD DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 删除/插入规则
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
按链条和编号删除规则
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -D INPUT 10
|
||||||
|
```
|
||||||
|
|
||||||
|
按规范删除规则
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -D INPUT -m conntrack --ctstate INVALID -j DROP
|
||||||
|
```
|
||||||
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
|
刷新所有规则,删除所有链,并接受所有
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -P INPUT ACCEPT
|
||||||
|
$ iptables -P FORWARD ACCEPT
|
||||||
|
$ iptables -P OUTPUT ACCEPT
|
||||||
|
$ iptables -t nat -F
|
||||||
|
$ iptables -t mangle -F
|
||||||
|
$ iptables -F
|
||||||
|
$ iptables -X
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 冲洗所有链
|
||||||
|
$ iptables -F
|
||||||
|
# 刷新单链
|
||||||
|
$ iptables -F INPUT
|
||||||
|
# 插入规则
|
||||||
|
$ iptables -I INPUT 2 -s 202.54.1.2 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 显示规则
|
||||||
|
|
||||||
|
详细打印出所有活动的 `iptables` 规则
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -n -L -v
|
||||||
|
```
|
||||||
|
|
||||||
|
...具有行号的相同输出:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -n -L -v --line-numbers
|
||||||
|
```
|
||||||
|
|
||||||
|
最后,相同的数据输出但与 `INPUT`/`OUTPUT` 链相关:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -L INPUT -n -viptables -L OUTPUT -n -v --line-numbers
|
||||||
|
```
|
||||||
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
|
### 列出特定链的规则
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -L INPUT
|
||||||
|
# 具有规则规范的相同数据:
|
||||||
|
$ iptables -S INPUT
|
||||||
|
# 包含数据包计数的规则列表
|
||||||
|
$ iptables -L INPUT -v
|
||||||
|
```
|
||||||
|
|
||||||
|
### 保存规则
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 在基于 Debian 的系统上
|
||||||
|
$ netfilter-persistent save
|
||||||
|
# 在基于 RedHat 的系统上
|
||||||
|
$ service iptables save
|
||||||
|
```
|
||||||
|
|
||||||
|
iptables 示例
|
||||||
|
---
|
||||||
|
<!--rehype:body-class=cols-2-->
|
||||||
|
|
||||||
|
### 清空当前的所有规则和计数
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -F # 清空所有的防火墙规则
|
||||||
|
$ iptables -X # 删除用户自定义的空链
|
||||||
|
$ iptables -Z # 清空计数
|
||||||
|
```
|
||||||
|
|
||||||
|
### 配置允许 ssh 端口连接
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 22 -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
`22` 为你的 `ssh` 端口, `-s 192.168.1.0/24` 表示允许这个网段的机器来连接,其它网段的 `ip` 地址是登陆不了你的机器的。`-j ACCEPT` 表示接受这样的请求
|
||||||
|
|
||||||
|
### 允许本地回环地址可以正常使用
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -A INPUT -i lo -j ACCEPT
|
||||||
|
# 本地圆环地址就是那个127.0.0.1
|
||||||
|
# 是本机上使用的,它进与出都设置为允许
|
||||||
|
$ iptables -A OUTPUT -o lo -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 设置默认的规则
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 配置默认的不让进
|
||||||
|
$ iptables -P INPUT DROP
|
||||||
|
# 默认的不允许转发
|
||||||
|
$ iptables -P FORWARD DROP
|
||||||
|
# 默认的可以出去
|
||||||
|
$ iptables -P OUTPUT ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 配置白名单
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 允许机房内网机器可以访问
|
||||||
|
$ iptables -A INPUT -p all -s 192.168.1.0/24 -j ACCEPT
|
||||||
|
# 允许机房内网机器可以访问
|
||||||
|
$ iptables -A INPUT -p all -s 192.168.140.0/24 -j ACCEPT
|
||||||
|
# 允许 183.121.3.7 访问本机的3380端口
|
||||||
|
$ iptables -A INPUT -p tcp -s 183.121.3.7 --dport 3380 -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 开启相应的服务端口
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 开启 80 端口,因为web对外都是这个端口
|
||||||
|
$ iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
||||||
|
# 允许被 ping
|
||||||
|
$ iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT
|
||||||
|
# 已经建立的连接得让它进来
|
||||||
|
$ iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 保存规则到配置文件中
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 任何改动之前先备份,请保持这一优秀的习惯
|
||||||
|
$ cp /etc/sysconfig/iptables /etc/sysconfig/iptables.bak
|
||||||
|
$ iptables-save > /etc/sysconfig/iptables
|
||||||
|
$ cat /etc/sysconfig/iptables
|
||||||
|
```
|
||||||
|
|
||||||
|
### 列出已设置的规则
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -L [-t 表名][链名]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
- 四个表名 `raw`,`nat`,`filter`,`mangle`
|
||||||
|
- 五个规则链名 `INPUT`、`OUTPUT`、`FORWARD`、`PREROUTING`、`POSTROUTING`
|
||||||
|
- filter 表包含`INPUT`、`OUTPUT`、`FORWARD`三个规则链
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 列出 nat 上面的所有规则
|
||||||
|
$ iptables -L -t nat
|
||||||
|
# ^ -t 参数指定,必须是 raw, nat,filter,mangle 中的一个
|
||||||
|
# 规则带编号
|
||||||
|
$ iptables -L -t nat --line-numbers
|
||||||
|
$ iptables -L INPUT
|
||||||
|
# 查看,这个列表看起来更详细
|
||||||
|
$ iptables -L -nv
|
||||||
|
```
|
||||||
|
|
||||||
|
### 清除已有规则
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 清空指定链 INPUT 上面的所有规则
|
||||||
|
$ iptables -F INPUT
|
||||||
|
# 删除指定的链,这个链必须没有被其它任何规则引用,
|
||||||
|
# 而且这条上必须没有任何规则
|
||||||
|
$ iptables -X INPUT
|
||||||
|
# 如果没有指定链名,则会删除该表中所有非内置的链
|
||||||
|
# 把指定链,或者表中的所有链上的所有计数器清零
|
||||||
|
$ iptables -Z INPUT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 删除已添加的规则
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 添加一条规则
|
||||||
|
$ iptables -A INPUT -s 192.168.1.5 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
将所有 iptables 以序号标记显示,执行:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -L -n --line-numbers
|
||||||
|
```
|
||||||
|
|
||||||
|
比如要删除 INPUT 里序号为 8 的规则,执行:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -D INPUT 8
|
||||||
|
```
|
||||||
|
|
||||||
|
### 开放指定的端口
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 允许本地回环接口(即运行本机访问本机)
|
||||||
|
$ iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
|
||||||
|
# 允许已建立的或相关连的通行
|
||||||
|
$ iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||||
|
# 允许所有本机向外的访问
|
||||||
|
$ iptables -A OUTPUT -j ACCEPT
|
||||||
|
# 允许访问22端口
|
||||||
|
$ iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
||||||
|
# 允许访问80端口
|
||||||
|
$ iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
||||||
|
# 允许ftp服务的21端口
|
||||||
|
$ iptables -A INPUT -p tcp --dport 21 -j ACCEPT
|
||||||
|
# 允许FTP服务的20端口
|
||||||
|
$ iptables -A INPUT -p tcp --dport 20 -j ACCEPT
|
||||||
|
# 禁止其他未允许的规则访问
|
||||||
|
$ iptables -A INPUT -j reject
|
||||||
|
# 禁止其他未允许的规则访问
|
||||||
|
$ iptables -A FORWARD -j REJECT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 屏蔽 IP
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 屏蔽恶意主机(比如,192.168.0.8
|
||||||
|
$ iptables -A INPUT -p tcp -m tcp -s 192.168.0.8 -j DROP
|
||||||
|
# 屏蔽单个IP的命令
|
||||||
|
$ iptables -I INPUT -s 123.45.6.7 -j DROP
|
||||||
|
# 封整个段即从123.0.0.1到123.255.255.254的命令
|
||||||
|
$ iptables -I INPUT -s 123.0.0.0/8 -j DROP
|
||||||
|
# 封IP段即从123.45.0.1到123.45.255.254的命令
|
||||||
|
$ iptables -I INPUT -s 124.45.0.0/16 -j DROP
|
||||||
|
# 封IP段即从123.45.6.1到123.45.6.254的命令是
|
||||||
|
$ iptables -I INPUT -s 123.45.6.0/24 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 指定数据包出去的网络接口
|
||||||
|
|
||||||
|
只对 OUTPUT,FORWARD,POSTROUTING 三个链起作用。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -A FORWARD -o eth0
|
||||||
|
```
|
||||||
|
|
||||||
|
### 查看已添加的规则
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -L -n -v
|
||||||
|
Chain INPUT (policy DROP 48106 packets, 2690K bytes)
|
||||||
|
pkts bytes target prot opt in out source destination
|
||||||
|
5075 589K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
|
||||||
|
191K 90M ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
|
||||||
|
1499K 133M ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
|
||||||
|
4364K 6351M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
|
||||||
|
6256 327K ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
|
||||||
|
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
|
||||||
|
pkts bytes target prot opt in out source destination
|
||||||
|
Chain OUTPUT (policy ACCEPT 3382K packets, 1819M bytes)
|
||||||
|
pkts bytes target prot opt in out source destination
|
||||||
|
5075 589K ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
|
||||||
|
```
|
||||||
|
|
||||||
|
### 启动网络转发规则
|
||||||
|
|
||||||
|
公网`210.14.67.7`让内网`192.168.188.0/24`上网
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -t nat -A POSTROUTING -s 192.168.188.0/24 -j SNAT --to-source 210.14.67.127
|
||||||
|
```
|
||||||
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
|
### 端口映射
|
||||||
|
|
||||||
|
本机的 2222 端口映射到内网 虚拟机的 22 端口
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -t nat -A PREROUTING -d 210.14.67.127 -p tcp --dport 2222 -j DNAT --to-dest 192.168.188.115:22
|
||||||
|
```
|
||||||
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
|
### 字符串匹配
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
比如,我们要过滤所有 TCP 连接中的字符串`test`,一旦出现它我们就终止这个连接,我们可以这么做:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -A INPUT -p tcp -m string --algo kmp --string "test" -j REJECT --reject-with tcp-reset
|
||||||
|
$ iptables -L
|
||||||
|
# Chain INPUT (policy ACCEPT)
|
||||||
|
# target prot opt source destination
|
||||||
|
# REJECT tcp -- anywhere anywhere STRING match "test" ALGO name kmp TO 65535 reject-with tcp-reset
|
||||||
|
#
|
||||||
|
# Chain FORWARD (policy ACCEPT)
|
||||||
|
# target prot opt source destination
|
||||||
|
#
|
||||||
|
# Chain OUTPUT (policy ACCEPT)
|
||||||
|
# target prot opt source destination
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止 Windows 蠕虫的攻击
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -I INPUT -j DROP -p tcp -s 0.0.0.0/0 -m string --algo kmp --string "cmd.exe"
|
||||||
|
```
|
||||||
|
<!--rehype:className=wrap-text-->
|
||||||
|
|
||||||
|
### 防止 SYN 洪水攻击
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ iptables -A INPUT -p tcp --syn -m limit --limit 5/second -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许环回连接
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i lo -j ACCEPTiptables -A OUTPUT -o lo -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许已建立和相关的传入连接
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许已建立的传出连接
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 内部到外部
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 丢弃无效数据包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止 IP 地址
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -s 192.168.1.10 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止和 IP 地址并拒绝
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -s 192.168.1.10 -j REJECT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止与网络接口的连接
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i eth0 -s 192.168.1.10 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许所有传入的 SSH
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许来自特定 IP 地址或子网的传入 SSH
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许传出 SSH
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A OUTPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A INPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许来自特定 IP 地址或子网的传入 Rsync
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 873 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 873 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许传入 HTTP
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 80 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许传入 HTTPS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 443 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许传入 HTTP 和 HTTPS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp -m multiport --dports 80,443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许来自特定 IP 地址或子网的 MySQL
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 3306 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 3306 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许 MySQL 到特定的网络接口
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i eth1 -p tcp --dport 3306 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -o eth1 -p tcp --sport 3306 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许来自特定 IP 地址或子网的 PostgreSQL
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 5432 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 5432 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许 PostgreSQL 到特定的网络接口
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i eth1 -p tcp --dport 5432 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -o eth1 -p tcp --sport 5432 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止传出 SMTP 邮件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A OUTPUT -p tcp --dport 25 -j REJECT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许所有传入的 SMTP
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 25 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 25 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许所有传入的 IMAP
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 143 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 143 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许所有传入的 IMAPS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 993 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 993 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许所有传入的 POP3
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 110 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 110 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 允许所有传入的 POP3S
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport 995 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
||||||
|
$ iptables -A OUTPUT -p tcp --sport 995 -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 在公共接口上删除专用网络地址
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i eth1 -s 192.168.1.0/24 -j DROP
|
||||||
|
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 将所有传出到 Facebook 网络
|
||||||
|
|
||||||
|
获取 Facebook 作为:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ whois -h v4.whois.cymru.com " -v $(host facebook.com | grep "has address" | cut -d " " -f4)" | tail -n1 | awk '{print $1}'
|
||||||
|
```
|
||||||
|
|
||||||
|
降低:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ for i in $(whois -h whois.radb.net -- '-i origin AS1273' | grep "^route:" | cut -d ":" -f2 | sed -e 's/^[ \t]*//' | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | cut -d ":" -f2 | sed 's/$/;/') ; do iptables -A OUTPUT -s "$i" -j REJECTdone
|
||||||
|
```
|
||||||
|
|
||||||
|
### 记录和丢弃数据包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j LOG --log-prefix "IP_SPOOF A: "
|
||||||
|
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
默认情况下,所有内容都记录到 `/var/log/messages` 文件中:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ tail -f /var/log/messagesgrep --color 'IP SPOOF' /var/log/messages
|
||||||
|
```
|
||||||
|
|
||||||
|
### 记录和丢弃日志条目数量有限的数据包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix "IP_SPOOF A: "
|
||||||
|
$ iptables -A INPUT -i eth1 -s 10.0.0.0/8 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 丢弃或接受来自 Mac 地址的流量
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -m mac --mac-source 00:0F:EA:91:04:08 -j DROP
|
||||||
|
$ iptables -A INPUT -p tcp --destination-port 22 -m mac --mac-source 00:0F:EA:91:04:07 -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止或允许 ICMP Ping 请求
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
|
||||||
|
$ iptables -A INPUT -i eth1 -p icmp --icmp-type echo-request -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用 multiport 指定多个端口
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -i eth0 -p tcp -m state --state NEW -m multiport --dports ssh,smtp,http,https -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用 `random*` 或 `nth*` 进行负载平衡
|
||||||
|
|
||||||
|
```bash
|
||||||
|
_ips=("172.31.250.10" "172.31.250.11" "172.31.250.12" "172.31.250.13")for ip in "${_ips[@]}" ; do iptables -A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m nth --counter 0 --every 4 --packet 0 \ -j DNAT --to-destination ${ip}:80done
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
_ips=("172.31.250.10" "172.31.250.11" "172.31.250.12" "172.31.250.13")for ip in "${_ips[@]}" ; do iptables -A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m random --average 25 \ -j DNAT --to-destination ${ip}:80done
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用 limit 和 `iplimit*` 限制连接数
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A FORWARD -m state --state NEW -p tcp -m multiport --dport http,https -o eth0 -i eth1 -m limit --limit 20/hour --limit-burst 5 -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp -m state --state NEW --dport http -m iplimit --iplimit-above 5 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 维护要匹配的最近连接列表
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A FORWARD -m recent --name portscan --rcheck --seconds 100 -j DROPiptables -A FORWARD -p tcp -i eth0 --dport 443 -m recent --name portscan --set -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 匹配数据包数据负载中的 “string*”
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A FORWARD -m string --string '.com' -j DROP
|
||||||
|
$ iptables -A FORWARD -m string --string '.exe' -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 带有“时间*”的基于时间的规则
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A FORWARD -p tcp -m multiport --dport http,https -o eth0 -i eth1 -m time --timestart 21:30 --timestop 22:30 --days Mon,Tue,Wed,Thu,Fri -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 基于 TTL 值的数据包匹配
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -s 1.2.3.4 -m ttl --ttl-lt 40 -j REJECT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 防止端口扫描
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -N port-scanningiptables -A port-scanning -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s --limit-burst 2 -j RETURNiptables -A port-scanning -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### SSH 暴力破解保护
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --setiptables -A INPUT -p tcp --dport ssh -m conntrack --ctstate NEW -m recent --update --seconds 60 --hitcount 10 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 同步泛洪保护
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -N syn_floodiptables -A INPUT -p tcp --syn -j syn_floodiptables -A syn_flood -m limit --limit 1/s --limit-burst 3 -j RETURN
|
||||||
|
$ iptables -A syn_flood -j DROPiptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j ACCEPT
|
||||||
|
$ iptables -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j LOG --log-prefix PING-DROP:
|
||||||
|
$ iptables -A INPUT -p icmp -j DROPiptables -A OUTPUT -p icmp -j ACCEPT
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用 SYNPROXY 缓解 SYN 泛洪
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -t raw -A PREROUTING -p tcp -m tcp --syn -j CT --notrack
|
||||||
|
$ iptables -A INPUT -p tcp -m tcp -m conntrack --ctstate INVALID,UNTRACKED -j SYNPROXY --sack-perm --timestamp --wscale 7 --mss 1460
|
||||||
|
$ iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止非 SYN 的新数据包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
或
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 强制碎片数据包检查
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -f -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### XMAS 包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 丢弃所有 NULL 数据包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止不常见的 MSS 值
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止带有虚假 TCP 标志的数据包
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,RST FIN,RST -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags FIN,ACK FIN -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,URG URG -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,FIN FIN -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ACK,PSH PSH -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL ALL -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL NONE -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL FIN,PSH,URG -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,FIN,PSH,URG -j DROP
|
||||||
|
$ iptables -t mangle -A PREROUTING -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
### 阻止来自私有子网的数据包(欺骗)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
_subnets=("224.0.0.0/3" "169.254.0.0/16" "172.16.0.0/12" "192.0.2.0/24" "192.168.0.0/16" "10.0.0.0/8" "0.0.0.0/8" "240.0.0.0/5")for _sub in "${_subnets[@]}" ; do iptables -t mangle -A PREROUTING -s "$_sub" -j DROPdoneiptables -t mangle -A PREROUTING -s 127.0.0.0/8 ! -i lo -j DROP
|
||||||
|
```
|
||||||
|
|
||||||
|
另见
|
||||||
|
---
|
||||||
|
|
||||||
|
- [Iptables 应用](https://dunwu.github.io/linux-tutorial/linux/ops/iptables.html)
|
||||||
|
- [netfilter 官网](https://netfilter.org/)
|
112
docs/jest.md
112
docs/jest.md
@@ -1,7 +1,13 @@
|
|||||||
Jest 备忘清单
|
Jest 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
Jest 是一款优雅、简洁的 JavaScript 测试框架,这里介绍了它的入门和 一些 API 的索引。
|
[](https://www.npmjs.com/package/jest)
|
||||||
|
[](https://www.npmjs.com/package/jest)
|
||||||
|
[](https://github.com/facebook/jest/network/dependents)
|
||||||
|
[](https://github.com/facebook/jest)
|
||||||
|
|
||||||
|
Jest 是一款优雅、简洁的 JavaScript 测试框架,这里介绍了它的入门和 一些 API 的索引
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
----
|
----
|
||||||
@@ -41,6 +47,37 @@ npm test -- --watch
|
|||||||
|
|
||||||
查看: [Getting started](https://jestjs.io/docs/getting-started)
|
查看: [Getting started](https://jestjs.io/docs/getting-started)
|
||||||
|
|
||||||
|
### 常用命令
|
||||||
|
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 指定测试文件的名称
|
||||||
|
$ jest my-test
|
||||||
|
# 指定测试文件的路径
|
||||||
|
$ jest path/to/my-test.js
|
||||||
|
# 仅运行在 hg/git 上有改动但尚未提交的文件
|
||||||
|
$ jest -o
|
||||||
|
# 仅运行与 fileA.js 和 fileB.js相关的测试
|
||||||
|
$ jest --findRelatedTests fileA.js fileB.js
|
||||||
|
# 仅运行匹配特定名称的测试用例
|
||||||
|
$ jest -t name-of-spec
|
||||||
|
# 运行监视模式默认执行 jest -o 监视有改动的测试
|
||||||
|
$ jest --watch
|
||||||
|
$ jest --watchAll # 监视所有测试
|
||||||
|
```
|
||||||
|
|
||||||
|
### 支持驼峰和串式命名的参数
|
||||||
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 下面给出的命令执行的结果是一样的:
|
||||||
|
$ jest --collect-coverage
|
||||||
|
$ jest --collectCoverage
|
||||||
|
# 不同命名形式的参数还可以混用,如:
|
||||||
|
$ jest --update-snapshot \
|
||||||
|
--detectOpenHandles
|
||||||
|
```
|
||||||
|
|
||||||
### 编写测试
|
### 编写测试
|
||||||
<!--rehype:wrap-class=col-span-2-->
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
@@ -884,6 +921,79 @@ test('第二个文本', () => {
|
|||||||
|
|
||||||
`Node.js` 和 `Jest` 会缓存你需要的模块。 要测试具有副作用的模块,您需要在测试之间重置模块注册表
|
`Node.js` 和 `Jest` 会缓存你需要的模块。 要测试具有副作用的模块,您需要在测试之间重置模块注册表
|
||||||
|
|
||||||
|
命令参数参考
|
||||||
|
---
|
||||||
|
<!--rehype:body-class=cols-1-->
|
||||||
|
|
||||||
|
### 命令参数
|
||||||
|
|
||||||
|
:-- | --
|
||||||
|
:-- | --
|
||||||
|
`--bail[=<n>]`, `-b` | 在 `n` 个测试套件失败后立即退出测试套件
|
||||||
|
`--cache` | 是否使用缓存
|
||||||
|
`--changedFilesWithAncestor` | 运行与当前更改和上次提交中所做更改相关的测试
|
||||||
|
`--changedSince` | 运行与自提供的分支或提交哈希以来的更改相关的测试
|
||||||
|
`--ci` | 指定该参数时,`Jest` 会认为正在 `CI` 环境上运行
|
||||||
|
`--clearCache` | 删除 `Jest` 的缓存目录, 然后不运行测试直接退出
|
||||||
|
`--clearMocks` | 在每次测试前自动清除模拟的上下文
|
||||||
|
`--collectCoverageFrom=<glob>` | 相对于 `rootDir` 的 `glob` 模式匹配需要从中收集覆盖信息的文件
|
||||||
|
`--colors` | 即便 `stdout` 不是 `TTY` 模式,也要强制高亮显示测试结果
|
||||||
|
`--config=<path>` | 指定配置文件的路径
|
||||||
|
`--coverage[=<boolean>]`, `--collectCoverage` | 将测试覆盖率信息输出为报告
|
||||||
|
`--coverageProvider=<provider>` | 指示应该使用哪个提供程序来检测代码的覆盖率
|
||||||
|
`--debug` | 打印关于 `Jest` 配置的调试信息
|
||||||
|
`--detectOpenHandles` | 尝试收集并打印打开的句柄以防止 `Jest` 干净地退出
|
||||||
|
`--env=<environment>` | 所有测试都使用该测试环境设定
|
||||||
|
`--errorOnDeprecated` | 使调用已弃用的 `API` 抛出有用的错误消息
|
||||||
|
`--expand`, `-e` | 使用该参数来对比完整的差异和错误,而非修复
|
||||||
|
`--filter=<file>` | 导出过滤功能的模块的路径
|
||||||
|
`--findRelatedTests <spaceSeparatedListOfSourceFiles>` | 查找并运行涵盖作为参数传入的以空格分隔的源文件列表的测试
|
||||||
|
`--forceExit` | 强制 `Jest` 在所有测试运行完后退出
|
||||||
|
`--help` | 显示帮助信息,类似于本页文档
|
||||||
|
`--ignoreProjects <project1> ... <projectN>` | 忽略特定的测试项目
|
||||||
|
`--init` | 生成一个基础配置文件
|
||||||
|
`--injectGlobals` | 将全局变量(`expect`,`test`,`describe`,`beforeEach`等)插入到全局环境中
|
||||||
|
`--json` | 以 `JSON` 模式显示测试结果
|
||||||
|
`--lastCommit` | 运行受上次提交中的文件更改影响的所有测试
|
||||||
|
`--listTests` | 以 `JSON` 数组的形式列出所有将要运行的测试并退出
|
||||||
|
`--logHeapUsage` | 记录每个测试后的记录堆使用情况
|
||||||
|
`--maxConcurrency=<num>` | 防止 `Jest` 同时执行超过指定数量的测试
|
||||||
|
`--maxWorkers=<num>\|<string>` | 设定运行测试的最大工作池数目
|
||||||
|
`--noStackTrace` | 禁止栈跟踪信息在测试结果输出中
|
||||||
|
`--notify` | 激活测试结果通知
|
||||||
|
`--onlyChanged` `-o` | 尝试确定根据当前存储库中哪些已经更改的文件来运行的测试
|
||||||
|
`--outputFile=<filename>` | 通过 `——json` 参数可以将测试结果写入到指定文件
|
||||||
|
`--passWithNoTests` | 允许在没有找到文件的情况下通过测试
|
||||||
|
`--projects <path1> ... <pathN>` | 从指定路径中找到的一个或多个项目运行测试;也采用路径 `globs`
|
||||||
|
`--reporters` | 使用指定的记者进行测试
|
||||||
|
`--resetMocks` | 每次测试前自动重置模拟状态
|
||||||
|
`--restoreMocks` | 在每次测试前自动恢复模拟状态和实现
|
||||||
|
`--roots` | `Jest` 应该用来搜索文件的目录路径列表
|
||||||
|
`--runInBand`, `-i` | 仅在当前的进程中连续运行所有测试,而非通过创建的子进程的工作池来运行测试
|
||||||
|
`--runTestsByPath` | 仅运行使用其确切路径指定的测试
|
||||||
|
`--selectProjects <project1> ... <projectN>` | 运行指定的测试项目
|
||||||
|
`--setupFilesAfterEnv <path1> ... <pathN>` | 运行某些代码以在每次测试之前配置或设置测试框架的模块的路径列表
|
||||||
|
`--shard` | 测试套件分片以 `(?<shardIndex>\d+)/(?<shardCount>\d+)` 的格式执行
|
||||||
|
`--showConfig` | 输出 `Jest` 配置,然后退出
|
||||||
|
`--silent` | 阻止所有测试通过控制台输出信息
|
||||||
|
`--testEnvironmentOptions=<json string>` | 带有将传递给 `testEnvironment` 的选项的 `JSON` 字符串
|
||||||
|
`--testLocationInResults` | 向测试结果添加 `location` 字段
|
||||||
|
`--testMatch glob1 ... globN` | `Jest` 用于检测测试文件的 `glob` 模式
|
||||||
|
`--testNamePattern=<regex>`, `-t` | 仅运行名称与正则表达式匹配的测试
|
||||||
|
`--testPathIgnorePatterns=<regex>\|[array]` | 在执行测试之前针对所有测试路径进行测试的单个或一组正则表达式模式字符串
|
||||||
|
`--testPathPattern=<regex>` | 在运行测试前,匹配的 `regexp` 模式字符串的测试文件路径
|
||||||
|
`--testRunner=<path>` | 允许你指定自定义测试运行程序
|
||||||
|
`--testSequencer=<path>` | 允许您指定自定义测试定序器
|
||||||
|
`--testTimeout=<number>` | 测试的默认超时时间(以毫秒为单位)。默认值:`5000`
|
||||||
|
`--updateSnapshot`, `-u` | 在运行测试中使用这个参数来重新录制每个失败测试的快照
|
||||||
|
`--useStderr` | 转移所有输出到 `stderr` (标准错误输出)
|
||||||
|
`--verbose` | 层次显示测试套件中每个测试的结果
|
||||||
|
`--version`, `-v` | 打印版本并退出
|
||||||
|
`--watch` | 监视文件更改,并重新运行与已更改的文件相关的测试
|
||||||
|
`--watchAll` | 监视文件的更改并在任何更改时重新运行所有测试
|
||||||
|
`--watchman` | 是否使用 `watchman` 进行文件爬取。 默认为 `true`
|
||||||
|
<!--rehype:className=left-align-->
|
||||||
|
|
||||||
另见
|
另见
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Koajs 备忘清单
|
Koajs 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
基于 Node.js 平台的下一代 web 开发框架,包含 [Koa](https://koajs.com/) 的 API 参考列表和一些示例。
|
[](https://npmjs.org/package/koa)
|
||||||
|
[](https://www.npmjs.com/package/koa)
|
||||||
|
[](https://github.com/koajs/koa/network/dependents)
|
||||||
|
[](https://github.com/koajs/koa)
|
||||||
|
|
||||||
|
基于 Node.js 平台的下一代 web 开发框架,包含 [Koa](https://koajs.com/) 的 API 参考列表和一些示例
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
---
|
---
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Lerna 备忘清单
|
Lerna 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
本备忘单旨在快速理解 [Lerna v6](https://github.com/lerna/lerna) 所涉及的主要概念,显示了它的常用命令使用清单。
|
[](https://www.npmjs.com/package/lerna)
|
||||||
|
[](https://www.npmjs.com/package/lerna)
|
||||||
|
[](https://github.com/lerna/lerna/nest/network/dependents)
|
||||||
|
[](https://github.com/lerna/lerna/nest)
|
||||||
|
|
||||||
|
本备忘单旨在快速理解 [Lerna v6](https://github.com/lerna/lerna) 所涉及的主要概念,显示了它的常用命令使用清单
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
----
|
----
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Less 备忘清单
|
Less 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
本备忘单旨在快速理解 [Less](https://github.com/less/less.js) 所涉及的主要概念,显示了它的常用方法使用清单。
|
[](https://npmjs.org/package/less)
|
||||||
|
[](https://www.npmjs.com/package/less)
|
||||||
|
[](https://github.com/less/less.js/network/dependents)
|
||||||
|
[](https://github.com/less/less.js)
|
||||||
|
|
||||||
|
本备忘单旨在快速理解 [Less](https://github.com/less/less.js) 所涉及的主要概念,显示了它的常用方法使用清单
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
---
|
---
|
||||||
|
543
docs/make.md
Normal file
543
docs/make.md
Normal file
@@ -0,0 +1,543 @@
|
|||||||
|
make 备忘清单
|
||||||
|
===
|
||||||
|
|
||||||
|
包含 最重要概念、函数、方法等的 make 备忘单。 初学者的完整快速参考。
|
||||||
|
|
||||||
|
Makefile 入门
|
||||||
|
---
|
||||||
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
|
||||||
|
### 示例
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
a.txt: b.txt c.txt
|
||||||
|
cat b.txt c.txt > a.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 工作流程
|
||||||
|
|
||||||
|
* 读入所有的 `Makefile`。
|
||||||
|
* 读入被 `include` 的其它 `Makefile`。
|
||||||
|
* 初始化文件中的变量。
|
||||||
|
* 推导隐晦规则,并分析所有规则。
|
||||||
|
* 为所有的目标文件创建依赖关系链。
|
||||||
|
* 根据依赖关系,决定哪些目标要重新生成。
|
||||||
|
* 执行生成命令。
|
||||||
|
|
||||||
|
<!--rehype:className=style-timeline-->
|
||||||
|
|
||||||
|
### 文件命令
|
||||||
|
|
||||||
|
文件会以 `GNUmakefile`(不推荐使用)、`Makefile`、`makefile` 查找目录下的名称。
|
||||||
|
|
||||||
|
#### 自定义文件名称
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make target -f NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
我们可以使用 `-f NAME` 来指定需要编译的文件名
|
||||||
|
|
||||||
|
#### 隐式生成
|
||||||
|
|
||||||
|
如果文件夹中没有 makefile 文件,只有 main.c 源文件,那么我们可以使用 `make main.o` 隐式生成链接文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make main.o
|
||||||
|
# 实际执行: cc -c -o main.o main.c
|
||||||
|
```
|
||||||
|
|
||||||
|
### 规则
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
TARGET: PREREQUISITES
|
||||||
|
COMMAMD
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
* `target`: 规则的目标。目标可以是规则的动作(如 `clean` 等),也可以是目标文件或者最后的可执行文件。
|
||||||
|
* `prerequisites`: 规则的依赖。生成规则目标文件所需要的文件名列表(通常一个目标依赖于一个或者多个文件)。
|
||||||
|
* `command`: 规则的命令行。规则要执行的动作(任意的 shell 命令或者在 shell 下执行的程序)。<span style="color:red">命令需要以 tab 键开头</span>
|
||||||
|
<!--rehype:className=style-round-->
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make [TARGET ...]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make # 没有参数首先运行 TARGET
|
||||||
|
$ make help # 显示可用目标
|
||||||
|
$ make dist # 从当前目录制作一个发布存档
|
||||||
|
$ make check # 无需安装的单元测试
|
||||||
|
```
|
||||||
|
|
||||||
|
### 清空目标文件
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm *.o temp
|
||||||
|
```
|
||||||
|
|
||||||
|
`.PHONY` 内置命令将排除 clean 文件,不会因为当前目录中因为有 clean 文件而不会不执行 clean 伪目标
|
||||||
|
|
||||||
|
<span style="color:red">clean 从来都是放在文件的最后</span>
|
||||||
|
|
||||||
|
<!--rehype:className=auto-wrap-->
|
||||||
|
|
||||||
|
### 注释
|
||||||
|
|
||||||
|
makefile 文件的注释与 bash 脚本一致
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
# 这是一个注释
|
||||||
|
main.o : main.c
|
||||||
|
cc -c main.c
|
||||||
|
```
|
||||||
|
|
||||||
|
### 换行 `\`
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
# 这是一个注释
|
||||||
|
main.o : main.c
|
||||||
|
cc -c \
|
||||||
|
main.c
|
||||||
|
```
|
||||||
|
|
||||||
|
### 引用其它的 Makefile
|
||||||
|
|
||||||
|
`include` 关键字可以把别的 Makefile 包含进来。这样使用 make 运行的时候就会
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
# makefile
|
||||||
|
include foo.make
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你想让 make 不理那些无法读取的文件,并且继续执行。
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
-include <filename>
|
||||||
|
```
|
||||||
|
|
||||||
|
变量
|
||||||
|
---
|
||||||
|
|
||||||
|
### 赋值符
|
||||||
|
|
||||||
|
#### 在执行时扩展,允许递归扩展
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
VARIABLE = value
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 在声明时扩展
|
||||||
|
|
||||||
|
可以防止递归,并且只能引用之前声明过的变量
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
VARIABLE := value
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 只有在该变量为空时才设置值
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
VARIABLE ?= value
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 将值追加到变量的尾端
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
VARIABLE += value
|
||||||
|
```
|
||||||
|
|
||||||
|
#### override
|
||||||
|
|
||||||
|
如果变量前不指定 `override`,那么命令行中指定的变量可以对 Makefile 中的变量重新定义。
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
# 不会重新定义
|
||||||
|
override VARIABLE = value
|
||||||
|
override VARIABLE := value
|
||||||
|
override VARIABLE ?= value
|
||||||
|
override VARIABLE += value
|
||||||
|
override define
|
||||||
|
#...
|
||||||
|
endef
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--rehype:className=auto-wrap-->
|
||||||
|
|
||||||
|
### 变量
|
||||||
|
|
||||||
|
需要使用 `$()` 或者 `${}` 对变量进行引用
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
file = main.c
|
||||||
|
|
||||||
|
run:
|
||||||
|
clang -o hello ${file}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 避免递归变量
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
# 这样会使变量陷入无穷递归
|
||||||
|
A = $(B)
|
||||||
|
B = $(A)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
x := foo
|
||||||
|
y := $(x) bar
|
||||||
|
x := later
|
||||||
|
|
||||||
|
# 等价于
|
||||||
|
# x = later
|
||||||
|
# y = foo bar
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Shell 变量
|
||||||
|
|
||||||
|
如果要使用 Shell 变量,需要在之前加上 `$`
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
run:
|
||||||
|
echo $$HOME
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 定义多行变量
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
define foo
|
||||||
|
echo foo
|
||||||
|
echo bar
|
||||||
|
endef
|
||||||
|
|
||||||
|
run:
|
||||||
|
${foo}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 自动变量
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
#### `$@`
|
||||||
|
|
||||||
|
`$@`:指代当前目标,即 Make 命令当前构建的那个目标
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
foo:
|
||||||
|
touch $@
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make foo
|
||||||
|
# $@ 就是指的这里的 foo
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `$<`
|
||||||
|
|
||||||
|
`$<` 指代第一个前置条件。比如,规则为 t: p1 p2,那么 `$<` 就指代 p1
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
a.md: b.md c.md
|
||||||
|
cp $< $@
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
使用 `make a.md`,相当于以下写法
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
a.md: b.md c.md
|
||||||
|
cp b.md a.md
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `$^`
|
||||||
|
|
||||||
|
`$^` 指代所有的前置条件,去除重复项
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
a.md: b.md c.md
|
||||||
|
echo $^
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `$+`
|
||||||
|
|
||||||
|
`$^` 指代所有的前置条件,不会去除重复项
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
a.md: b.md c.md c.md
|
||||||
|
echo $+
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `$?`
|
||||||
|
|
||||||
|
`$?` 指代更新的依赖,只有最近更新过的依赖才会引用
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
a.md: b.md c.md c.md
|
||||||
|
cat $? > a.md
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `$*`
|
||||||
|
|
||||||
|
`$*` 指代匹配符匹配的部分
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
main.o: main.c
|
||||||
|
clang -o $* $*.c
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make main
|
||||||
|
# 此时 cc main.c -o main
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `$%`
|
||||||
|
|
||||||
|
`$%`: 仅当目标是函数库文件中,表示规则中的目标成员名
|
||||||
|
|
||||||
|
* windows 中是 `.lib` 文件
|
||||||
|
* unix 中是 `.a` 文件
|
||||||
|
|
||||||
|
<!--rehype:className=style-round-->
|
||||||
|
|
||||||
|
### 内置命名变量的参数
|
||||||
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
|
这些变量都是相关下面的命令的参数。如果没有指明其默认值,那么其默认值都是空。
|
||||||
|
|
||||||
|
:- | :-
|
||||||
|
:- | :-
|
||||||
|
`ARFLAGS` | 函数库打包程序AR命令的参数。默认值是 `rv`
|
||||||
|
`ASFLAGS` | 汇编语言编译器参数。(当明显地调用 `.s` 或 `.S` 文件时)
|
||||||
|
`CFLAGS` | C 语言编译器参数。
|
||||||
|
`CXXFLAGS` | C++ 语言编译器参数。
|
||||||
|
`COFLAGS` | RCS 命令参数。
|
||||||
|
`CPPFLAGS` | C 预处理器参数。( `C` 和 `Fortran` 编译器也会用到)。
|
||||||
|
`FFLAGS` | Fortran 语言编译器参数。
|
||||||
|
`GFLAGS` | SCCS `get` 程序参数。
|
||||||
|
`LDFLAGS` | 链接器参数。(如:`ld` )
|
||||||
|
`PFLAGS` | Pascal 语言编译器参数。
|
||||||
|
`LFLAGS` | Lex 文法分析器参数。
|
||||||
|
`RFLAGS` | Ratfor 程序的 Fortran 编译器参数。
|
||||||
|
`YFLAGS` | Yacc 文法分析器参数。
|
||||||
|
<!--rehype:className=left-align-->
|
||||||
|
|
||||||
|
### 内置已命名的变量
|
||||||
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
|
:- | :-
|
||||||
|
:- | :-
|
||||||
|
`AR` | 函数库打包程序。默认命令是 `ar`
|
||||||
|
`AS` | 汇编语言编译程序。默认命令是 `as`
|
||||||
|
`CC` | C 语言编译程序。默认命令是 `cc`
|
||||||
|
`CXX` | C++ 语言编译程序。默认命令是 `g++`
|
||||||
|
`CO` | 从 RCS 文件中扩展文件程序。默认命令是 `co`
|
||||||
|
`CPP` | C 程序的预处理器(输出是标准输出设备)。默认命令是 `$(CC) –E`
|
||||||
|
`FC` | Fortran 和 Ratfor 的编译器和预处理程序。默认命令是 `f77`
|
||||||
|
`GET` | 从 SCCS 文件中扩展文件的程序。默认命令是 `get`
|
||||||
|
`LEX` | Lex 方法分析器程序(针对于 C 或 Ratfor)。默认命令是 `lex`
|
||||||
|
`PC` | Pascal 语言编译程序。默认命令是 `pc`
|
||||||
|
`YACC` | Yacc 文法分析器(针对于 C 程序)。默认命令是 `yacc`
|
||||||
|
`YACCR` | Yacc 文法分析器(针对于 Ratfor 程序)。默认命令是 `yacc –r`
|
||||||
|
`MAKEINFO` | 转换 Texinfo 源文件(.texi)到 Info 文件程序。默认命令是 `makeinfo`
|
||||||
|
`TEX` | 从 TeX 源文件创建TeX DVI文件的程序。默认命令是 `tex`
|
||||||
|
`TEXI2DVI` | 从 Texinfo 源文件创建 TeX DVI 文件的程序。默认命令是 `texi2dvi`
|
||||||
|
`WEAVE` | 转换 Web 到 TeX 的程序。默认命令是 `weave`
|
||||||
|
`CWEAVE` | 转换 C Web 到 TeX 的程序。默认命令是 `cweave`
|
||||||
|
`TANGLE` | 转换 Web 到 Pascal 语言的程序。默认命令是 `tangle`
|
||||||
|
`CTANGLE` | 转换 C Web 到 C。默认命令是 `ctangle`
|
||||||
|
`RM` | 删除文件命令。默认命令是 `rm –f`
|
||||||
|
<!--rehype:className=left-align-->
|
||||||
|
|
||||||
|
#### 内置的变量
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
run:
|
||||||
|
${CC} -o main main.c
|
||||||
|
```
|
||||||
|
|
||||||
|
书写规则
|
||||||
|
---
|
||||||
|
|
||||||
|
### 通配符
|
||||||
|
|
||||||
|
#### `*`
|
||||||
|
|
||||||
|
`*`:与 linux 系统下的一样
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
# 清除所有 .o 结尾的文件
|
||||||
|
clean:
|
||||||
|
rm -f *.o
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `~`
|
||||||
|
|
||||||
|
`~`:在 linux 或 mac 下表示用户目录,win 下表示 `HOME` 环境变量
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
run:
|
||||||
|
ls ~
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `?`
|
||||||
|
|
||||||
|
`?`: 与在 linux 等类似,可以匹配单个字符
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
run:
|
||||||
|
ls -ll packag?.json
|
||||||
|
```
|
||||||
|
|
||||||
|
### 文件搜寻(`vpath`)
|
||||||
|
|
||||||
|
如果没有指定 vpath 变量,make 只会在当前的目录中去寻找依赖文件和目标文件。否则,如果当前目录没有,就会到指定的目录中去寻找
|
||||||
|
|
||||||
|
:- | :-
|
||||||
|
:- | :-
|
||||||
|
`vpath <pattern> <directories>` | 为符合模式 \<pattern> 的文件指定搜索目录 \<directories>
|
||||||
|
`vpath <pattern>` | 清除符合模式<pattern>的文件的搜索目录。
|
||||||
|
`vpath` | 清除所有已被设置好了的文件搜索目录
|
||||||
|
|
||||||
|
#### `%`
|
||||||
|
|
||||||
|
* vpath使用方法中的 \<pattern> 需要包含 `%` 字符。
|
||||||
|
* `%` 的意思是匹配零或若干字符
|
||||||
|
* 并且引用规则是需要使用**自动变量**
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
vpath %.c dist
|
||||||
|
TARGET = hello
|
||||||
|
OBJ = bar.o foo.o
|
||||||
|
|
||||||
|
$(TARGET): $(OBJ)
|
||||||
|
$(CC) -o $@ $^
|
||||||
|
|
||||||
|
%.o: $.c
|
||||||
|
$(CC) -o $< -o #@
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--rehype:className=auto-wrap-->
|
||||||
|
|
||||||
|
### 静态模式
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
TARGET: PREREQUISITES :PREREQUISITES
|
||||||
|
COMMAMD
|
||||||
|
#...
|
||||||
|
```
|
||||||
|
|
||||||
|
* `target` 定义了一系列的目标文件
|
||||||
|
* 第一个 `prerequisites` 是指明了 target 的模式,也就是的目标集模式。
|
||||||
|
* 第二个 `prerequisites` 是目标的依赖模式,它对第一个 `prerequisites` 形成的模式再进行一次依赖目标的定义
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
objects = foo.o main.o
|
||||||
|
|
||||||
|
$(objects): %.o: %.c
|
||||||
|
$(CC) -c $(CFLAGS) $< -o $@
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
相当于:
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
foo.o : foo.c
|
||||||
|
$(CC) -c $(CFLAGS) foo.c -o foo.o
|
||||||
|
main.o : main.c
|
||||||
|
$(CC) -c $(CFLAGS) main.c -o main.o
|
||||||
|
```
|
||||||
|
|
||||||
|
### 伪目标
|
||||||
|
|
||||||
|
* **伪目标**并不是一个文件,只是一个标签。只有通过显式地指明这个**目标**才能让其生效
|
||||||
|
* 使用 `.PHONY` 来显式地指明目标是 `伪目标`
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
.PHONY : clean
|
||||||
|
clean :
|
||||||
|
rm *.o temp
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--rehype:className=style-round-->
|
||||||
|
<!--rehype:className=auto-wrap-->
|
||||||
|
|
||||||
|
命令
|
||||||
|
---
|
||||||
|
|
||||||
|
### 回声(`@`)
|
||||||
|
|
||||||
|
正常情况下,make会打印每条命令,然后再执行,这就叫做回声(echoing)
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
all:
|
||||||
|
# 会有命令执行显示
|
||||||
|
echo Hello, world
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
all:
|
||||||
|
# 不会有命令执行的显示
|
||||||
|
@echo Hello, world
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--rehype:className=auto-wrap-->
|
||||||
|
|
||||||
|
### 显示命令、禁止命令
|
||||||
|
|
||||||
|
#### 显示命令
|
||||||
|
|
||||||
|
如果我们只希望显示命令,而不希望执行命令,可以使用 `-n` 或者 `--just-print`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make all --just-print
|
||||||
|
$ make all -n
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 禁止命令
|
||||||
|
|
||||||
|
`-s` 或 `--silent` 或 `--quiet` 与 `@` 一样,用于禁止回声
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make all -s
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--rehype:className=auto-wrap-->
|
||||||
|
|
||||||
|
### 执行命令
|
||||||
|
|
||||||
|
使用 tab 及换行
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
exec:
|
||||||
|
cd /home/hchen
|
||||||
|
pwd
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
使用 `;`
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
exec:
|
||||||
|
cd /home/hchen; pwd
|
||||||
|
```
|
||||||
|
|
||||||
|
另见
|
||||||
|
---
|
||||||
|
|
||||||
|
* [make 中文教程](https://seisman.github.io/how-to-write-makefile/overview.html) _(seisman.github.io)_
|
||||||
|
* [make 手册](https://www.gnu.org/software/make/manual/make.html#toc-Overview-of-make) _(www.gnu.org)_
|
||||||
|
* [make 官网](https://www.gnu.org/software/make/) _www.gnu.org_
|
@@ -1,7 +1,13 @@
|
|||||||
NestJS 备忘清单
|
NestJS 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/@nestjs/core)
|
||||||
|
[](https://www.npmjs.com/package/@nestjs/core)
|
||||||
|
[](https://github.com/nestjs/nest/network/dependents)
|
||||||
|
[](https://github.com/nestjs/nest)
|
||||||
|
|
||||||
[NestJS](https://docs.nestjs.com/) 是一个用于构建高效、可扩展的 Node.js 服务器端应用程序的开发框架
|
[NestJS](https://docs.nestjs.com/) 是一个用于构建高效、可扩展的 Node.js 服务器端应用程序的开发框架
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
创建应用
|
创建应用
|
||||||
---
|
---
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Next.js 备忘清单
|
Next.js 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
这是一份快速参考备忘单,包含 Next.js 的 API 参考列表和一些示例
|
[](https://www.npmjs.com/package/next)
|
||||||
|
[](https://www.npmjs.com/package/next)
|
||||||
|
[](https://github.com/vercel/next.js/network/dependents)
|
||||||
|
[](https://github.com/vercel/next.js)
|
||||||
|
|
||||||
|
这是一份快速参考备忘单,包含 [Next.js](https://nextjs.org/) 的 API 参考列表和一些示例
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
----
|
----
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
PM2 备忘清单
|
PM2 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
|
[](https://npmjs.org/package/pm2)
|
||||||
|
[](https://www.npmjs.com/package/pm2)
|
||||||
|
[](https://github.com/Unitech/pm2/network/dependents)
|
||||||
|
[](https://github.com/Unitech/pm2)
|
||||||
|
|
||||||
[PM2](https://pm2.keymetrics.io/) 是一个守护进程管理器,它将帮助您管理和保持您的应用程序在线。PM2 入门非常简单,它以简单直观的 CLI 形式提供
|
[PM2](https://pm2.keymetrics.io/) 是一个守护进程管理器,它将帮助您管理和保持您的应用程序在线。PM2 入门非常简单,它以简单直观的 CLI 形式提供
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
-----
|
-----
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
React Native 备忘清单
|
React Native 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
|
[](https://npmjs.org/package/react-native)
|
||||||
|
[](https://www.npmjs.com/package/react-native)
|
||||||
|
[](https://github.com/facebook/react-native/network/dependents)
|
||||||
|
[](https://github.com/facebook/react-native)
|
||||||
|
|
||||||
适合初学者的综合 [React Native](https://reactnative.dev/) 备忘清单,在开始 [React Native](https://reactnative.dev/) 之前需要先掌握 [react](./react.md) 库
|
适合初学者的综合 [React Native](https://reactnative.dev/) 备忘清单,在开始 [React Native](https://reactnative.dev/) 之前需要先掌握 [react](./react.md) 库
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
---
|
---
|
||||||
@@ -68,7 +74,7 @@ $ npx react-native run-ios
|
|||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
### macOS 安装 Android 环境
|
### macOS 安装 Android 环境
|
||||||
<!--rehype:wrap-class=col-span-2-->
|
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||||
|
|
||||||
您将需要 Node、Watchman、React Native 命令行界面、JDK 和 Android Studio
|
您将需要 Node、Watchman、React Native 命令行界面、JDK 和 Android Studio
|
||||||
|
|
||||||
@@ -141,11 +147,14 @@ $ npx react-native start
|
|||||||
$ npx react-native run-ios
|
$ npx react-native run-ios
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
### 打开 React Native Debug 菜单
|
||||||
|
|
||||||
:- | --
|
:- | --
|
||||||
:- | --
|
:- | --
|
||||||
`⌘` + `M` | 打开<yel>开发者</yel>菜单
|
`⌘` + `M`(Android) | 打开<yel>开发者</yel>菜单
|
||||||
|
`⌘` + `D`(iOS) | 打开<yel>开发者</yel>菜单
|
||||||
|
`Ctrl` + `D`(Linux) | 打开<yel>开发者</yel>菜单
|
||||||
|
<pur>摇动您的设备</pur> | 打开<yel>开发者</yel>菜单
|
||||||
按两次 `R` 键 | 构建并运行
|
按两次 `R` 键 | 构建并运行
|
||||||
<!--rehype:className=shortcuts-->
|
<!--rehype:className=shortcuts-->
|
||||||
|
|
||||||
|
@@ -1,17 +1,24 @@
|
|||||||
React 备忘清单
|
React 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
适合初学者的综合 React 备忘清单。
|
[](https://npmjs.org/package/react)
|
||||||
|
[](https://www.npmjs.com/package/react)
|
||||||
|
[](https://github.com/facebook/react/network/dependents)
|
||||||
|
[](https://github.com/facebook/react)
|
||||||
|
|
||||||
|
适合初学者的综合 React 备忘清单
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
----
|
----
|
||||||
|
|
||||||
### 介绍
|
### 介绍
|
||||||
|
|
||||||
React 是一个用于构建用户界面的 JavaScript 库。
|
React 是一个用于构建用户界面的 JavaScript 库
|
||||||
|
|
||||||
- [React 官方文档](https://reactjs.org/) _(reactjs.org)_
|
- [React 官方文档](https://reactjs.org/) _(reactjs.org)_
|
||||||
- [Styled Components 备忘清单](./styled-components.md) _(jaywcjlove.github.io)_
|
- [Styled Components 备忘清单](./styled-components.md) _(jaywcjlove.github.io)_
|
||||||
|
- [TypeScript JSX 备忘清单](./typescript.md#jsx) _(jaywcjlove.github.io)_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createRoot} from 'react-dom/client'
|
import {createRoot} from 'react-dom/client'
|
||||||
|
3594
docs/redis.md
Normal file
3594
docs/redis.md
Normal file
File diff suppressed because it is too large
Load Diff
14
docs/rust.md
14
docs/rust.md
@@ -223,6 +223,18 @@ fn main(){
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 区间表达式
|
||||||
|
<!--rehype:wrap-class=col-span-2-->
|
||||||
|
|
||||||
|
产生式/句法规则 | 句法 | 类型 | 区间语义
|
||||||
|
:- | :- | :- | :-
|
||||||
|
RangeExpr | `start..end` | std::ops::Range | start ≤ x < end
|
||||||
|
RangeFromExpr | `start..` | std::ops::RangeFrom | start ≤ x
|
||||||
|
RangeToExpr | `..end` | std::ops::RangeTo | x < end
|
||||||
|
RangeFullExpr | `..` | std::ops::RangeFull | -
|
||||||
|
RangeInclusiveExpr | `start..=end`| std::ops::RangeInclusive | start ≤ x ≤ end
|
||||||
|
RangeToInclusiveExpr | `..=end` | std::ops::RangeToInclusive | x ≤ end
|
||||||
|
|
||||||
Rust 类型
|
Rust 类型
|
||||||
--------
|
--------
|
||||||
|
|
||||||
@@ -791,7 +803,7 @@ let left_shift = h << 4; // => 32
|
|||||||
示例 | 意义
|
示例 | 意义
|
||||||
:- | :-
|
:- | :-
|
||||||
`c && d` | 两者都是真的_(AND)_
|
`c && d` | 两者都是真的_(AND)_
|
||||||
`c || d` | 要么是真的_(OR)_
|
`c \|\| d` | 要么是真的_(OR)_
|
||||||
`!c` | `c` 为假 _(NOT)_
|
`!c` | `c` 为假 _(NOT)_
|
||||||
|
|
||||||
----
|
----
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Sass
|
Sass
|
||||||
===
|
===
|
||||||
|
|
||||||
这是一份快速参考备忘单,列出了 [SASS](https://sass-lang.com) 最有用的功能。
|
[](https://www.npmjs.com/package/sass)
|
||||||
|
[](https://www.npmjs.com/package/sass)
|
||||||
|
[](https://github.com/sass/dart-sass/network/dependents)
|
||||||
|
[](https://github.com/sass/dart-sass)
|
||||||
|
|
||||||
|
这是一份快速参考备忘单,列出了 [SASS](https://sass-lang.com) 最有用的功能
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
Sass 基础
|
Sass 基础
|
||||||
--------
|
--------
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Styled Components 备忘清单
|
Styled Components 备忘清单
|
||||||
====
|
====
|
||||||
|
|
||||||
此快速参考备忘单提供了使用 CSS in JS 工具的各种方法。
|
[](https://npmjs.org/package/styled-components)
|
||||||
|
[](https://www.npmjs.com/package/styled-components)
|
||||||
|
[](https://github.com/styled-components/styled-components/network/dependents)
|
||||||
|
[](https://github.com/styled-components/styled-components)
|
||||||
|
|
||||||
|
此快速参考备忘单提供了使用 CSS in JS 工具的各种方法
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
----
|
----
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
Stylus 备忘清单
|
Stylus 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
本备忘单旨在快速理解 [stylus](https://github.com/stylus/stylus) 所涉及的主要概念,显示了它的常用方法使用清单。
|
[](https://npmjs.org/package/stylus)
|
||||||
|
[](https://www.npmjs.com/package/stylus)
|
||||||
|
[](https://github.com/stylus/stylus/network/dependents)
|
||||||
|
[](https://github.com/stylus/stylus)
|
||||||
|
|
||||||
|
本备忘单旨在快速理解 [stylus](https://github.com/stylus/stylus) 所涉及的主要概念,显示了它的常用方法使用清单
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
---
|
---
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
TypeScript 备忘清单
|
TypeScript 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
包含最重要基础、泛型、方法、class 等 TypeScript 强类型编程语言语法的快速参考备忘单。初学者的完整快速参考。
|
[](https://www.npmjs.com/package/typescript)
|
||||||
|
[](https://www.npmjs.com/package/typescript)
|
||||||
|
[](https://github.com/Microsoft/TypeScript/network/dependents)
|
||||||
|
[](https://github.com/Microsoft/TypeScript)
|
||||||
|
|
||||||
|
包含最重要基础、泛型、方法、class 等 TypeScript 强类型编程语言语法的快速参考备忘单。初学者的完整快速参考
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门 Interface
|
入门 Interface
|
||||||
----
|
----
|
||||||
@@ -1265,6 +1271,24 @@ class Select<T> extends React.Component<SelectProps<T>, any> {}
|
|||||||
const Form = () => <Select<string> items={['a', 'b']} />;
|
const Form = () => <Select<string> items={['a', 'b']} />;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 函数组件 ref
|
||||||
|
<!--rehype:wrap-class=col-span-3-->
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
import { FC, ForwardedRef, forwardRef, PropsWithRef } from "react";
|
||||||
|
|
||||||
|
function InternalProgress(props: ProgressProps, ref?: ForwardedRef<HTMLDivElement>) {
|
||||||
|
return (
|
||||||
|
<div {...props} ref={ref}>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProgressProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {}
|
||||||
|
export const Progress: FC<PropsWithRef<ProgressProps>> = forwardRef<HTMLDivElement>(InternalProgress)
|
||||||
|
```
|
||||||
|
|
||||||
各种各样的技巧
|
各种各样的技巧
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -1331,16 +1355,21 @@ const point = [3, 4] as const
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
type Colors = 'red' | 'green' | 'blue';
|
type Colors = 'red' | 'green' | 'blue';
|
||||||
|
type RGB = [
|
||||||
|
red: number,
|
||||||
|
green: number,
|
||||||
|
blue: number
|
||||||
|
];
|
||||||
|
type Palette = Record<Colors, string | RGB>
|
||||||
|
|
||||||
type RGB = [red: number, green: number, blue: number];
|
const palette: Palette = {
|
||||||
|
|
||||||
const palette: Record<Colors, string | RGB> = {
|
|
||||||
red: [255, 0, 0],
|
red: [255, 0, 0],
|
||||||
green: '#00ff00',
|
green: '#00ff00',
|
||||||
blue: [0, 0, 255],
|
blue: [0, 0, 255],
|
||||||
};
|
};
|
||||||
|
|
||||||
// 通常的方式会推导出 redComponent 为 string | number | undefined
|
// 通常的方式会推导出 redComponent 为
|
||||||
|
// => string | number | undefined
|
||||||
const redComponent = palette.red.at(0);
|
const redComponent = palette.red.at(0);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
436
docs/vue.md
436
docs/vue.md
@@ -1,7 +1,13 @@
|
|||||||
Vue 3 备忘清单
|
Vue 3 备忘清单
|
||||||
===
|
===
|
||||||
|
|
||||||
渐进式 JavaScript 框架 [Vue 3](https://cn.vuejs.org/) 备忘清单的快速参考列表,包含常用 API 和示例。
|
[](https://npmjs.org/package/vue)
|
||||||
|
[](https://www.npmjs.com/package/vue)
|
||||||
|
[](https://github.com/vuejs/core/network/dependents)
|
||||||
|
[](https://github.com/vuejs/core)
|
||||||
|
|
||||||
|
渐进式 JavaScript 框架 [Vue 3](https://cn.vuejs.org/) 备忘清单的快速参考列表,包含常用 API 和示例
|
||||||
|
<!--rehype:style=padding-top: 12px;-->
|
||||||
|
|
||||||
入门
|
入门
|
||||||
---
|
---
|
||||||
@@ -677,6 +683,434 @@ const value = inject(ProvideKey)
|
|||||||
|
|
||||||
<!--rehype:className=wrap-text -->
|
<!--rehype:className=wrap-text -->
|
||||||
|
|
||||||
|
Vue 中使用 TypeScript
|
||||||
|
---
|
||||||
|
|
||||||
|
### 为组件的 props 标注类型
|
||||||
|
<!--rehype:wrap-class=row-span-4-->
|
||||||
|
|
||||||
|
当使用 `<script setup>` 时,`defineProps()` 宏函数支持从它的参数中推导类型
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
foo: { type: String, required: true },
|
||||||
|
bar: Number
|
||||||
|
})
|
||||||
|
|
||||||
|
props.foo // string
|
||||||
|
props.bar // number | undefined
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
对同一个文件中的一个接口或对象类型字面量的引用:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
interface Props {/* ... */}
|
||||||
|
|
||||||
|
defineProps<Props>()
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Props 解构默认值
|
||||||
|
|
||||||
|
```ts
|
||||||
|
export interface Props {
|
||||||
|
msg?: string
|
||||||
|
labels?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
msg: 'hello',
|
||||||
|
labels: () => ['one', 'two']
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
使用目前为实验性的响应性语法糖
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script setup lang="ts">
|
||||||
|
interface Props {
|
||||||
|
name: string
|
||||||
|
count?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对 defineProps() 的响应性解构
|
||||||
|
// 默认值会被编译为等价的运行时选项
|
||||||
|
const {
|
||||||
|
name, count = 100
|
||||||
|
} = defineProps<Props>()
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为组件的 emits 标注类型
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script setup lang="ts">
|
||||||
|
// 运行时
|
||||||
|
const emit = defineEmits(['change', 'update'])
|
||||||
|
|
||||||
|
// 基于类型
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'change', id: number): void
|
||||||
|
(e: 'update', value: string): void
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为 ref() 标注类型
|
||||||
|
|
||||||
|
ref 会根据初始化时的值推导其类型:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import type { Ref } from 'vue'
|
||||||
|
|
||||||
|
const year: Ref<string | number> = ref('2020')
|
||||||
|
|
||||||
|
year.value = 2020 // 成功!
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为 reactive() 标注类型
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { reactive } from 'vue'
|
||||||
|
|
||||||
|
interface Book {
|
||||||
|
title: string
|
||||||
|
year?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const book: Book = reactive({
|
||||||
|
title: 'Vue 3 指引'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为 computed() 标注类型
|
||||||
|
|
||||||
|
你还可以通过泛型参数显式指定类型:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
const double = computed<number>(() => {
|
||||||
|
// 若返回值不是 number 类型则会报错
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为事件处理函数标注类型
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script setup lang="ts">
|
||||||
|
function handleChange(event) {
|
||||||
|
// `event` 隐式地标注为 `any` 类型
|
||||||
|
console.log(event.target.value)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
@change="handleChange" />
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
显式地为事件处理函数的参数标注类型
|
||||||
|
|
||||||
|
```ts
|
||||||
|
function handleChange(event: Event) {
|
||||||
|
const target = event.target as HTMLInputElement
|
||||||
|
console.log(target.value)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为 provide / inject 标注类型
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { provide, inject } from 'vue'
|
||||||
|
import type { InjectionKey } from 'vue'
|
||||||
|
|
||||||
|
const key = Symbol() as InjectionKey<string>
|
||||||
|
// 若提供的是非字符串值会导致错误
|
||||||
|
provide(key, 'foo')
|
||||||
|
// foo 的类型:string | undefined
|
||||||
|
const foo = inject(key)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为模板引用标注类型
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from 'vue'
|
||||||
|
|
||||||
|
const el = ref<HTMLInputElement | null>(null)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
el.value?.focus()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<input ref="el" />
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 为组件模板引用标注类型
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- MyModal.vue -->
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const isContentShown = ref(false)
|
||||||
|
const open =
|
||||||
|
() => (isContentShown.value = true)
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
使用 TypeScript 内置的 `InstanceType` 工具类型来获取其实例类
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- App.vue -->
|
||||||
|
<script setup lang="ts">
|
||||||
|
import MyModal from './MyModal.vue'
|
||||||
|
|
||||||
|
type Modal = InstanceType<typeof MyModal>
|
||||||
|
|
||||||
|
const modal = ref<Modal | null>(null)
|
||||||
|
|
||||||
|
const openModal = () => {
|
||||||
|
modal.value?.open()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 选项式 API 为组件的 props 标注类型
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
// 启用了类型推导
|
||||||
|
props: {
|
||||||
|
name: String,
|
||||||
|
id: [Number, String],
|
||||||
|
msg: { type: String, required: true },
|
||||||
|
metadata: null
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 类型:string | undefined
|
||||||
|
this.name
|
||||||
|
// 类型:number|string|undefined
|
||||||
|
this.id
|
||||||
|
// 类型:string
|
||||||
|
this.msg
|
||||||
|
// 类型:any
|
||||||
|
this.metadata
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
使用 PropType 这个工具类型来标记更复杂的 props 类型
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
import type { PropType } from 'vue'
|
||||||
|
|
||||||
|
interface Book {
|
||||||
|
title: string
|
||||||
|
author: string
|
||||||
|
year: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
book: {
|
||||||
|
// 提供相对 `Object` 更确定的类型
|
||||||
|
type: Object as PropType<Book>,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
// 也可以标记函数
|
||||||
|
callback: Function as PropType<(id: number) => void>
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.book.title // string
|
||||||
|
this.book.year // number
|
||||||
|
|
||||||
|
// TS Error: argument of type 'string' is not
|
||||||
|
// assignable to parameter of type 'number'
|
||||||
|
this.callback?.('123')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 选项式 API 为组件的 emits 标注类型
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
|
||||||
|
type Payload = { bookName: string }
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
emits: {
|
||||||
|
addBook(payload: Payload) {
|
||||||
|
// 执行运行时校验
|
||||||
|
return payload.bookName.length > 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit() {
|
||||||
|
this.$emit('addBook', {
|
||||||
|
bookName: 123 // 类型错误
|
||||||
|
})
|
||||||
|
// 类型错误
|
||||||
|
this.$emit('non-declared-event')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 选项式 API 为计算属性标记类型
|
||||||
|
<!--rehype:wrap-class=row-span-2-->
|
||||||
|
|
||||||
|
计算属性会自动根据其返回值来推导其类型:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
message: 'Hello!'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
greeting() {
|
||||||
|
return this.message + '!'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.greeting // 类型:string
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
在某些场景中,你可能想要显式地标记出计算属性的类型以确保其实现是正确的:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
message: 'Hello!'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 显式标注返回类型
|
||||||
|
greeting(): string {
|
||||||
|
return this.message + '!'
|
||||||
|
},
|
||||||
|
|
||||||
|
// 标注一个可写的计算属性
|
||||||
|
greetingUppercased: {
|
||||||
|
get(): string {
|
||||||
|
return this.greeting.toUpperCase()
|
||||||
|
},
|
||||||
|
set(newValue: string) {
|
||||||
|
this.message = newValue.toUpperCase()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 选项式 API 为事件处理函数标注类型
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
methods: {
|
||||||
|
handleChange(event: Event) {
|
||||||
|
console.log((event.target as HTMLInputElement).value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### 选项式 API 扩展全局属性
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
declare module 'vue' {
|
||||||
|
interface ComponentCustomProperties {
|
||||||
|
$http: typeof axios
|
||||||
|
$translate: (key: string) => string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 类型扩展的位置
|
||||||
|
|
||||||
|
我们可以将这些类型扩展放在一个 `.ts` 文件,或是一个影响整个项目的 `*.d.ts` 文件中
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// 不工作,将覆盖原始类型。
|
||||||
|
declare module 'vue' {
|
||||||
|
interface ComponentCustomProperties {
|
||||||
|
$translate: (key: string) => string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// 正常工作。
|
||||||
|
export {}
|
||||||
|
|
||||||
|
declare module 'vue' {
|
||||||
|
interface ComponentCustomProperties {
|
||||||
|
$translate: (key: string) => string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 选项式 API 扩展自定义选项
|
||||||
|
|
||||||
|
某些插件,比如 vue-router,提供了一些自定义的组件选项,比如 beforeRouteEnter:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { defineComponent } from 'vue'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
beforeRouteEnter(to, from, next) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
如果没有确切的类型标注,这个钩子函数的参数会隐式地标注为 `any` 类型。我们可以为 `ComponentCustomOptions` 接口扩展自定义的选项来支持:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { Route } from 'vue-router'
|
||||||
|
|
||||||
|
declare module 'vue' {
|
||||||
|
interface ComponentCustomOptions {
|
||||||
|
beforeRouteEnter?(
|
||||||
|
to: Route,
|
||||||
|
from: Route,
|
||||||
|
next: () => void
|
||||||
|
): void
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
API 参考
|
API 参考
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wcj/reference",
|
"name": "@wcj/reference",
|
||||||
"version": "1.30.0",
|
"version": "1.31.0",
|
||||||
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
|
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
|
||||||
"author": "jaywcjlove",
|
"author": "jaywcjlove",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"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.2"
|
"refs-cli": "^1.2.7"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
|
Reference in New Issue
Block a user