<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by JohnnyLau on Medium]]></title>
        <description><![CDATA[Stories by JohnnyLau on Medium]]></description>
        <link>https://medium.com/@realjohnnylau?source=rss-2eb1becb8184------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*DM70tO9VeSaE19v7.png</url>
            <title>Stories by JohnnyLau on Medium</title>
            <link>https://medium.com/@realjohnnylau?source=rss-2eb1becb8184------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:41:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@realjohnnylau/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Git 新建分支与 force push]]></title>
            <link>https://medium.com/@realjohnnylau/git-%E6%96%B0%E5%BB%BA%E5%88%86%E6%94%AF%E4%B8%8E-force-push-730005105cc1?source=rss-2eb1becb8184------2</link>
            <guid isPermaLink="false">https://medium.com/p/730005105cc1</guid>
            <category><![CDATA[git-branch]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[JohnnyLau]]></dc:creator>
            <pubDate>Thu, 11 Jul 2019 06:21:48 GMT</pubDate>
            <atom:updated>2019-07-11T06:21:48.616Z</atom:updated>
            <content:encoded><![CDATA[<p>今天搬砖时我将 service 层原先手写文件替换为根据 swagger api 自动生成的文件, 大大的节约了我们组的开发成本, 但新问题接踵而至, 自动生成的文件里, 函数的名称和之前手写的文件函数名称不一致! 这就导致了新项目无法编译, 为了保证代码库的可用性, 我结合了前几天看的 git 知识, 决定先创建个分支, 然后等相应编译错误解决之后再merge回master分支.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qcns42Ypq9qBGPWcGNL2Rw.png" /><figcaption>编译错误</figcaption></figure><p>负责这个项目的前端共有3个小伙伴, 先从我这边的处理开始讲起…</p><p>我的情况是, service文件已经推到了master分支, 并已经修改了相关的文件, 由于git无比的强大, 问题处理起来其实相当简单.</p><ol><li>push 新代码到 master 分支</li><li>git checkout -b dev 创建新分支</li><li>git push origin dev 推送 dev 分支到远端, 为协同工作作准备</li><li>git checkout master 将分支切换回 master</li><li>git log 查询我提交service文件前的commit hash 名 eg. fc18cf11</li><li>将本地 master 分支 reset 到提交 service 文件前的状态</li></ol><pre>git reset --hard fc18cf1</pre><p>7. git push -f origin master 将远端代码库回滚</p><p>至此我这边的操作全部完成.</p><p>其他两位小伙伴只要</p><ol><li>git fetch origin dev 拉取远端 dev 分支</li><li>git checkout dev 切换分支</li><li>完成相应文件修改后再 push 回 dev 分支即可</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=730005105cc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[cea-hpc/robinhood install]]></title>
            <link>https://medium.com/@realjohnnylau/cea-hpc-robinhood-install-fe4ebdfdb60a?source=rss-2eb1becb8184------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe4ebdfdb60a</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[robin-hood]]></category>
            <category><![CDATA[filesystem]]></category>
            <dc:creator><![CDATA[JohnnyLau]]></dc:creator>
            <pubDate>Tue, 27 Nov 2018 04:59:28 GMT</pubDate>
            <atom:updated>2018-11-27T05:00:50.673Z</atom:updated>
            <content:encoded><![CDATA[<ol><li>git clone <a href="https://github.com/cea-hpc/robinhood.git">https://github.com/cea-hpc/robinhood.git</a></li><li>cd robinhood &amp; ./autogen.sh</li><li>./configure — enable-dist make srpm</li><li>cd /root/robinhood/rpms/RPMS/x86_64</li><li>rpm -ivh robinhood-adm-3.1.4–1.x86_64.rpm</li><li>rpm -ivh robinhood-posix-3.1.4–1.amzn2.x86_64.rpm</li><li>cbh-config create_db (create a new config file and database under the db user ‘robinhood’, you should specify the file system in current mounted file system file ‘/etc/mtab’. in this case we use ‘sysfs’)</li><li>robinhood — template=basic.conf</li><li>cd /etc/robinhood.d/</li><li>cp myfs.conf test.conf</li><li>delete fs_scan block, ChangeLog block, lhsm_config block and ‘%include “/home/ec2-user/robinhood/doc/templates/includes/lhsm.inc”’ under the test.conf file since its buggy and useless.</li><li>export FS_TYPE=’sysfs’</li><li>export RH_DB=’robinhood_sysfs’ (write above two lines to .bashrc if you wanna permanently export)</li><li>robinhood — scan — once -f test</li><li>start the fxxking service: service robinhood start</li><li>done!</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe4ebdfdb60a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VSCODE Vim+easymotion 配置]]></title>
            <link>https://medium.com/@realjohnnylau/vscode-vim-easymotion-%E9%85%8D%E7%BD%AE-6b64bba642cf?source=rss-2eb1becb8184------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b64bba642cf</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[vim]]></category>
            <category><![CDATA[hhkb]]></category>
            <dc:creator><![CDATA[JohnnyLau]]></dc:creator>
            <pubDate>Wed, 31 Oct 2018 05:12:38 GMT</pubDate>
            <atom:updated>2018-10-31T05:38:52.652Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMOOpKWJbHsbtDRPA9w3Ow.png" /></figure><p>最近入了 HHKB BT 2 无刻版，使用一周感觉非常爽，薄膜键盘的触感 + 电容键盘的无冲，打字的那一刻，仿佛置身于美墨边境，一边是未知的野蛮，一边是现代的文明，让我第一次体会到了身为程序员的快乐。</p><p>但是使用了一周之后，令人不快的地方来了，HHKB 没有方向键，只能用 FN + ;’[/ 替换。这繁琐的操作在敲代码的时候怎么能忍，自然而然的，我想到了大名鼎鼎的可以用 jkhl 替代方向键的 keymap vim。</p><p>VSCODE + VIM 配置</p><p>首先在 VSCODE 里直接 ⌘K ⌘M，然后左侧点击安装 VIM 插件。恭喜你，你的 vscode 现在已经支持 vim 啦。但仅仅是这样还是不能满足日常编码对于速度的要求，我们还要继续设置一下；</p><p>进入 setting.json 增加如下几行</p><pre>//使用系统粘贴板<br>&quot;vim.useSystemClipboard&quot;: true,</pre><pre>//开启 easymotion<br>&quot;vim.easymotion&quot;: true,</pre><pre>//相对显示代码行数<br>&quot;editor.lineNumbers&quot;: &quot;relative&quot;,</pre><pre>//修复光标经过折叠代码时自动展开的 bug<br>&quot;vim.foldfix&quot;: true,</pre><pre>//映射空格键为 easymotion Start of word 指令快捷键<br>&quot;vim.normalModeKeyBindingsNonRecursive&quot;: [{<br>    &quot;before&quot;: [&quot; &quot;],<br>    &quot;after&quot;: [&quot;leader&quot;, &quot;leader&quot;, &quot;leader&quot;, &quot;b&quot;, &quot;d&quot;, &quot;w&quot;]<br>}]</pre><p>再进入 keybinding.json 增加如下几行</p><pre>    {<br>        &quot;key&quot;: &quot;ctrl+s&quot;,<br>        &quot;command&quot;: &quot;cursorEnd&quot;,<br>        &quot;when&quot;: &quot;editorFocus &amp;&amp; vim.mode == &#39;Insert&#39;&quot;<br>    },<br>    {<br>        &quot;key&quot;: &quot;ctrl+j&quot;,<br>        &quot;command&quot;:&quot;cursorLeft&quot;,<br>        &quot;when&quot;: &quot;editorFocus &amp;&amp; vim.mode == &#39;Insert&#39;&quot;<br>    },<br>    {<br>        &quot;key&quot;: &quot;ctrl+k&quot;,<br>        &quot;command&quot;: &quot;cursorDown&quot;,<br>        &quot;when&quot;: &quot;editorFocus &amp;&amp; vim.mode == &#39;Insert&#39;&quot;<br>    }<br>    ,{<br>        &quot;key&quot;: &quot;ctrl+i&quot;,<br>        &quot;command&quot;:&quot;cursorUp&quot;,<br>        &quot;when&quot;: &quot;editorFocus &amp;&amp; vim.mode == &#39;Insert&#39;&quot;<br>    },<br>    {<br>        &quot;key&quot;: &quot;ctrl+l&quot;,<br>        &quot;command&quot;: &quot;cursorRight&quot;,<br>        &quot;when&quot;: &quot;editorFocus &amp;&amp; vim.mode == &#39;Insert&#39;&quot;<br>    }</pre><p>keybinding 中自定义的意思是，在 vim 的 Insert 模式下，ctrl + [sjkil] 分别对应 跳转到该行代码的末尾(end of line)，光标左下上右移动的意思。</p><p>设置完了之后，你的 vscode 应该会变成这个样子（注意 linenum 的显示）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pghe3buEb1YqCDZzy0nx6w.png" /></figure><p>下面讲下操作：</p><pre>往上跳转 n 行: n + k<br>往下跳转 n 行: n + j<br>跳转到当前页面的某个词的开头(beginning of word): space + 对应键位<br>往前跳转到当前光标所在词的开头(不包括其他符号): b<br>往前跳转到当前光标所在词的连接部分的开头: B<br>往后跳转到当前光标所在词的结尾: e<br>往后跳转到当前光标所在词的连接部分的结尾: E<br>往后跳转到当前光标所在词的下一个词的开头: w<br>往后跳转到当前光标所在词的连接部分的下一个词的开头: W<br>normal mode 下在当前光标前方变成 insert mode: i<br>normal mode 下在当前光标所在行最前方变成 insert mode: I<br>normal mode 下在当前光标后方变成 insert mode: a<br>normal mode 下在当前光标所在行最后方变成 insert mode: A<br>normal mode 下删除当前词并变成 insert mode: cw<br>normal mode 下删除当前括号，引号中所有内容并变成 insert mode: ci+括号/引号 或者直接 cib<br>normal mode 下删除至句末: C<br>insert mode 下切换至 normal mode 并在输入一个指令后变回 insert mode: ctrl + o<br>翻页：ctrl + d 向下 ctrl + u 向上</pre><pre>insert mode 下光标移动: 上文有介绍<br>(还有很多很多可以自定义的 keymap 或者 值得去发现的快捷键，这里抛砖引玉)</pre><p>个人觉得最骚的还是快速跳转，再讲一下：</p><p>首先快速跳转到指定行，根据之前设置的 linenum 显示方法，可以快速操作</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/63/1*JOvRJ_tBeqqen0kRkBuauw.png" /></figure><p>或者，跳转到某个词的开头，直接按 space，你会发现 vscode 会提示你各个词的键位，按下即可（骚不骚</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_m3Ui3EtKr-Rq7j0LRgPQg.png" /></figure><p>有些人会问，你这么设置有什么用。用处太大了，这样设置之后，写代码的时候两只手移动范围是最小的，效率直接 X1000，简直每天都在高X中度过。</p><p>当然你不用 HHKB 用普通键盘也可以。重要的是多练习。</p><p>欢迎转发</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b64bba642cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>