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
(function() {'use strict'; | |
/** | |
* Handlebars addition helper. | |
* | |
* Usage: | |
* {{addition 10 to="10"}} | |
* {{addition key to="20"}} | |
* {{addition key to="-5"}} | |
*/ | |
Handlebars.registerHelper('addition', function(context, options) { |
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
/*! | |
* @media (min-width: 1200px) { | |
* body:after { | |
* content: 'widescreen'; | |
* display: none; | |
* } | |
* } | |
*/ | |
export default () => window.getComputedStyle(document.body, ':after').getPropertyValue('content'); |
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
net: | |
ipv6: true | |
storage: | |
dbPath: "C:/MongoDB/data" | |
directoryPerDB: true | |
journal: | |
enabled: true | |
wiredTiger: | |
engineConfig: | |
cacheSizeGB: 2 |
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
<scheme name="Forrst" version="142" parent_scheme="Default"> | |
<metaInfo> | |
<property name="created">2023-03-29T17:02:29</property> | |
<property name="ide">WebStorm</property> | |
<property name="ideVersion">2023.1.0.0</property> | |
<property name="modified">2023-03-29T17:03:46</property> | |
<property name="originalScheme">Forrst</property> | |
</metaInfo> | |
<colors> | |
<option name="CARET_COLOR" value="8961e" /> |
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 | |
# Generates monthly Git reports | |
# Usage: `sh git-report.sh [ample]` | |
author=$(git config user.name) | |
ample=$(expr "$1" == 'ample') | |
date=$(date +%Y-%m-%d) | |
foretime=$(date +%Y-%m-01) | |
fullpath="$PWD" | |
target=reports/report-${date} |
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, |
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
#!/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 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
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) => { |
OlderNewer