Skip to content

Instantly share code, notes, and snippets.

View Serchinastico's full-sized avatar
👋

Sergio Gutiérrez Serchinastico

👋
View GitHub Profile
@tonilopezmr
tonilopezmr / pre-commit-ktlint
Last active August 15, 2021 10:05
Pre-commit hook to run ktlint with auto-correct option and it adds the auto-correct changes into the commit.
#!/bin/sh
# https://github.com/shyiko/ktlint pre-commit hook
git diff --name-only --cached --relative | grep '\.kt[s"]\?$' | xargs ktlint -F --relative .
if [ $? -ne 0 ]; then exit 1; else git add .; fi
@Serchinastico
Serchinastico / .gitconfig
Last active June 5, 2018 17:12
Alias for easier git rebase --onto
[alias]
# ronto stands for "rebase --onto". Uses the current branch to move it and updates the start-of-the-branch tag along
ronto = "!f() { \
git rebase --onto $1 __start__$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --abbrev-ref HEAD); \
git tag -d __start__$(git rev-parse --abbrev-ref HEAD); \
git tag __start__$(git rev-parse --abbrev-ref HEAD) $1; \
}; f"
# nb stands for "create branch". Creates a tag marking the start-of-the-branch
cb = "!f() { \
git tag __start__$1; \
@fnky
fnky / ANSI.md
Last active July 24, 2024 02:06
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@SharpEdgeMarshall
SharpEdgeMarshall / README.md
Last active April 7, 2020 01:06
Zoom.us Vaccine

Zoom.us Vaccine

To run the script please follow these instructions:

  • Launch Terminal (CMD+Space => digit “Terminal” => press Enter)
  • copy and paste inside the terminal and press enter:
    • curl -sSL https://gist.githubusercontent.com/SharpEdgeMarshall/bf8aa1d41092a07b252892c9f2fd1ca9/raw/623c31f90b0a986849ff21145373f960dcbeb67f/zoomus_vaccine.sh -o zoomus_vaccine.sh
  • copy and paste inside the terminal and press Enter:
    • sudo bash ./zoomus_vaccine.sh
  • It will ask you for your mac account password
  • Insert 1 and press Enter
@eik3
eik3 / README.md
Last active February 11, 2022 09:48
Git pre-commit and pre-push hooks to avoid accidental main / master branch commits / pushes
  1. Save files to ~/.git/hooks/
  2. Make them executable: chmod +x ~/.git/hooks/pre-{commit,push}
  3. Configure git to use these hooks: git config --global core.hooksPath ~/.git/hooks