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 | |
# script to collect input until the end then overwrite an existing file | |
# with the provided input. Intended to simplify this pattern: | |
# cat file | grep | awk | sed > temp | |
# rm file | |
# mv temp file | |
# into this pattern: | |
# cat file | grep | awk | sed | rewrite file | |
# need the file to overwrite |
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|[^/]*$||'` |
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
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
#!/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
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}'` |
NewerOlder