最近用了NodeJs Express 來做 Web App 的 Backend 用左 port 3000 而create-react-app 既 default port 又係 3000 怎樣可以改變create-react-app 既 port 呢 解決方法: 十分簡單… 我們只需要在 package.json 上既 scripts section start 上加上 set PORT=[PORT_YOU_WANTED] 便可 e.g.
最近買了隻 RaspberryPi 4 想安裝 Ubuntu 來做一個 mini-computer 給家人用來做media centre 由於屋企沒有 電腦 Mon 所以 要試東西要連上 TV… 有點麻煩 如果可以安裝 Remote Desktop 便好了 解決方法: sudo apt install xrdp sudo systemctl enable --now xrdp sudo apt-get install mate-core sudo ufw allow from any to any port 3389 proto tcp Hope you find it useful
最近同事介紹左個好正既 SQL Server Management Studio (SSMS) 既 Shortcut key 用來 檢視 Table defination / information of database object 我們只需要在 Query 上 highlight Table 名 之後按 ALT+F1 便可以看到相關係資訊 e.g. 我用了 master.dbo.MSreplication_options 來做例子 功能和 sp_help tablename 一樣
最近嘗試在 React App 上加入 Coverage Report… 可能是因為是用了create-react-app 所以在使用 yarn test 的時候便自己加了 watch mode.. create-react-app test 當有 code change 時便會再 test 一次.. 在 console 上不停顯示 code coverage 便很繁忙了 如果可以在 run code coverage report 時停了 watch 便好
係 GitHub 用 GitHub Page Host 果個 ReactJs Project 由於個 Page 係 Subfolder 同 存放 e.g. https://sharechiwai.github.io/code-playground 而不是 https://sharechiwai.github.io 所以當我 reploy ReactApp 到 GitHub Page 上時 當 click 去任何一條 Link 時..他沒有 suffix code-playground e.g.(contact) 便 navigate 去了 https://sharechiwai.github.io/contact 而不是很聰明地 去 https://sharechiwai.github.io/code-playground/contact
最近用了Windows Defender 的 offline mode 來 scan 電腦睇下有無中毒… 有時電腦有 Error 都可以使用 Windows 的 Event Viewer 睇返個 Event Log 去了解下出現什麼問題… 有時候開啟 Event Viewer 時由於太多 log 既關係… 所以要 load 很久… 還有..有時想睇既 Log 可能好難搵… Event Viewer
好耐都無掂過 ASP.Net MVC… 之前有朋友叫我幫佢睇下個 project 發現佢個 Registration Form 有個小小問題.. 就係唔識行 Client-side Validation 每次按 Register button 都會 做一個 Post 之後先會出現.. Validation Error message 睇左佢個 Model , Controller 同 View (.cshtml) 都沒有問題… 再花多了一些時間.. 終於發現那裡出現問題了…
今日需要在 git 上去 gitignore 一個之前已經 commit 了既 file 解決放法 我們可以使用以下 git command 去 untrack 之前 commit 左既 file git rm --cached [filename] e.g. git rm --cached appsetting.Development.json 之後在 .gitignore 上加入你想 ignore 的檔案名便可
最近朋友介紹使用Codecov 來顯示 project 上的 Unit Test 既 Code Coverage 由於他需要把資料夾coverage 上的 一個檔案 clover.xml 放進 repository 上.. 但是 default 的 .gitignore 已經把 coverage 整個資料夾 exclude 了.. 那麼我們如何把在.gitignore已經 exclude 左既 folder 上的一個檔案 include 返去 git 入面呢?