<?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 WanCW on Medium]]></title>
        <description><![CDATA[Stories by WanCW on Medium]]></description>
        <link>https://medium.com/@wancw?source=rss-a6ea2417f64e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g9R7eAuM18wVD8uMhID7wg.jpeg</url>
            <title>Stories by WanCW on Medium</title>
            <link>https://medium.com/@wancw?source=rss-a6ea2417f64e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:12:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wancw/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[搬家啦]]></title>
            <link>https://medium.com/@wancw/%E6%90%AC%E5%AE%B6%E5%95%A6-49ab7e7e1cbb?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/49ab7e7e1cbb</guid>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Sun, 29 Oct 2023 09:57:56 GMT</pubDate>
            <atom:updated>2023-10-29T09:57:56.070Z</atom:updated>
            <content:encoded><![CDATA[<p>最近又開始寫網誌了～（這次可以持續多久呢？）<br>這次改用 Hugo + GitHub Pages，位置在 <a href="https://blog.plk.tw/">https://blog.plk.tw/</a>。</p><p>花了一個下午把 Medium 這邊的文章都轉成 Markdown 搬到新站去了，就順便來這邊公告一下。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49ab7e7e1cbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[如何在 Scrum 裡處理技術債]]></title>
            <link>https://medium.com/@wancw/%E5%A6%82%E4%BD%95%E5%9C%A8-scrum-%E8%A3%A1%E8%99%95%E7%90%86%E6%8A%80%E8%A1%93%E5%82%B5-5f7216a266a?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f7216a266a</guid>
            <category><![CDATA[technical-debt]]></category>
            <category><![CDATA[scrum]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Wed, 15 Jan 2020 07:30:54 GMT</pubDate>
            <atom:updated>2020-01-15T07:30:54.832Z</atom:updated>
            <content:encoded><![CDATA[<p>在 Twitter 上問了這個問題，</p><h3>WanCW on Twitter</h3><p>萬事問推友 各位跑 Scrum 的工程師推友，貴團隊如何在 sprint 中安排大規模重構或各種償還技術債的 task？</p><p>把推友的回應整理如下，具體討論可以看上面的連結或是 Treeverse 整理的結果： <a href="https://treeverse.app/view/RWFE8jdz">https://treeverse.app/view/RWFE8jdz</a></p><h4>如何形成 task</h4><p>依修正幅度小到大：</p><ol><li>在既有的 task 中一併處理 → 把時間估長一點</li><li>開單獨的 task 排進 backlog，如同其他 story task</li><li>規模太大的話可以考慮切成單獨的獨立 project</li></ol><h4>如何在 sprint 中安排 tech-only task</h4><ol><li>找 feature 比較少、較鬆的 sprint 再拉進來做</li><li>或是每個 sprint 留一定比例給這類 task</li><li>也可以如同一般 story task，丟進 backlog 後由 PO 決定順序<br>（要讓 PO 了解技術債的影響，例如：造成往後 feature task 的時間、點數上升）</li></ol><h4>策略、心態</h4><ol><li>從商業角度來看，每個 sprint 的重點還是要依 PO、stackholder 預期產出功能</li><li>要能量化修技術債、重構的成果，以說服 PO、stakeholder</li></ol><h4>相關技術</h4><ul><li>如果不是短期可以完成的修改，可以考慮採用 <a href="https://docs.microsoft.com/en-us/azure/architecture/patterns/strangler">Strangler</a> 或相關 pattern</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f7216a266a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[升級 npm 內附的 node-gyp]]></title>
            <link>https://medium.com/@wancw/note-%E5%8D%87%E7%B4%9A-npm-%E5%85%A7%E9%99%84%E7%9A%84-node-gyp-3591ca33b4ee?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3591ca33b4ee</guid>
            <category><![CDATA[asdf]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[node-gyp]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Sat, 04 Jan 2020 02:33:14 GMT</pubDate>
            <atom:updated>2020-01-04T03:14:34.866Z</atom:updated>
            <content:encoded><![CDATA[<p>目前 npm (6.13.14) 用的 node-gyp (5.0.5) 在 macOS + Python 3 的環境會踩到這個 bug：</p><p><a href="https://github.com/nodejs/node-gyp/issues/1917">TypeError: &#39;&gt;=&#39; not supported between instances of &#39;tuple&#39; and &#39;str&#39; · Issue #1917 · nodejs/node-gyp</a></p><p>必須自己升級 npm 底下的 node-gyp。</p><p>一般狀況下，參考 <a href="https://github.com/nodejs/node-gyp/wiki/Updating-npm&#39;s-bundled-node-gyp">https://github.com/nodejs/node-gyp/wiki/Updating-npm&#39;s-bundled-node-gyp</a> 跑下面這行指令就好了</p><pre>&gt; npm explore npm -g -- npm install node-gyp@latest</pre><p>但如果你剛好跟我一樣：1）用 asdf-vm 、2）用 yarn、3）升級過 npm，那就得改成：</p><pre>&gt; cd $(asdf where nodejs)/lib/node_modules/npm</pre><pre>&gt; npm install node-gyp@latest</pre><p>原因如下：</p><ol><li>yarn 只會在 Node.js 內附的 npm 路徑底下找 node-gyp</li><li>asdf-nodejs 會設定 NPM_CONFIG_PREFIX，所以更新的 npm 不會蓋掉原先附的。</li><li>而 npm explore 處理的是更新過的 npm</li></ol><p>總之就是個踩坑紀錄……</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3591ca33b4ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Node.js] 用 request 送出同名多值的 form/query parameter]]></title>
            <link>https://medium.com/@wancw/node-js-%E7%94%A8-request-%E9%80%81%E5%87%BA%E5%90%8C%E5%90%8D%E5%A4%9A%E5%80%BC%E7%9A%84-form-query-parameter-ced3cecf22fc?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ced3cecf22fc</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Fri, 14 Jun 2019 07:49:28 GMT</pubDate>
            <atom:updated>2019-06-14T07:49:28.054Z</atom:updated>
            <content:encoded><![CDATA[<p>以 form POST 為例，一般寫法：</p><pre>request.post({<br>    url: ...,<br>    form: {<br>        paramKey: [ &#39;value 1&#39;, &#39;value 2&#39; ],<br>    }<br>}, (error, response, body) =&gt; { ... });</pre><p>會送出這樣的 request body（key 後面加上 [0]、[1]、……）：</p><pre>paramKey%5B0%5D=value+1&amp;paramKey%5B1%5D=value+2</pre><p>如果想像這樣重複送出同樣的 key：</p><pre>paramKey=value+1&amp;paramKey=value+2</pre><p>可以</p><pre>request.post({<br>    url: ...,<br>    form: {<br>        paramKey: [ &#39;value 1&#39;, &#39;value 2&#39; ],<br>    },<br><br>    // 改用內建的 querystring 模組<br>    useQueryString: true,    </pre><pre>}, (error, response, body) =&gt; { ... });</pre><p>或是：</p><pre>request.post({<br>    url: ...,<br>    form: {<br>        paramKey: [ &#39;value 1&#39;, &#39;value 2&#39; ],<br>    },</pre><pre>    // 指定給 qs 的參數<br>    qsStringifyOptions: {<br>        arrayFormat: &#39;repeat&#39;,<br>    },</pre><pre>}, (error, response, body) =&gt; { ... });</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ced3cecf22fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[在本地端跑 GitLab CI job]]></title>
            <link>https://medium.com/@wancw/%E5%9C%A8%E6%9C%AC%E5%9C%B0%E7%AB%AF%E8%B7%91-gitlab-ci-job-989a4a60eadc?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/989a4a60eadc</guid>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[gitlab]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 08:57:26 GMT</pubDate>
            <atom:updated>2019-04-17T02:26:19.021Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://docs.gitlab.com/runner/">gitlab-runner</a> 可以直接在本地端跑 .gitlab-ci.yml 中定義的 job；但比較麻煩的是它不會讀 config.toml，所以得給不少 command line 參數。<br>記錄一下方便以後找：</p><h4>docker-in-docker</h4><pre>gitlab-runner exec docker &lt;job_name&gt; \<br>    --docker-volumes /var/run/docker.sock:/var/run/docker.sock</pre><h4>設定 job 的環境變數</h4><pre>gitlab-runner exec shell &lt;job_name&gt; \<br>    --env &quot;ENV_VAR_1=value1&quot; \<br>    --env &quot;ENV_VAR_2=value2&quot;</pre><h4>後記</h4><p>其實這些命令列參數也都可以透過對應的環境變數；但是不支援多值，上面兩個情境就不太適合。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=989a4a60eadc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iTerm2 + SSH + tmux]]></title>
            <link>https://medium.com/@wancw/iterm2-ssh-tmux-73d3fcf9dac6?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/73d3fcf9dac6</guid>
            <category><![CDATA[iterm2]]></category>
            <category><![CDATA[tmux]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 03:34:58 GMT</pubDate>
            <atom:updated>2019-04-16T03:34:58.304Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.iterm2.com/documentation-tmux-integration.html">iTerm2</a> 可以作為 tmux <a href="http://man7.org/linux/man-pages/man1/tmux.1.html#CONTROL_MODE">control mode</a> 的 client，只要：</p><pre>tmux -CC [new|attatch|..]</pre><p>就可以用原生介面操作 tmux 的 window、pane。</p><h4>遠端 session</h4><p>因為是透過 terminal 文字溝通，所以也適用遠端的 tmux session。<br>通常會連上遠端機器後立刻執行 tmux -CC ...，或是乾脆用 command line 參數直接跑。但還是覺得有點麻煩，就在 ssh_config 加了一個 host alias：</p><pre>Host terminus-tmux<br>  Hostname 192.168.1.42<br>  RequestTTY yes<br>  RemoteCommand tmux ls | grep -vq attached &amp;&amp; tmux -CC a || tmux -CC new</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73d3fcf9dac6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript 有條件增加物件屬性的簡短寫法]]></title>
            <link>https://medium.com/@wancw/javascript-%E6%9C%89%E6%A2%9D%E4%BB%B6%E5%A2%9E%E5%8A%A0%E7%89%A9%E4%BB%B6%E5%B1%AC%E6%80%A7%E7%9A%84%E7%B0%A1%E7%9F%AD%E5%AF%AB%E6%B3%95-e16dd8b7d1d7?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e16dd8b7d1d7</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Fri, 29 Mar 2019 02:17:37 GMT</pubDate>
            <atom:updated>2019-03-29T02:17:37.844Z</atom:updated>
            <content:encoded><![CDATA[<p>從 <a href="https://dev.to/jfet97/the-shortest-way-to-conditional-insert-properties-into-an-object-literal-4ag7">The shortest way to conditional insert properties into an object literal</a> 看到的。例如，為了避免出現 undefined 的 property ，通常會這樣寫：</p><pre>const obj = {};<br>if (input1) {<br>    obj.prop1 = input1;<br>}<br>if (input2) {<br>    obj.prop2 = input2;<br>}</pre><p>可以寫成：</p><pre>const obj = {<br>    ...input1 &amp;&amp; { prop1: input1 }<br>    ...input2 &amp;&amp; { prop2: input2 }<br>};</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e16dd8b7d1d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript 的 diff 套件]]></title>
            <link>https://medium.com/@wancw/javascript-%E7%9A%84-diff-%E5%A5%97%E4%BB%B6-c801afcf05d9?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c801afcf05d9</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[diff]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Fri, 22 Mar 2019 08:34:59 GMT</pubDate>
            <atom:updated>2019-03-22T08:38:02.364Z</atom:updated>
            <content:encoded><![CDATA[<p>以前都用 <a href="https://www.npmjs.com/package/diff">diff</a>，它能以字元（char）、單字（word）、行（line）、句（sentences）為單位比較；但是只能處理「行」為單位的 patch 。</p><p>最近發現 Google 的 <a href="https://github.com/google/diff-match-patch">diff-match-patch</a> 能處理「字元」的 patch，而且支援非常多語言（C++、C#、Java、JavaScript、Python、……）。也有人把它包成 npm package：<a href="https://www.npmjs.com/package/diff-match-patch">diff-match-patch - npm</a>。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c801afcf05d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 套用 Go 寫的開發者工具]]></title>
            <link>https://medium.com/@wancw/10-%E5%A5%97%E7%94%A8-go-%E5%AF%AB%E7%9A%84%E9%96%8B%E7%99%BC%E8%80%85%E5%B7%A5%E5%85%B7-6ba192daca1f?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ba192daca1f</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Mon, 25 Feb 2019 07:16:10 GMT</pubDate>
            <atom:updated>2019-02-25T07:16:10.281Z</atom:updated>
            <content:encoded><![CDATA[<p>簡單整理一下 <a href="https://golang.works-hub.com/learn/10-tools-written-in-go-that-every-developer-needs-to-know-6d45d">10 tools written in Go that every developer needs to know</a>，當作自己的備忘。</p><ol><li>Caddy - <a href="https://caddyserver.com/">https://caddyserver.com</a><br>輕量的 HTTP/2 web server，透過 Let’s Encrypt 自動配置 HTTPS。</li><li>Ngrok - <a href="https://ngrok.com/">https://ngrok.com</a><br>幫本地 server 提供公開端點，支援 HTTP、HTTPS → HTTP、non-HTTP over TLS、TCP。不過是要註冊、收費的服務。</li><li>ctop - <a href="https://ctop.sh/">https://ctop.sh/</a><br>類似 <a href="https://en.wikipedia.org/wiki/Top_(software)">top</a>，用來看 container 狀態的 TUI 工具。</li><li>GoTTY - <a href="https://github.com/yudai/gotty">https://github.com/yudai/gotty</a><br>把 CLI/TUI 轉變成 web application。（這感覺超危險的啊……</li><li>Mattermost (server) - <a href="https://mattermost.com/">https://mattermost.com</a><br>開源的 Slack 替代方案。前陣子發現 GitLab 的 Omnibus <a href="https://docs.gitlab.com/omnibus/gitlab-mattermost/">有把 Mattermost 包進去</a>。</li><li>Minio - <a href="https://minio.io/">https://minio.io</a><br>提供相容於 AWS S3 API 的開源替代品，也可以當 gateway 後面接 Google Cloud Storage、Azure Blob Storage、NAS。</li><li>Piknik - <a href="https://github.com/jedisct1/piknik">https://github.com/jedisct1/piknik</a><br>跨裝置的加密「剪貼簿」</li><li>Pgweb - <a href="https://sosedoff.github.io/pgweb">https://sosedoff.github.io/pgweb</a><br>PostgreSQL 的 Web 介面</li><li>pRest - <a href="https://postgres.rest/">https://postgres.rest</a><br>把 SQL 資料庫包裝成 RESTful API，目前只支援 PostgreSQL、MySQL 開發中。（想不到這樣做有什麼好處……</li><li>Terraform - <a href="https://www.terraform.io/">https://www.terraform.io</a><br>無需多言，知名的 Infrastructure-as-Code 工具。</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ba192daca1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker build 不留下 SSH private key]]></title>
            <link>https://medium.com/@wancw/docker-build-%E4%B8%8D%E7%95%99%E4%B8%8B-ssh-private-key-ce95ee047b61?source=rss-a6ea2417f64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce95ee047b61</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[WanCW]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 01:36:00 GMT</pubDate>
            <atom:updated>2019-02-09T01:36:00.797Z</atom:updated>
            <content:encoded><![CDATA[<p>我以前是用 <a href="https://github.com/dockito/vault">dockito/vault</a>；Docker 17.05 後可以使用 multi-stage；Docker 18.09 後則可以使用 BuildKit 的 SSH mount type：</p><h4>Dockerfile</h4><p>這行加在 Dockerfile 最前面：</p><pre># syntax=docker/dockerfile:1.0.0-experimental</pre><p>在需要用到 SSH private key 的地方加上 --mount=type=ssh</p><pre># 使用預設的 id 為 &quot;default&quot;<br>RUN --mount=type=ssh do_something</pre><h4>執行 docker build</h4><pre>export DOCKER_BUILDKIT=1<br>docker build --ssh default=/path/to/ssh/private/key</pre><ul><li>參考資料：<a href="https://medium.com/@amimahloof/securely-build-small-python-docker-image-from-private-git-repos-c3e6d5da4626">https://medium.com/@amimahloof/securely-build-small-python-docker-image-from-private-git-repos-c3e6d5da4626</a></li><li>也能指定不同的 id 給 SSH key，細節可參考 <a href="https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/experimental.md#run---mounttypessh">BuildKit 的文件</a>。</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce95ee047b61" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>