Skip to content

Commit 27dd1aa

Browse files
author
zhangbinbin
committed
ip
1 parent eb3420f commit 27dd1aa

File tree

22 files changed

+3015
-25
lines changed

22 files changed

+3015
-25
lines changed

.DS_Store

4 KB
Binary file not shown.

Linux 基础.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,16 @@ z 代表采用了 `gzip` 压缩,`czf`代表打包并压缩
817817

818818

819819

820+
## 其他命令
821+
822+
### tree
823+
824+
Linux tree命令用于以树状图列出目录的内容。
825+
826+
执行tree指令,它会列出指定目录下的所有文件,包括子目录里的文件。
827+
828+
829+
820830

821831
## 命令行奇淫技巧
822832

@@ -828,6 +838,10 @@ z 代表采用了 `gzip` 压缩,`czf`代表打包并压缩
828838
829839
* whereis 命令范围更广,不限制于 path 查找。
830840
841+
### 3. find 命令
842+
843+
Linux find 命令用来在==指定目录==(和which的区别)下查找文件。任何位于参数之前的字符串都将被视为欲查找的目录名。如果使用该命令时,不设置任何参数,则 find 命令将在当前目录下查找子目录与文件。并且将查找到的子目录和文件全部进行显示。
844+
831845
832846
833847
# 用户和权限管理(在云服务器测试)

node笔记/重学node.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,42 @@ callback
174174
* 中间件执行可以是异步,能够中断执行
175175
* 简单粗暴的直接赋值,而不是调用函数赋值
176176

177+
178+
179+
# koa 洋葱模型实现
180+
181+
* 一个 middleware 队列保存 use 的中间件
182+
183+
* 执行顺序的实现(洋葱模型)
184+
185+
核心逻辑:
186+
187+
```js
188+
function fn(ctx) {
189+
return dispatch(0)
190+
function dispatch(i) {
191+
const mw = middleware[i]
192+
if (!mw) {
193+
return
194+
}
195+
return mw(ctx, dispatch.bind(null, i + 1))
196+
}
197+
}
198+
199+
fn()
200+
```
201+
202+
https://zhuanlan.zhihu.com/p/279391637
203+
204+
* 思路:
205+
1. 中间件队列中所有的 mw 都会得到执行
206+
2. 执行的时候注意 next 加入异步队列
207+
208+
209+
210+
# 数组 reduce
211+
212+
* 如果没有初始值,则会从第一项 第二项开始执行
213+
214+
215+

0 commit comments

Comments
 (0)