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 | |
# avoid adding pcregrep as dependency for simple matching across | |
# not too many lines (I'd guess performance is going to start degrading | |
# at around 100??) | |
# returns number of lines of input for which we didn't find a contiguous | |
# match in the file provided | |
# emits the lines in the file that were matched by the multi line pattern | |
# provided | |
multiLineMatch() { |
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
serviceDefinition=`sed -f "remccoms3.sed" "$file" | sed '/^[[:space:]]$/d' | uniq | awk '/service[[:space:]]*'"$service"'/ {beginLine=NR} beginLine > 0 && NR >= beginLine {depth += gsub("{",""); depth -= gsub("}","")} depth > 0 && beginLine < NR {print} beginLine > 0 && depth == 0 {exit}'` |
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 | |
read -ra gitUrls <<< `git remote -v | awk '{print $2}' | sort -u` | |
if [[ ${#gitUrls[@]} -eq 1 ]] | |
then | |
selection=0 | |
else | |
selections=0 | |
for gitUrl in ${gitUrls[@]} |
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
psql "$postgresDb" -c "\pset pager off" -c "\d $postgresTable" | perl -pe 's/(_)./uc($&)/ge;s/_//g' | awk -F '|' ' | |
BEGIN {shouldPrint = 0} / id / {shouldPrint = 1} /Indexes/ {shouldPrint = 0} | |
shouldPrint != 0 {printf "val "$1": "} | |
shouldPrint != 0 && $2~/integer/ {printf "Long"} | |
shouldPrint != 0 && $2~/boolean/ {printf "Boolean"} | |
shouldPrint != 0 && $2~/character varying/ {printf "String"} | |
shouldPrint != 0 && $2~/text/ {printf "String"} | |
shouldPrint != 0 && $2~/timestamp with time zone/ {printf "java.sql.Timestamp"} | |
shouldPrint != 0 && $4~/not null/ {print ","} shouldPrint != 0 && $4~/^ *$/ {print "?,"}' |
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
This is a cool way to add a gist! |
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
This is a cool way to add a gist! |
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
This is a cool way to add a gist! |
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
This is a cool way to add a gist! |
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
This is a cool way to | |
add | |
a gist! |
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 | |
javaPath=$1 | |
kotlinPath=`echo "$javaPath" | sed 's|/java/|/kotlin/|' | sed 's|\.java|.kt|'` | |
echo "creating $kotlinPath" | |
parentDir=`echo "$kotlinPath" | sed 's|[^/]*$||'` |