This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rmdirs = { | |
it = (it instanceof File) ? it : new File(it) | |
if (!it.exists()) return | |
it.eachDir(delDir) | |
it.eachFile { it.delete() } | |
it.delete() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group='ch.qos.logback', module='logback-classic', version='[1.0.9,)') | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import ch.qos.logback.classic.Level | |
logger = LoggerFactory.getLogger("yourScript") // or whatever | |
logger.level = Level.INFO // or whatever | |
log = { level, msg, Object... args -> logger."${level.toLowerCase()}"((msg ?: "").toString(), args) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! $1 ]; then | |
echo "Please include desired jdk version: 1.7 or 7, 1.6 or 6, ..." | |
exit | |
fi | |
j7="/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home" | |
#j6="/Library/Java/JavaVirtualMachines/1.6.0_45-b06-451.jdk/Contents/Home" | |
j6="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ${Type} get${UpperName}() { | |
return ${lowerName}; | |
} | |
public void set${UpperName}(${Type} ${lowerName}) { | |
testSet${UpperName}(${lowerName}); | |
doSet${UpperName}(${lowerName}); | |
} | |
protected void testSet${UpperName}(${Type} ${lowerName}) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash=(`openssl sha1 $1`) | |
echo "${hash[1]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash=(`openssl sha1 $1`) | |
hash=${hash[1]} | |
if [ "$2" != "$hash" ]; then | |
echo "Mismatch: given $2, calculated $hash" > /dev/stderr | |
exit 1 | |
else | |
echo "ok" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to | |
____ __ | |
/ __/__ ___ _____/ /__ | |
_\ \/ _ \/ _ `/ __/ '_/ | |
/___/ .__/\_,_/_/ /_/\_\ version 1.1.0 | |
/_/ | |
Using Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_65) | |
Type in expressions to have them evaluated. | |
Type :help for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SCRUM_TIME=${SCRUM_TIME-"08:45:00"} | |
BEFORE_DAY=${BEFORE_DAY-$(date +%Y-%m-%d)} | |
BEFORE_TIME=${BEFORE_TIME-$SCRUM_TIME} | |
AFTER_DAY=${AFTER_DAY-$(python -c "from datetime import datetime, timedelta; before = datetime.strptime('$BEFORE_DAY','%Y-%m-%d').date(); monday = before.strftime('%u') == '1'; days = -3 if monday else -1; after = before + timedelta(days=days); print after;")} | |
AFTER_TIME=${AFTER_TIME-$BEFORE_TIME} | |
TZ_OFFSET=$(date +%z) | |
AFTER="${AFTER_DAY}T${AFTER_TIME}${TZ_OFFSET}" | |
BEFORE="${BEFORE_DAY}T${BEFORE_TIME}${TZ_OFFSET}" | |
DIR="${DIR-$PWD}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' | |
BLUE='\033[1;34m' | |
CLEAR='\033[0;0m' | |
red() { | |
printf "${RED}$1${CLEAR}\n" | |
} | |
green() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- define "dockercfg" -}} | |
{{- $hostname := required "A Docker image registry hostname is required" .Values.image.registry.auth.hostname -}} | |
{{- $username := required "A Docker image registry username is required" .Values.image.registry.auth.username -}} | |
{{- $password := required "A Docker image registry password is required" .Values.image.registry.auth.password -}} | |
{{- $email := required "A Docker image registry email is required" .Values.image.registry.auth.email -}} | |
{{- $auth := printf "%s:%s" $username $password | b64enc -}} | |
{{- $cfg := printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" $hostname $username $password $email $auth -}} | |
{{- $cfg | b64enc -}} | |
{{- end -}} |
OlderNewer