This file contains hidden or 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
| * | |
| !domain | |
| !domain/configuration | |
| !domain/configuration/* | |
| !standalone | |
| !standalone/configuration | |
| !standalone/configuration/* | |
| !bin | |
| !bin/* |
This file contains hidden or 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
| #one file | |
| perl -i -0pe 's|//.*?\n|\n|g; s#/\*(.|\n)*?\*/##g;' file.java | |
| #multiple files | |
| find . -name "*.java" -type f | while read fname; do perl -i -0pe 's|//.*?\n|\n|g; s#/\*(.|\n)*?\*/##g;' "$fname"; done |
This file contains hidden or 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
| #tested on OS X | |
| grep -Lir --include \*DAOImpl.java '@Repository' . | xargs sed -i '' -e "s/public class/import org.springframework.stereotype.Repository;\\`echo -e '\r'`@Repository\\`echo -e '\r'` public class/" |
This file contains hidden or 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 | |
| grep -lir --include \*.java -e 'implements java.io.Serializable' -e 'implements Serializable' . | xargs grep -Lir -e 'serialVersionUID' | while read -r line ; do awk '/implements (java.io.)?Serializable/{print;print "\n\t\nprivate static final long serialVersionUID = 1L;";next}1' $line > temp.java && mv temp.java $line ; done |
This file contains hidden or 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 | |
| find ~/.m2/repository/ -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid |
This file contains hidden or 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
| sed -e '/<version>.*<\/version>/{s//<version>new<\/version>/;:a' -e '$!N;$!ba' -e '}' |
This file contains hidden or 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
| find git-dir/ -type f \( -name "*.sql" \) -exec sh -c 'git log --name-only -1 --date=format:'\''%Y-%m-%d %H:%M:%S'\'' '\''{}'\'' | sed -n '\''3p;7p'\'' | awk '\''{key=$0; getline; print key ", file " $0;}'\''' -- {} \; | sort |
This file contains hidden or 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
| curl -s -I http://127.0.0.1:8080/ | grep HTTP/1.1 | awk {'print $2'} |
This file contains hidden or 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
| When Maven outputs errors like | |
| error: unmappable character for encoding UTF8 | |
| you can remove the illegal characters in Mac OS bash with this | |
| for f in $(find /private/tmp -name '*.java' 2>/dev/null); do iconv -f utf-8 -t utf-8 -c "$f" > "$f.new" ; mv -f "$f.new" "$f"; done | |
| N.B. iconv has to be installed first, e.g. using homebrew (brew install iconv) |
This file contains hidden or 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
| private static void loadConfiguration(String argConfigurationName, String argFilename) { | |
| PropertiesConfiguration config = new PropertiesConfiguration(); | |
| config.setBasePath("file:/initech/Temp/scraper-ext-conf/"); | |
| config.setFileName(argFilename); | |
| try { | |
| //when setting the file name explicitly, the load method has to be called manually | |
| config.load(); | |
| } catch (ConfigurationException e) { | |
| e.printStackTrace(); | |
| } |
NewerOlder