This file contains hidden or 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 | |
| # Check if sharp-cli is installed | |
| if ! command -v sharp &> /dev/null; then | |
| echo "Error: sharp-cli is not installed. Please install it using 'npm install -g sharp-cli'." | |
| exit 1 | |
| fi | |
| # Directories | |
| INPUT_DIR="." |
This file contains hidden or 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 | |
| # Check if ffmpeg is installed | |
| if ! command -v ffmpeg &> /dev/null; then | |
| echo "Error: ffmpeg is not installed. Please install it using 'brew install ffmpeg'." | |
| exit 1 | |
| fi | |
| # Directories | |
| INPUT_DIR="." |
This file contains hidden or 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
| /** | |
| * @see https://stackoverflow.com/questions/9781218/how-to-change-node-jss-console-font-color | |
| * @see https://en.wikipedia.org/wiki/ANSI_escape_code#Colors | |
| */ | |
| export const COLOURS = { | |
| $: (c: number) => (str: string) => `\x1b[${c}m` + str + '\x1b[0m', | |
| gray: (str: string) => COLOURS.$(90)(str), | |
| cyan: (str: string) => COLOURS.$(36)(str), | |
| yellow: (str: string) => COLOURS.$(33)(str), | |
| green: (str: string) => COLOURS.$(32)(str), |
This file contains hidden or 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 | |
| # Check if sharp-cli is installed | |
| if ! command -v sharp &> /dev/null; then | |
| echo "Error: sharp-cli is not installed. Please install it using 'npm install -g sharp-cli'." | |
| exit 1 | |
| fi | |
| # Directories | |
| INPUT_DIR="." |
This file contains hidden or 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
| { | |
| "000000": "Black", | |
| "000044": "Endless Galaxy", | |
| "000066": "Alone in the Dark", | |
| "000088": "Midnight in Tokyo", | |
| "0000aa": "Bohemian Blue", | |
| "0000ee": "Hyperlink Blue", | |
| "0000ff": "Blue", | |
| "00022e": "Illicit Darkness", | |
| "000435": "Oblivion", |
This file contains hidden or 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
| wget -E -H -k -p https://www.example.com/ |
This file contains hidden or 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
| import { readdir } from "node:fs/promises"; | |
| import { extname, resolve } from "node:path"; | |
| async function* walkDir(dir: string): AsyncGenerator<string> { | |
| const entries = await readdir(dir, { withFileTypes: true }); | |
| for (const entry of entries) { | |
| const name = resolve(dir, entry.name); | |
| if (entry.isDirectory()) { | |
| yield* walkDir(name); | |
| } else if (filterFile(entry.name)) { |
This file contains hidden or 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
| :root { | |
| --easeInSine: cubic-bezier(0.12, 0, 0.39, 0); | |
| --easeOutSine: cubic-bezier(0.61, 1, 0.88, 1); | |
| --easeInOutSine: cubic-bezier(0.37, 0, 0.63, 1); | |
| --easeInQuad: cubic-bezier(0.11, 0, 0.5, 0); | |
| --easeOutQuad: cubic-bezier(0.5, 1, 0.89, 1); | |
| --easeInOutQuad: cubic-bezier(0.45, 0, 0.55, 1); | |
| --easeInCubic: cubic-bezier(0.32, 0, 0.67, 0); | |
| --easeOutCubic: cubic-bezier(0.33, 1, 0.68, 1); | |
| --easeInOutCubic: cubic-bezier(0.65, 0, 0.35, 1); |
This file contains hidden or 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
| /** | |
| * Calculate password strength | |
| * @param value password | |
| * @returns password strength in range between 0 an 1 | |
| */ | |
| export const getPasswordStrength = (value: string): number => { | |
| // Minimum 8 characters | |
| const REGEX_CHARACTER = /^.{8,}$/ | |
| // Minimum 2 uppercase, |
This file contains hidden or 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
| describe('arrayToKeyedObject', () => { | |
| it('should return empty object if array are empty', () => { | |
| type GenericItems = { code: string } | |
| const items: GenericItems[] = [] | |
| const result = arrayToKeyedObject(items, (item) => item.code) | |
| expect(result).toEqual({}) | |
| }) | |
| it('should return keyed object', () => { |
NewerOlder