feat: add es6.md cheatsheet. b258494776

This commit is contained in:
jaywcjlove
2022-10-31 07:19:46 +00:00
parent 53cf1c63da
commit c71af37115
68 changed files with 3185 additions and 2812 deletions

View File

@ -34,22 +34,22 @@
document.documentElement.setAttribute('data-color-mode', mode);
localStorage.setItem(LOCAL_NANE, mode);
}
</script><a href="https://github.com/jaywcjlove/reference" class="" target="__blank"><svg viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a></div></div></nav><div class="wrap max-container"><header class="wrap-header h1wrap"><h1 id="htop-备忘清单"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
</script><a href="https://github.com/jaywcjlove/reference" class="" target="__blank"><svg viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a></div></div></nav><div class="wrap h1body-exist max-container"><header class="wrap-header h1wrap"><h1 id="htop-备忘清单"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
<path d="M16.19 2H7.81C4.17 2 2 4.17 2 7.81v8.37C2 19.83 4.17 22 7.81 22h8.37c3.64 0 5.81-2.17 5.81-5.81V7.81C22 4.17 19.83 2 16.19 2ZM7.63 18.15c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-2.07c0-.41.34-.75.75-.75s.75.34.75.75v2.07Zm5.12 0c0 .41-.34.75-.75.75s-.75-.34-.75-.75V14c0-.41.34-.75.75-.75s.75.34.75.75v4.15Zm5.12 0c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-6.22c0-.41.34-.75.75-.75s.75.34.75.75v6.22Zm0-9.38c0 .41-.34.75-.75.75s-.75-.34-.75-.75V7.8a19.532 19.532 0 0 1-9.31 5.36c-.06.02-.12.02-.18.02-.34 0-.64-.23-.73-.57-.1-.4.14-.81.55-.91a18.07 18.07 0 0 0 8.75-5.11H14.2c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h2.93c.04 0 .07.02.11.02.05.01.1.01.15.03.05.02.09.05.14.08.03.02.06.03.09.05.01.01.01.02.02.02.04.04.07.08.1.12.03.04.06.07.07.11.02.04.02.08.03.13.01.05.03.1.03.16 0 .01.01.02.01.03v2.93h-.01Z" fill="currentColor"></path>
</svg>
<a aria-hidden="true" tabindex="-1" href="#htop-备忘清单"><span class="icon icon-link"></span></a>htop 备忘清单</h1><div class="wrap-body">
<p>htop 是一个交互式流程查看器,此 htop 备忘清单包含 htop 命令</p>
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" href="#htop-用法">htop 用法</a><a aria-hidden="true" class="leve4 tocs-link" href="#安装">安装</a><a aria-hidden="true" class="leve3 tocs-link" href="#选项示例">选项示例</a><a aria-hidden="true" class="leve3 tocs-link" href="#状态">状态</a><a aria-hidden="true" class="leve3 tocs-link" href="#交互式命令">交互式命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#排序线程">排序/线程</a><a aria-hidden="true" class="leve3 tocs-link" href="#滚动">滚动</a></div></div><div class="h1wrap-body"><div class="wrap"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
</div></div><div class="h2wrap-body"><div class="wrap"><div class="wrap-header h3wrap"><h3 id="htop-用法"><a aria-hidden="true" tabindex="-1" href="#htop-用法"><span class="icon icon-link"></span></a>htop 用法</h3><div class="wrap-body">
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" href="#htop-用法">htop 用法</a><a aria-hidden="true" class="leve4 tocs-link" href="#安装">安装</a><a aria-hidden="true" class="leve3 tocs-link" href="#选项示例">选项示例</a><a aria-hidden="true" class="leve3 tocs-link" href="#状态">状态</a><a aria-hidden="true" class="leve3 tocs-link" href="#交互式命令">交互式命令</a><a aria-hidden="true" class="leve3 tocs-link" href="#排序线程">排序/线程</a><a aria-hidden="true" class="leve3 tocs-link" href="#滚动">滚动</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
</div></div><div class="h2wrap-body"><div class="wrap h3body-exist"><div class="wrap-header h3wrap"><h3 id="htop-用法"><a aria-hidden="true" tabindex="-1" href="#htop-用法"><span class="icon icon-link"></span></a>htop 用法</h3><div class="wrap-body">
<p>htop 是一个互动的进程查看器,动态观察系统进程状况</p>
<ul>
<li><a href="https://htop.sourceforge.net/">命令 htop 的官网</a></li>
</ul>
<pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line">$ <span class="token function">htop</span> <span class="token punctuation">[</span>-dChustv<span class="token punctuation">]</span>
</span></code></pre>
</div></div><div class="h3wrap-body"><div class="wrap"><div class="wrap-header h4wrap"><h4 id="安装"><a aria-hidden="true" tabindex="-1" href="#安装"><span class="icon icon-link"></span></a>安装</h4><div class="wrap-body">
</div></div><div class="h3wrap-body"><div class="wrap h4body-not-exist"><div class="wrap-header h4wrap"><h4 id="安装"><a aria-hidden="true" tabindex="-1" href="#安装"><span class="icon icon-link"></span></a>安装</h4><div class="wrap-body">
<pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line">$ <span class="token function">apt</span> <span class="token function">install</span> <span class="token function">htop</span> <span class="token comment"># Debian</span>
</span><span class="code-line">$ dnf <span class="token function">install</span> <span class="token function">htop</span> <span class="token comment"># Fedora</span>
</span><span class="code-line">$ emerge sys-process/htop <span class="token comment"># Gentoo</span>
@ -57,7 +57,7 @@
</span><span class="code-line">$ Compile <span class="token function">htop</span> <span class="token comment"># GoboLinux</span>
</span></code></pre>
<p>htop 的软件包在大多数发行版中都<a href="https://htop.dev/downloads.html">可用下载</a></p>
</div></div></div></div></div><div class="wrap col-span-2"><div class="wrap-header h3wrap"><h3 id="选项示例"><a aria-hidden="true" tabindex="-1" href="#选项示例"><span class="icon icon-link"></span></a>选项示例</h3><div class="wrap-body">
</div></div></div></div></div><div class="wrap h3body-not-exist col-span-2"><div class="wrap-header h3wrap"><h3 id="选项示例"><a aria-hidden="true" tabindex="-1" href="#选项示例"><span class="icon icon-link"></span></a>选项示例</h3><div class="wrap-body">
<!--rehype:wrap-class=col-span-2-->
<p>长选项的强制参数对于短选项也是强制的</p>
@ -102,7 +102,7 @@
<table><thead><tr><th align="left">:-</th><th align="left">:-</th></tr></thead><tbody><tr><td align="left"><code>-d --delay=DELAY</code></td><td align="left">更新之间的延迟,以十分之一秒为单位</td></tr><tr><td align="left"><code>-C --no-color --no-colour</code></td><td align="left">以单色模式启动 <code>htop</code></td></tr><tr><td align="left"><code>-h --help</code></td><td align="left">显示帮助消息并退出</td></tr><tr><td align="left"><code>-p --pid=PID,PID...</code></td><td align="left">仅显示给定的PID</td></tr><tr><td align="left"><code>-s --sort-key COLUMN</code></td><td align="left">按此列排序(对列列表使用<code>--sort-key</code>帮助)</td></tr><tr><td align="left"><code>-u --user=USERNAME</code></td><td align="left">仅显示给定用户的进程</td></tr><tr><td align="left"><code>-v --version</code></td><td align="left">输出版本信息并退出</td></tr><tr><td align="left"><code>-t --tree</code></td><td align="left">在树状视图中显示流程</td></tr></tbody></table>
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="状态"><a aria-hidden="true" tabindex="-1" href="#状态"><span class="icon icon-link"></span></a>状态</h3><div class="wrap-body">
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="状态"><a aria-hidden="true" tabindex="-1" href="#状态"><span class="icon icon-link"></span></a>状态</h3><div class="wrap-body">
@ -134,7 +134,7 @@
<table class="shortcuts"><thead><tr><th align="left">:-</th><th align="left">:-</th></tr></thead><tbody><tr><td align="left"><code>R</code></td><td align="left">运行中</td></tr><tr><td align="left"><code>S</code></td><td align="left">休眠</td></tr><tr><td align="left"><code>T</code></td><td align="left">追踪/停止</td></tr><tr><td align="left"><code>Z</code></td><td align="left">僵尸</td></tr><tr><td align="left"><code>D</code></td><td align="left">磁盘睡眠</td></tr></tbody></table>
<!--rehype:className=shortcuts-->
</div></div></div><div class="wrap col-span-2 row-span-3"><div class="wrap-header h3wrap"><h3 id="交互式命令"><a aria-hidden="true" tabindex="-1" href="#交互式命令"><span class="icon icon-link"></span></a>交互式命令</h3><div class="wrap-body">
</div></div></div><div class="wrap h3body-not-exist col-span-2 row-span-3"><div class="wrap-header h3wrap"><h3 id="交互式命令"><a aria-hidden="true" tabindex="-1" href="#交互式命令"><span class="icon icon-link"></span></a>交互式命令</h3><div class="wrap-body">
<!--rehype:wrap-class=col-span-2 row-span-3-->
@ -231,7 +231,7 @@
<table class="shortcuts"><thead><tr><th align="left">:-</th><th align="left">:-</th></tr></thead><tbody><tr><td align="left"><code>F1</code>, <code>h</code>, <code>?</code></td><td align="left">转到帮助屏幕</td></tr><tr><td align="left"><code>F10</code>, <code>q</code></td><td align="left">退出</td></tr><tr><td align="left"><code>Space</code></td><td align="left">标记或取消标记进程</td></tr><tr><td align="left"><code>U</code></td><td align="left">取消标记所有进程(删除所有使用 Space 键添加的标记)</td></tr><tr><td align="left"><code>s</code></td><td align="left">跟踪进程系统调用:如果安装了 <code>strace(1)</code>,按下此键会将其附加到当前选定的进程,呈现进程发出的系统调用的实时更新</td></tr><tr><td align="left"><code>l</code></td><td align="left">显示进程打开的文件:如果安装了 <code>lsof(1)</code>,按下该键将显示进程打开的文件描述符列表</td></tr><tr><td align="left"><code>F2</code>, <code>S</code></td><td align="left">转到设置屏幕,您可以在其中配置屏幕顶部显示的仪表,设置各种显示选项,在配色方案中进行选择,并选择显示的列,以何种顺序显示</td></tr><tr><td align="left"><code>F3</code>, <code>/</code></td><td align="left">逐步搜索所有显示进程的命令行。当前选定(突出显示)的命令将在您键入时更新。在搜索模式下,按 <code>F3</code> 将循环匹配出现的事件</td></tr><tr><td align="left"><code>F4</code>, <code>\</code></td><td align="left">增量进程过滤:输入部分进程命令行,仅显示名称匹配的进程。要取消过滤,请再次输入过滤选项并按 <code>Esc</code></td></tr><tr><td align="left"><code>F5</code>, <code>t</code></td><td align="left">树视图:按父级组织进程,并将它们之间的关系布局为树。切换键将在树和您之前选择的排序视图之间切换。选择排序视图将退出树视图</td></tr><tr><td align="left"><code>F6</code></td><td align="left">在排序视图上,选择一个字段进行排序,也可以通过 &#x3C; 和 > 访问。当前排序字段由标题中的突出显示。在树视图中,展开或折叠当前子树。树节点中的“+”指示符表示它已折叠</td></tr><tr><td align="left"><code>F7</code>, <code>]</code></td><td align="left">增加所选进程的优先级(从“nice”值中减去)。这只能由超级用户完成</td></tr><tr><td align="left"><code>F8</code>, <code>[</code></td><td align="left">降低选定进程的优先级(添加到“nice”值)</td></tr><tr><td align="left"><code>F9</code>, <code>k</code></td><td align="left">“杀死”进程:向一个或一组进程发送一个在菜单中选择的信号。如果进程被标记,则将信号发送到所有标记的进程。如果没有标记,则发送到当前选定的进程</td></tr><tr><td align="left"><code>+</code>, <code>-</code></td><td align="left">在树视图模式下,展开或折叠子树。</td></tr><tr><td align="left"><code>a</code></td><td align="left">(在多 CPU 机器上)设置 CPU 亲和性:标记允许进程使用的 CPU</td></tr><tr><td align="left"><code>u</code></td><td align="left">仅显示指定用户拥有的进程</td></tr><tr><td align="left"><code>F</code></td><td align="left">“跟随”进程:如果排序顺序导致当前选定的进程在列表中移动,则使选择栏跟随它。这对于监控进程很有用:这样,您可以使进程始终在屏幕上可见。使用移动键时,“跟随”失效。</td></tr><tr><td align="left"><code>p</code></td><td align="left">在适用的情况下显示运行程序的完整路径(这是一个切换键)</td></tr><tr><td align="left"><code>Ctrl-L</code></td><td align="left">刷新:重绘屏幕并重新计算数值</td></tr><tr><td align="left"><code>Numbers</code></td><td align="left">PID搜索输入进程ID选择突出显示将移至它</td></tr></tbody></table>
<!--rehype:className=shortcuts-->
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="排序线程"><a aria-hidden="true" tabindex="-1" href="#排序线程"><span class="icon icon-link"></span></a>排序/线程</h3><div class="wrap-body">
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="排序线程"><a aria-hidden="true" tabindex="-1" href="#排序线程"><span class="icon icon-link"></span></a>排序/线程</h3><div class="wrap-body">
@ -267,7 +267,7 @@
<table class="shortcuts"><thead><tr><th align="left">:-</th><th align="left">:-</th></tr></thead><tbody><tr><td align="left"><code>M</code></td><td align="left"><code>内存</code>使用情况排序 <em>(最高兼容性键)</em></td></tr><tr><td align="left"><code>P</code></td><td align="left"><code>CPU</code>使用情况排序 <em>(最高兼容性键)</em></td></tr><tr><td align="left"><code>T</code></td><td align="left"><code>时间</code>排序 <em>(最高兼容性键)</em></td></tr><tr><td align="left"><code>I</code></td><td align="left"><code>反转</code>排序顺序</td></tr><tr><td align="left"><code>K</code></td><td align="left">隐藏<code>内核</code>线程</td></tr><tr><td align="left"><code>H</code></td><td align="left">隐藏<code>用户</code>线程</td></tr></tbody></table>
<!--rehype:className=shortcuts-->
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="滚动"><a aria-hidden="true" tabindex="-1" href="#滚动"><span class="icon icon-link"></span></a>滚动</h3><div class="wrap-body">
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="滚动"><a aria-hidden="true" tabindex="-1" href="#滚动"><span class="icon icon-link"></span></a>滚动</h3><div class="wrap-body">
@ -328,8 +328,6 @@ function anchorPoint() {
Array.from(document.querySelectorAll('.h2wrap-body .wrap')).forEach((elm) => elm.classList.remove('active'))
if (elm?.tagName === 'H3') {
elm?.parentElement?.parentElement?.classList.add('active');
const box = elm?.parentElement?.parentElement;
console.log('elm:2', box, document.querySelectorAll('.h2wrap-body .wrap'))
}
}
anchorPoint();
@ -340,7 +338,6 @@ function updateAnchor(element) {
tocanchor.classList.remove('is-active-link');
});
const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`);
console.log('anchor', anchor)
if (anchor) {
anchor.classList.add('is-active-link');
}