Type | Description |
---|---|
feat | A new feature |
fix | A bug fix |
docs | Changes in documentation |
style | Everything related to styling |
refactor | Code changes that neither fix a bug nor add a feature |
test | Everything related to testing |
chore | Updating build tasks, package manager configs, etc |
perf | Performance improvements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CURRENCY_FORMATTER = new Intl.NumberFormat(undefined, { | |
currency: "INR", | |
style: "currency", | |
}); | |
export function formatCurrency(number: number) { | |
return CURRENCY_FORMATTER.format(number); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Move backward one commit back | |
alias gitbwd='git log --all --decorate --oneline | grep -A 1 $(git rev-parse --short HEAD) | awk "{print \$1}" | tail -1 | xargs -I {} git checkout {}' | |
# Move forward one commit up | |
alias gitfwd='git log --all --decorate --oneline | grep -B 1 $(git rev-parse --short HEAD) | awk "{print \$1}" | head -1 | xargs -I {} git checkout {}' | |
# See the files names that got changed between the commit | |
alias cdiff='git diff --name-only HEAD~1 HEAD' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function timeAgo(value: string) { | |
const seconds = Math.floor((new Date().getTime() - new Date(value).getTime()) / 1000) | |
let interval = seconds / 31536000 | |
const rtf = new Intl.RelativeTimeFormat("en", { numeric: 'auto' }) | |
if (interval > 1) { return rtf.format(-Math.floor(interval), 'year') } | |
interval = seconds / 2592000 | |
if (interval > 1) { return rtf.format(-Math.floor(interval), 'month') } | |
interval = seconds / 86400 | |
if (interval > 1) { return rtf.format(-Math.floor(interval), 'day') } | |
interval = seconds / 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -fflags +genpts -i input.webm output.mp4 |