Skip to content

Instantly share code, notes, and snippets.

View mihai-vlc's full-sized avatar

Mihai Ionut Vilcu mihai-vlc

View GitHub Profile
@mihai-vlc
mihai-vlc / script-template.sh
Last active September 17, 2023 11:44 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
VERSION="1.0.0"
main() {
local action="${args[0]}"
@mihai-vlc
mihai-vlc / install-pre-commit.sh
Created May 24, 2017 22:40 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This gist contains pre-commit hooks to prevent you from commiting bad code or to the wrong branch.
# There are four variants that I have built:
# - pre-commit: stops commits to "master" and "develop" branches.
# - pre-commit-2: also includes a core.whitespace check.
# - pre-commit-3: the core.whitespace check and an EOF-newline-check.
# - pre-commit-4: only the core.whitespace check.
# Set desired version like this before installing:
# FILE=pre-commit
@mihai-vlc
mihai-vlc / gitignore
Last active December 28, 2015 13:09 — forked from philsinatra/gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.sass-cache