今日係 NodeJs 上用 Jest 寫 Unit Test 時出現了以下錯誤信息 ReferenceError: regeneratorRuntime is not defined ReferenceError: regeneratorRuntime is not defined 解決方法: 只要在 NodeJs Project 上安裝 babel-polyfill package 之後在 Unit Test file 上 import babel-polyfill 便可 e.g.
今日無聊時發現了 Windows 有一個可以檢查電池健康度既 Command 十分有趣 我們只需要在 Windows 的 Command Prompt 上輸入以下的指令 powercfg /batteryreport Windows Command check battery health 之後便會建立一份和你部電腦電池健康度的 report 是 HTML format e.g.
今日睇 Chrome 個 console 見到以下的 error message Manifest: found icon with no valid size. Manifest: found icon with no valid size
用了 ReactJS 一段時間…想看看有沒有更新可以使用.. 希望可以使用 yarn upgrade 來更新… 但是更新了 package.json 的 dependencies 之後便出現了很多webpack 的 error 最後到了create-react-app page 的 CHANGELOG.md …跟著他的 migration guide 便可以更新到了… 原來解決方法十分簡單… 我們只需要跟著 mirgration guide 的 command 來更新 react-script 便可以 e.g.
剛剛在寫 reactjs publish 上去 Firebase 之後出現了以一的 error message `` 之後便顯示唔到這個 react page 了 做了一會 research 之後發現應該是 redux compose 既問題 解決方法: 我改了之前的 const store = createStore( reducers, initialState, compose( applyMiddleware(...middleware), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() ) ); 改成這樣便可以了 const store = createStore( reducers, initialState, compose( applyMiddleware(...middleware), window.REDUX_DEVTOOLS_EXTENSION ? window.REDUX_DEVTOOLS_EXTENSION() : (f) => f ) ); Hope you find it useful
使用 FFmpeg 來轉換 Video 格式十分容易的 首先要知道FFmpeg 可以轉換那些 format 大家可以執行以下的指令看看 ffmpeg -formats 或者參考以下網頁 https://www.ffmpeg.org/ffmpeg-formats.html https://www.ffmpeg.org/general.html#Supported-File-Formats_002c-Codecs-or-Features 轉換 Video format 十分簡單 以下是一些有用的 command mp4 to mkv ffmpeg -i \ [input]mp4] \ -vcodec copy \ -acodec copy \ [output.mkv] mkv to mp4
最近因為種種原因..要轉換不同的Audio / Video format 上網搜尋很久也找不到一些免費又好似做唔到我想要既效果.. 或是要收費 最後發現如果不怕麻煩 花小小時間學習. 其實是可以使用 FFmpeg 這個 program 來做到的.. 之後發現有很多程式都是用ffmpeg 來轉換檔案格式的 在 Windows 上我會使用 Choco 來 Install ffmpeg choco install ffmpeg 我覺得有些如是 command line 使用的 程式 使用 Choco 來安裝好似比較方便
今日遇到一個git 的問題 就是需要更之前 commit 了既一個 filename 的大細階.. e.g. 2020-03-01-Google-sheet-with-google-translate.md 到 2020-03-01-google-sheet-with-google-translate.md 即使在 VS code 上更新了檔案的大小字…. 但是還是 detect 不到 changes… 最後終於找到解決方法 我們可以使用以下的 git command git mv mv Move or rename a file, a directory, or a symlink e.g.
前兩日在 Facebook 上看到一位朋友分享的 Google Document, Google Sheet 的小貼士 我覺得十分有用… 想和大家分享… 原來..我們可以在Google Sheet / Google 試算表 的公式上使用 Google Translate 只需要在 Worksheet 的 Formula 上輪入 =GOOGLETRANSLATE =GOOGLETRANSLATE([文字或 Cell的參考], "原文的語言既 2個位的 language Code (可以不填)","想翻譯的語言既 2個位的 language Code" ) E.g. =GOOGLETRANSLATE("Hello", "en","fr" )
很多時候都是使用BitBucket / Github 去create 新branch 但是久不久BitBucket 的 選擇 Branch的選項..總是選擇不到 UAT 的 最後選擇最原始既方法… 就是使用 command line 了 解決方法: # 首先 checkout 了你想Create branch from 的 branch && git pull git checkout uat && git pull # 使用 git branch 來Create 新 branch git branch [branch-name] # checkout 新建立的branch git checkout [branch-name] # 用以下command push 去remote git push --set-upstream origin [branch-name] 或者可以嘗試這樣..簡短一點