June 16, 2018DevTools: Retrieving objects which were created from the constructorChrome 的 DevTools 原先就內建很多實用的 Command Line API,現在又多一個好用的 queryObjects(Constructor),ummar 照慣例錄了一段 .gif ,附在 …Read more
May 22, 2018JavaScriptES2018:RegExp 新功能介紹/s flag 為了解決目前的 dot(.) 無法比對到換行字元,因此新的 /s flag 又稱 dotAll mode。 const input = ` Lorem ipsum dolor sit amet, consectetur adipiscing hello world elit. Nam sit amet elit id risus aliquam porta. `; /hello.world/u.test(input); // false workarounds: /hello[\s\S]world/u.test(input); // true /hello[^]world/u.test(input) // true 新語法 …Read more
May 12, 2018command-line, LinuxBash/Zsh 環境變數載入順序login 與 non-login 為什麼要先談這個?因為 login shell 與 non-login shell,載入的檔案不同,這邊參照鳥哥的說明: login shell:取得 bash 時需要完整的登入流程的,就稱為 login sh …Read more
April 2, 2018GitCheckout GitHub/Gitlab Pull Request Locally專案目錄底下的 .git/config 檔案內,記錄有 Git 的 remote url,如果是 GitHub,長相類似這樣: [remote "origin"] url = [email protected]:akccakcctw/project.git fetch = +refs/heads/*:refs/remotes/origin/* 只要在下面新增一行 fetch = +refs/pull/* …Read more
March 10, 2018在 macOS 上安裝 DockerOption 1: 使用官網提供的安裝包 在官網可以直接下載 Stable 或 Edge 版的 Docker.dmg 安裝,新的安裝包會安裝「Docker for Mac」,裡面包含 Docker Engine、Docker …Read more
March 8, 2018vimVim 如何在 insert mode 換行使用 Vim 好一陣子了,但一直有個地方覺得不順,就是在打到要換行的時候,需要先按 <Esc> 回到 Normal mode 再按 o。儘管可以用 <C-[> 代替 Esc,右手還是有按錯的可能性, …Read more
January 25, 2018vim更新 Homebrew 後,啟動 vim 的問題今天更新 Homebrew 之後,啟動 vim 時顯示錯誤: dyld: Library not loaded: /usr/local/opt/ruby/lib/libruby.2.4.3.dylib Referenced from: /usr/local/bin/vim Reason: image not found [1] 52248 abort vim 找到類似問題,原因是 vim 依賴舊版的 ruby,所以更新後無法啟動,解決方法是重 …Read more
January 20, 2018command-line, LinuxLinux command-line: find 指令用法常用參數 type f: file d: directory l: symbolic p: pipe s: socket name iname: ignore case path mtime: modify time (day) atime: access time (day) ctime: create time (day) mmin: (minute) amin: (minute) cmin: (minute) size or: 可以簡寫為 -o not: 可以簡寫為 ! exec: execute delete 基本用法 # name find . -name findme # 找 'findme' find …Read more
December 31, 2017Linux, command-lineArch Linux:Surface Pro 4 安裝筆記八月多買了 Surface Pro 4 之後,就想著要灌 Linux 方便寫程式,但是擔心硬體支援度(觸控螢幕、雙鏡頭、鍵盤保護蓋、手寫筆……)還有保固,一些有的沒有的問題,所 …Read more
December 12, 2017Linux, command-lineArch Linux:環境設定與常用套件GNOME 桌面設定 匯出與匯入設定檔 # 匯出 dconf dump / >~/.config/dconf/user.conf # 匯入 dconf load / <~/.config/dconf/user.conf 中文輸入法以及中文環境 安裝 fcitx(注音) fcitx 相關說明維基寫得很清楚,建議看一下。 # fcitx-im …Read more