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
#!/usr/bin/env bash | |
# In case of "creating events dirs: mkdir /run/user/1000/libpod: permission denied" | |
sudo rm -rf ${HOME}/.local/share/containers |
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 const isoDateRex = /^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/; |
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
#!/usr/bin/env bash | |
# Ignores active change(s) in Git repo | |
# Mostly useful within CICD pipelines | |
# Usage: `sh git-drain.sh` | |
git status --porcelain | cut -c4- | xargs -n1 git update-index --assume-unchanged |
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
// npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint eslint-config-ultra-refined typescript --save-dev | |
module.exports = { | |
extends: ['ultra-refined'], | |
overrides: [ | |
{ | |
extends: [ | |
'ultra-refined', | |
'plugin:@typescript-eslint/recommended', | |
], | |
files: [ |
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
#!/usr/bin/env bash | |
# Removes remote merged branches from Git repo | |
# Usage: `sh git-broom.sh` | |
protect='(dev|main|master|release)' | |
git fetch --prune --tags origin | |
git branch --remotes --merged origin | grep origin | grep -v $(git symbolic-ref --short HEAD) | egrep -v $protect | sed s/origin\\/// | xargs git push origin --delete |
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 const toBigInt = (value, radix = 36) => { | |
return [...value.toString()].reduce((acc, val) => (acc * BigInt(radix)) + BigInt(parseInt(val, radix)), 0n); | |
}; | |
export const gen = (date = Date.now()) => { | |
return ((BigInt(date) << (64n - 41n)) ^ (BigInt(crypto.getRandomValues(new Uint8Array(32)) | |
.join('')) % (2n ** (64n - 41n)))); | |
}; | |
export const time = (uuid) => { |
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
#!/usr/bin/env bash | |
# Warns before pushing to protected branches | |
# Bypass with `git push --no-verify` | |
countdown=15 | |
current=$(git rev-parse --abbrev-ref HEAD) | |
protect='^(main|master|release|patch-*)' | |
status=0 | |
if [[ "$current" =~ $protect ]]; then |
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
#!/usr/bin/env bash | |
# Warns before pushing to protected branches | |
# Bypass with `git push --no-verify` | |
current=$(git rev-parse --abbrev-ref HEAD) | |
protect='^(main|master|release|patch-*)' | |
status=0 | |
if [[ "$current" =~ $protect ]]; then | |
while true; do |
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
#!/usr/bin/env bash | |
# Warns before committing if staged files contains focused tests | |
# Bypass with `git commit --no-verify` | |
dict=(describe.only it.only test.only) | |
status=0 | |
for keyword in "${dict[@]}"; do | |
rex="/^s*${keyword%.*}.*(?=${keyword#*.})/" | |
files=$(git diff --staged -G${rex} --name-only) |
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
{ | |
"debug.terminal.clearBeforeReusing": true, | |
"debug.toolBarLocation": "docked", | |
"editor.codeActionsOnSave": { | |
"source.organizeImports": "explicit" | |
}, | |
"editor.fontSize": 13, | |
"editor.formatOnPaste": true, | |
"editor.formatOnSave": true, | |
"editor.formatOnType": true, |
NewerOlder