Skip to content

Instantly share code, notes, and snippets.

<?php
declare(strict_types=1);
namespace Tests\Endouble\Sanity;
use Generator;
use SplFileInfo;
use SplFileObject;
use Symfony\Component\Finder\Finder;
use Tests\Endouble\UnitTestCase;
@thanosp
thanosp / commit-msg.sh
Last active October 5, 2016 09:29
.git/hooks/commit-msg for JIRA branch
#!/bin/sh
#
[[ -n "$(cat $1 | grep 'fixup!')" ]] && FIXUP="YES"
JIRA_PREFIX="CSB-"
TICKET=$JIRA_PREFIX$(git symbolic-ref HEAD | rev | cut -d/ -f1 | rev | grep -o -E "[0-9]+" | head -n1)
if [[ "" != "`head -n1 $1`" && -n "${TICKET}" && -z "${FIXUP}" ]]; then
sed -i.bak -e "1s/^/[${TICKET}] /" $1
fi
@thanosp
thanosp / figo.sh
Last active August 12, 2020 07:38
shell function to find and go to the directory of a go project
# go to the source of a go project in $GOPATH
# Usage: $ figo projectname
figo () {
FIGODIR=`find $GOPATH/src -name "$1" -print -maxdepth 3 | grep -v vendor | head -n1`
if [ "$FIGODIR" = "" ]; then FIGODIR=`find $GOPATH/src -name "$1" -print -maxdepth 4 | grep -v vendor | head -n1`; fi
cd $FIGODIR
}