韶 光
http://blog.xyang.xin/icon.png
Yang Xinyu's Personal Blog
2021-09-07T09:34:51.569Z
http://blog.xyang.xin/
杨欣雨
Hexo
Hubot 官方文档(译)
http://blog.xyang.xin/hubot-document/
2021-09-02T20:27:46.000Z
2021-09-07T09:34:51.569Z
<h1 id="Hubot-官方文档"><a href="#Hubot-官方文档" class="headerlink" title="Hubot 官方文档"></a>Hubot 官方文档</h1><p><a href="https://hubot.github.com/docs/">原文链接🔗</a><br><img data-src="https://images.xyang.xin/2021%2F09%2F01%2Fhubot-avatar.png" alt="hubot-avatar.png"></p>
<h2 id="概览"><a href="#概览" class="headerlink" title="概览"></a>概览</h2><h3 id="Hubot-起步"><a href="#Hubot-起步" class="headerlink" title="Hubot 起步"></a>Hubot 起步</h3><p>您需要<a href="https://docs.npmjs.com/getting-started/installing-node">node.js和npm</a>。安装它们后,我们就可以安装 hubot 生成器:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> npm install -g yo generator-hubot</span></span><br></pre></td></tr></table></figure>
<p>这条命令将给我们带来hubot <a href="http://yeoman.io/">yeoman</a>生成器。现在我们就可以先创建一个的文件夹,然后在里面生成一个新的hubot实例。例如,如果我们想制造一个叫 myhubot的机器人:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> mkdir myhubot</span></span><br><span class="line"><span class="meta">$</span><span class="bash"> <span class="built_in">cd</span> myhubot</span></span><br><span class="line"><span class="meta">$</span><span class="bash"> yo hubot</span></span><br></pre></td></tr></table></figure>
环形链表
http://blog.xyang.xin/leetcode-142/
2020-09-13T11:50:24.000Z
2021-08-22T09:47:12.258Z
<h2 id="题目描述"><a href="#题目描述" class="headerlink" title="题目描述"></a>题目描述</h2><p><a href="https://leetcode-cn.com/problems/linked-list-cycle-ii/">142. 环形链表 II - 力扣(LeetCode)</a><br>给定一个链表,返回链表入环的第一个节点。无环返回null。<br><img data-src="https://images.xyang.xin/2020%2F09%2F13%2FlinkList.jpg?x-oss-process=style/title_800" alt="linkList.jpg"></p>
学习 HTTP 协议笔记
http://blog.xyang.xin/learn-http-basics/
2020-09-03T16:04:17.000Z
2021-08-22T09:12:42.507Z
<h2 id="网络模型"><a href="#网络模型" class="headerlink" title="网络模型"></a>网络模型</h2><p>五层网络模型:<br><img data-src="https://images.xyang.xin/2020%2F09%2F03%2Fclassic-five-layer-model.jpg?x-oss-process=style/title_800" alt="classic-five-layer-model.jpg"></p>
position ——【每天一点 CSS】
http://blog.xyang.xin/css-everday-1/
2020-08-31T15:15:31.000Z
2021-08-22T09:12:44.983Z
<p>今天来聊聊关于CSS的属性<code>position</code>,它的取值如下:</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">position</span>: static; // 初始值</span><br><span class="line"><span class="attribute">position</span>: relative; // 相对定位</span><br><span class="line"><span class="attribute">position</span>: absolute; // 绝对定位</span><br><span class="line"><span class="attribute">position</span>: fixed; // 固定定位</span><br></pre></td></tr></table></figure>
<p>定位不是继承的。</p>
类型的动态绑定和静态绑定
http://blog.xyang.xin/dynamic-and-static-type-binding/
2020-08-14T18:12:41.000Z
2021-08-22T09:12:47.444Z
<p>JavaScript 是动态绑定的语言,而 TypeScript 包装其成为静态绑定的语言。而什么是动态绑定,什么是静态绑定,它们的优劣又是什么呢?TypeScript 又为什么要“多此一举”?</p>
学习 CSS 时忽视的几个知识点
http://blog.xyang.xin/note-things-i-wish-id-known-about-css/
2020-07-24T11:09:19.000Z
2021-08-22T09:12:50.186Z
<p><a href="https://cssfordesigners.com/articles/things-i-wish-id-known-about-css">Things I Wish I’d Known About CSS</a></p>
<p>文章的作者以老式的方式构建网站:查看网站源代码、复制然后修改,而没有经过阅读书籍等系统性的学习。作者在 1999 年就使用这种方式了,当时写的还是这种代码: <code><font size="4" color="#000000"></code>。而当 CSS 面世的时候,作者没有改变自己的学习方法,而错过了太多基本知识。文章主要介绍的是作者希望早点学到的东西。</p>
从 Github 下载目标仓库指定文件夹
http://blog.xyang.xin/github-download-folder/
2020-07-09T21:19:34.000Z
2021-08-22T09:12:52.843Z
<p>从 Github 下载目标仓库指定文件夹。</p>
vim-fugitive ——【一天一个 vim 插件】
http://blog.xyang.xin/vim-plugin-everday-2/
2020-06-29T12:01:14.000Z
2021-08-22T09:13:02.359Z
<p>作为一个 10k+ star 的 vim 插件,<a href="https://github.com/tpope/vim-fugitive">tpope/vim-fugitive</a> 自称为 Git 的第一 Vim 插件并不为过。Fugitive 让你在当前 buffer 缓冲区通过<code>:Git</code>或<code>:G</code>,可以直接使用 git 命令。可以看作是<code>!git XX</code> 命令的改进和优化,除了使用 silent,静默模式外,你不会看到 “Press ENTER or type command to continue”,还对一些命令进行了优化。</p>
vim-gitgutter ——【一天一个 vim 插件】
http://blog.xyang.xin/vim-plugin-everday-1/
2020-06-28T12:03:02.000Z
2021-09-07T14:27:47.182Z
<p><img data-src="https://images.xyang.xin/2020%2F06%2F28%2Fscreenshot.png?x-oss-process=style/title_800" alt="screenshot.png"><br>在此截图你可以看见:</p>
<ul>
<li>183-184 行是新建的;</li>
<li>186-187 行有所变动;</li>
<li>在底部的预览区中显示改动情况(<leader>hp)。</li>
</ul>
<p>(<a href="https://github.com/airblade/vim-gitgutter">出处</a>)<a href="https://github.com/airblade/vim-gitgutter">airblade/vim-gitgutter</a> </p>
<p>在 vim 标志栏(sign column,行号左边的一列,通常为隐藏状态)中显示 git diff(git 差异)</p>
Vim8 操作简记
http://blog.xyang.xin/vim-manipulate/
2020-06-23T13:50:03.000Z
2021-08-22T09:13:15.496Z
<p>Normal 模式是 Vim 默认打开状态。我们可以通过 Normal 模式,任何其它模式,我们可以在 Normal 模式下对文本进行浏览、排版、修改。Normal 模式在 Vim 中具有举足轻重的作用。</p>
<p>在 Normal 模式下,除了基本的移动指令 (j、k、h、l)、插入指令 (i、a)、撤销指令 (u、U) 等。Vim 通过 “操作符 + 运作命令 = 操作”(出自《Vim 实用技巧 第 2 版》) 扩展出了大量的操作指令。</p>
Linux 剪贴板小技巧
http://blog.xyang.xin/ssh-clipboard-iterm2/
2020-05-30T22:07:30.000Z
2021-08-22T09:13:19.121Z
<h2 id="初步识-vim-剪贴板"><a href="#初步识-vim-剪贴板" class="headerlink" title="初步识 vim 剪贴板"></a>初步识 vim 剪贴板</h2><p>对于文本的复制粘贴,系统会提供剪贴板,剪贴板在 vim 中被称为寄存器,并且 vim 有很多寄存器,寄存器使用的语法:<code>"{register}</code>,当然了寄存器指令不会单独使用,后面都会跟代表复制的 <code>y</code> 或代表粘贴的 <code>p</code>,执行 <code>"ay</code> 就将选中的内容复制到了 <code>a</code> 寄存器,
搜索引擎使用技巧
http://blog.xyang.xin/se-operators/
2020-05-29T18:15:01.000Z
2021-08-22T09:13:22.146Z
<p><img data-src="http://images.xyang.xin/2020%2F05%2F29%2F1590724982.png?x-oss-process=style/title_800" alt="1590724982.png"></p>
<h2 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h2><p>生活离不开搜索引擎了,我曾尝试在思考,是不是未来的开卷考试,会允许使用某个特定的搜索引擎。
Mac 小问题 —— iCloud 未响应
http://blog.xyang.xin/macos-problems/
2020-04-18T16:15:08.000Z
2021-08-22T09:13:24.946Z
<p>使用 iCloud Drive 将文件上传到云端,防止数据丢失,同时可以实现多台设备的协同工作。但是在使用 iCloud Drive 的过程中我遇到了程序未响应,iCoud 文件上传阻塞的问题。</p>
Mac 大扫除🧹
http://blog.xyang.xin/macos-clean/
2020-04-13T14:07:22.000Z
2021-08-22T09:13:28.313Z
<p>基于 macOS Catalina 版本 10.15.4, 128G固态,8GB内存。</p>
<p>通过以下命令可以查看当前路径下的所有文件及文件夹大小并从大到小排列,以 KB 为单位显示。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">du -sk *| sort -rn</span><br></pre></td></tr></table></figure>
<p>以下命令就是以K,M,G为单位,提高信息的可读性,但是不能正确按文件大小排序。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">du -sh *</span><br></pre></td></tr></table></figure>
解构赋值 ———【一天一个 es6 语法】
http://blog.xyang.xin/es6-everyday-3/
2020-03-31T15:51:49.000Z
2021-08-22T09:13:31.366Z
<h2 id="何为解构赋值"><a href="#何为解构赋值" class="headerlink" title="何为解构赋值"></a>何为解构赋值</h2><p>解构赋值语法是一种 javascript 表达式。通过解构赋值,可以将属性/值从对象/数组中取出,复制给其他变量。</p>
箭头函数( => ) ———【一天一个 es6 语法】
http://blog.xyang.xin/es6-everday-2/
2020-03-29T19:13:56.000Z
2021-08-22T09:13:35.055Z
<h2 id="Function"><a href="#Function" class="headerlink" title="Function"></a>Function</h2><p>每个函数都是 <code>Function</code> 类型的实例,由于函数是对象,因此函数名实际上也是一个指向函数对象的指针,函数通常是使用<strong>函数声明语法</strong>定义的:</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">sum</span> (<span class="params">num1, num2</span>) </span>{</span><br><span class="line"> <span class="keyword">return</span> num1 + num2;</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
Symbol ———【一天一个 es6 语法】
http://blog.xyang.xin/es6-everday-1/
2020-03-25T21:28:59.000Z
2021-08-22T09:13:38.445Z
<h2 id="什么是-Symbol"><a href="#什么是-Symbol" class="headerlink" title="什么是 Symbol?"></a>什么是 Symbol?</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> 😻 = 😺 × 😍; <span class="comment">// SyntaxError</span></span><br></pre></td></tr></table></figure>
<p>(爆笑)这当然不是 Symbol。</p>
<ul>
<li>Undefined</li>
<li>Null</li>
<li>Boolean</li>
<li>Number</li>
<li>String</li>
<li>Object</li>
<li>Symbol (ES2015 新增)</li>
</ul>
<p>Symbol 不是字符串,不是对象,是第七种原始数据类型。每个从<code>Symbol()</code>返回的 symbol 类型的值都是唯一的。<strong>一个 symbol 类型的值能作为对象属性的标识符;这是该数据类型仅有的目的</strong>。</p>
vim 多文件类型自动补全方案
http://blog.xyang.xin/vim-multiple-filetype-deoplete/
2020-03-17T15:27:51.000Z
2021-08-22T09:13:41.101Z
<h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p>多文件类型也可以叫混合文件类型(multiple filetype), 比如 HTML 里面写 CSS, JS 代码,虽然不提倡,但偶尔也有这个需求。</p>
<p>根据常识,我们知道,往往针对不同的文本类型,vim 或其插件,会出发不同的事件,例如特定的语法高亮、特定的语法检测、特定的自动补全方案等。<br>几乎每个 vim user 的 vimrc 中都会有如下配置:</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">filetype plugin indent on</span><br></pre></td></tr></table></figure>
HTTP 代理与 Socks5 代理
http://blog.xyang.xin/proxy-http-socks5/
2020-03-15T13:06:07.000Z
2021-08-22T09:13:44.185Z
<h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p>本文通过实践经历基本的认识 HTTP 代理与 Socks5 代理的用法与理解其精髓。同时也解决 go get 库无法下载的问题。</p>
《如何阅读一本书》读书笔记
http://blog.xyang.xin/book-rhydybs/
2019-09-01T19:36:24.000Z
2021-08-22T09:46:59.573Z
<p><img data-src="http://images.xyang.xin/2019-09%2Frhydybs.jpeg?x-oss-process=style/title_140" alt="rhydybs.jpeg-w140"></p>