[速記] 如果在 Next.js 專案中有使用 DOMPurify 套件,在編譯時會發生以下錯誤
Can't resolve 'canvas'
Can't resolve 'bufferutil'
Can't resolve 'utf-8-validate'
這是因為 DOMPurify 套件在編譯時會使用到 canvas 和 bufferutil 套件,但是這兩個套件在 Next.js Server Component 上是不支援的,所以會發生錯誤。
[速記] 如果在 Next.js 專案中有使用 DOMPurify 套件,在編譯時會發生以下錯誤
Can't resolve 'canvas'
Can't resolve 'bufferutil'
Can't resolve 'utf-8-validate'
這是因為 DOMPurify 套件在編譯時會使用到 canvas 和 bufferutil 套件,但是這兩個套件在 Next.js Server Component 上是不支援的,所以會發生錯誤。
var googleDataEvents = { | |
pageTracker: null, | |
init: function (document) { | |
document.find("a[data-ga-label],area[data-ga-label]").click(this.trackLink); | |
}, | |
trackLink: function (e) { | |
if (_gaq) { | |
e.preventDefault(); | |
var l = $(this); | |
var label = l.attr("data-ga-label"); |
會有這個想法,是因為原始全域設定中,我設定的 user
資訊中,是使用我個人的 GMail 信箱
而隨著各專案的屬性不同,例如: 公司專案,需要使用的就是公司的 Email
但又不想每個專案都再建一份 .gitconfig
設定
於是,可以使用以下方式
在 git 2.13 版後,可以使用判斷條件 Conditional includes
在全域設定 ~/.gitconfig
中指定特定專案目錄下載入指定的 gitconfig
# commit log 請遵造以下格式,並注意冒號後面有一個空格 | |
# | |
# <type>: <subject> {必要} | |
# | |
# <body> {非必要} | |
# | |
# <footer> {非必要} | |
# | |
# 範例 | |
# feat: implementation login api function |
#!/usr/bin/env python | |
""" | |
Git commit hook: | |
.git/hooks/commit-msg | |
Check commit message according to angularjs guidelines: | |
* https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# | |
""" | |
import sys | |
import re |
簡單說,就是儘可能把工作都拆分成最小單位的功能,儘可能的送最小的提交內容,才可以比較快透過 Code Review 檢視對應的開發品質和問題
Problem: My team likes to have big bulky commits. Solution: Start dividing your work into smaller commits. When your team sees the clear benefits of reviewing your code, they will most likely follow.
儘量安排在一天內分配一些時間去執行 Code Review,如果無法做到,至少也要嘗試用 60/70/80 分鐘來執行 Code Review,儘量不要把自己搞到還要另外加班做這件事