Blog

Create-React-App test without watch mode

最近嘗試在 React App 上加入 Coverage Report… 可能是因為是用了create-react-app 所以在使用 yarn test 的時候便自己加了 watch mode.. create-react-app test 當有 code change 時便會再 test 一次.. 在 console 上不停顯示 code …

ReactJs set base path -

係 GitHub 用 GitHub Page Host 果個 ReactJs Project 由於個 Page 係 Subfolder 同 存放 e.g. https://sharechiwai.github.io/code-playground 而不是 https://sharechiwai.github.io 所以當我 reploy ReactApp 到 …

Where Event Log files store on Windows - Event Log 檔案在那裡

最近用了Windows Defender 的 offline mode 來 scan 電腦睇下有無中毒… 有時電腦有 Error 都可以使用 Windows 的 Event Viewer 睇返個 Event Log 去了解下出現什麼問題… 有時候開啟 Event Viewer 時由於太多 log 既關係… 所以要 load 很久… 還有..有時想睇既 Log …

ASP.Net MVC client-side validation

好耐都無掂過 ASP.Net MVC… 之前有朋友叫我幫佢睇下個 project 發現佢個 Registration Form 有個小小問題.. 就係唔識行 Client-side Validation 每次按 Register button 都會 做一個 Post 之後先會出現.. Validation Error message 睇左佢個 Model , …

How to untrack committed file - 如果在git 上 untrack committed file

今日需要在 git 上去 gitignore 一個之前已經 commit 了既 file 解決放法 我們可以使用以下 git command 去 untrack 之前 commit 左既 file git rm --cached [filename] e.g. git rm --cached appsetting.Development.json 之後在 …

How to untrack committed file - 如果在git 上 untrack committed file

今日需要在 git 上去 gitignore 一個之前已經 commit 了既 file 解決放法 我們可以使用以下 git command 去 untrack 之前 commit 左既 file git rm --cached [filename] e.g. git rm --cached appsetting.Development.json 之後在 …

.gitignore include a file from excluded folder

最近朋友介紹使用Codecov 來顯示 project 上的 Unit Test 既 Code Coverage 由於他需要把資料夾coverage 上的 一個檔案 clover.xml 放進 repository 上.. 但是 default 的 .gitignore 已經把 coverage 整個資料夾 exclude 了.. 那麼我們如何把在 …

ReferenceError: regeneratorRuntime is not defined jest nodejs

今日係 NodeJs 上用 Jest 寫 Unit Test 時出現了以下錯誤信息 ReferenceError: regeneratorRuntime is not defined ReferenceError: regeneratorRuntime is not defined 解決方法: 只要在 NodeJs Project 上安裝 …

How to check battery health on Windows - 如果在Windows 上檢查電池健康度.

今日無聊時發現了 Windows 有一個可以檢查電池健康度既 Command 十分有趣 我們只需要在 Windows 的 Command Prompt 上輸入以下的指令 powercfg /batteryreport Windows Command check battery health 之後便會建立一份和你部電腦電池健康度的 report 是 HTML …

Manifest: found icon with no valid size.

今日睇 Chrome 個 console 見到以下的 error message Manifest: found icon with no valid size. Manifest: found icon with no valid size