Skip to content

Instantly share code, notes, and snippets.

@Decad
Decad / .dircolors.wsl
Created July 16, 2019 00:26 — forked from sgur/.dircolors.wsl
Dircolors for WSL
# dircolors for WSL
# Usage: eval `dircolors ~/.dircolors.wsl` (bash)
# http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors
TERM Eterm
TERM ansi
TERM color-xterm
TERM con[0-9]*x[0-9]*
TERM cons25
@Decad
Decad / pre-commit.sh
Created November 27, 2017 20:01 — forked from dahjelle/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done