Skip to content

Instantly share code, notes, and snippets.

@shsteimer
shsteimer / pre-commit
Created August 3, 2022 20:03
Pre-Commit hook to prevent modifications to immutable dispatcher files
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
if git rev-parse --verify HEAD >/dev/null 2>&1
then
@shsteimer
shsteimer / mvnCleanAll.sh
Last active March 30, 2023 01:09
A bash script to run mvn clean on all projects in a directory
#!/bin/bash
find /Users/ssteimer/dev/workspaces -type f -name "pom.xml" | while read line;
do
echo found file at $line
len=${#line}
pomLen=$((len-8))
pomDir=${line:0:pomLen}
cd $pomDir
mvn clean
@Component(configurationFactory = true,
policy = ConfigurationPolicy.REQUIRE, metatype = true, immediate = true)
@Service()
public class MyFactoryConfigServiceClass {
//define config properties here as usual
@Property(name = "some.prop.name", label = "My Property", value = "")
private String myProperty
/**
@shsteimer
shsteimer / gist:7257245
Created October 31, 2013 21:10
Tip to delete tags by pattern
#delete all the remote tags with the pattern your looking for, ie. DEV-
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/%
#delete all your local tags
git tag | xargs -n 1 -i% git tag -d %
#fetch the remote tags which still remain
git fetch