Skip to content

Instantly share code, notes, and snippets.

@ivanpu
ivanpu / git_for_intellij.bat
Last active October 26, 2023 00:04
Rewrite of https://gist.github.com/gcollic/f6f093ec3805979669d0bf744e22c72a in Python, because I've needed this in my employer-provided Windows machine.
@echo off
python %~dp0git_for_intellij.py %*
@gcollic
gcollic / git_for_intellij.sh
Last active February 15, 2023 10:03
Replace the path to git by the path of this file in order to stop IntelliJ from messing with your staging area (no config for rename & co).
#!/bin/bash
inner() {
local cmd="$@"
local REGEX="(^|log.showSignature=false )(add|rm|mv) "
if [[ $cmd =~ $REGEX ]]; then
echo 'Stopping IntelliJ from being a not well-behaved git client. See IDEA-194592, IDEA-63391, IDEA-176961, ...' >&2
return 1
fi
git "$@"
}
@outofcoffee
outofcoffee / find-ecr-image.sh
Last active March 1, 2024 13:35
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@agnivade
agnivade / commit-msg
Last active October 19, 2021 08:33
Bash file to check commit message structure
#!/bin/bash
#http://chris.beams.io/posts/git-commit/#seven-rules
cnt=0
while IFS='' read -r line || [[ -n "$line" ]]; do
cnt=$((cnt+1))
length=${#line}
if [ $cnt -eq 1 ]; then
# Checking if subject exceeds 50 characters
if [ $length -gt 50 ]; then
echo "Your subject line exceeds 50 characters."