Skip to content

Instantly share code, notes, and snippets.

View letehaha's full-sized avatar
🇺🇦

Dmytro letehaha

🇺🇦
View GitHub Profile
@letehaha
letehaha / script.sh
Last active July 30, 2024 16:29
MacOS Quick Action | HandBrake video optimize
# 0. Run `brew install handbrake` to be able to use CLI with this script
# 1. Open Automator app in MacOS
# 2. File > New. Select "Quick Action" from the popup
# 3. In opened window, at the top center, "Workflow receives current" select as "files and folders",
# and next to it "in" select "Finder.app".
# 4. In the search field on the left find "Run Shell Script" and DnD it into the main view.
# 5. On the right select "Pass input" to "as arguments"
# 6. Insert script below and Save. Give it meaningful name that will be displayed in the Quick Actions
# 7. Enjoy!
@letehaha
letehaha / pre-commit-hook.sh
Last active October 21, 2020 09:22
Checks eslint errors/warnings in pre-commit hook. Disable commit if errors found
# !/bin/sh
files=$(git diff --cached --name-only --diff-filter=ACM | grep -E "(.js|.vue)$")
if [ "$files" == "" ]; then
exit 0
fi
lintfiles=""
errors="false"