Skip to content

Instantly share code, notes, and snippets.

View ketansp's full-sized avatar

Ketan Patil ketansp

  • quantai-labs
  • Mumbai, India.
View GitHub Profile
@ketansp
ketansp / brew_elasticsearch.sh
Created July 5, 2018 13:27 — forked from evgeniy-trebin/brew_elasticsearch.sh
How to install specific version of elasticsearch via brew
brew tap homebrew/versions
brew cask install java
brew search elasticsearch
brew install [email protected]
brew services start [email protected]
@ketansp
ketansp / pre-commit.sh
Created August 3, 2021 14:33 — 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