Skip to content

Instantly share code, notes, and snippets.

@fnky
fnky / ANSI.md
Last active May 3, 2024 17:31
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@luuuis
luuuis / pre-commit.sh
Last active September 19, 2021 16:18 — forked from dahjelle/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes.
#!/usr/bin/env bash
set -uo pipefail
IFS=$'\n\t'
#
# Improvements from dahjelle/pre-commit.sh:
# - does not lint deleted files,
# - lints all staged files before exiting with an error code,
# - handles spaces and other unusual chars in file names.
#
@Floofies
Floofies / promiseFilter.js
Last active September 9, 2022 11:28
Returns a Promise which resolves with a new Array, containing only values which passed the test.
/**
* promiseFilter - Returns a Promise which resolves with a new Array, containing only values which passed the test.
* @param {Array} array An Array from which to filter values into a new Array.
* @param {callback} test A callback function which must return a Promise, which must resolve with a Boolean.
* @callback test
* @param {any} value The current value from `array`.
* @param {Number} index The current index being used to access `array`.
* @param {Array} array The Array being iterated through, `array`.
* @returns {Promise} A Promise which resolves with a new Array containing values which passed the test.
*/
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active May 2, 2024 09:06
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line