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
// LIBRARY TYPES | |
type _Arr<N, Result extends number[] = []> = Result['length'] extends N ? Result : _Arr<N, [...Result, 1]>; | |
type _Decrement<N extends number> = _Arr<N> extends [any, ...infer U] ? U['length'] : 0; | |
type _Concat<S1 extends string, S2 extends string> = [S1] extends [never] | |
? [S2] extends [never] | |
? '' | |
: S2 | |
: [S2] extends [never] |
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
# Open following directory in (shell) terminal: | |
# for Windows: C:\Users\<insert_your_user_name>\AppData\Roaming\Code\User\History | |
# for Linux/WSL: /home/<insert_your_user_name>/.vscode-server/data/User/History | |
# Run command (template): | |
grep -rl '<some unique text from your setttings>' 2>/dev/null | xargs -I {} ls -al --time-style=long-iso "$PWD/{}" | sort -kr5,5 -kr6,6 | |
# For example: | |
grep -rl '"editor.defaultFormatter":' 2>/dev/null | xargs -I {} ls -al --time-style=long-iso "$PWD/{}" | sort -kr5,5 -kr6,6 |
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
////////////////////////////////////////////// | |
//////// test/jest-unwrap-console.ts ///////// | |
////////////////////////////////////////////// | |
import * as originalConsole from 'console'; | |
// Hi, Jest! Thx, for redundant ugly console wrapping which I didn't ask for | |
global.console = originalConsole; | |
////////////////////////////////////////////// | |
/////////////// jest.config.ts /////////////// |
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
// Converts number or string containing numbers to "easy readable" word | |
const vowels = 'aeiouy'; | |
const consonants = 'bcdfgklmnprstvwxz'; // without 'hjq' | |
function toWord (number, maxLen = Infinity) { | |
let vowelsIndex = -1; | |
let consonantsIndex = -1; | |
return number.toString() | |
.replace(/(^0)?\./, '') |
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
#!/bin/bash | |
# Appends commit message with issue number in format (for example, if your branch has name like `feature/ISSUE-1234-make-world-better`): | |
# "Commit message" #ISSUE-1234 | |
COMMIT_MSG_FILE=$1 | |
# Include any branches for which you wish to disable this script | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(main master develop) |