View ReplaceBlocks.java
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
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Scanner; | |
public class ReplaceBlocks { |
View gist:1012725
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
#delete | |
cat sb | xargs sed -i 's/0, 1, 3, 2/0, 1, 3/g' | |
#replace | |
cat sb | xargs sed -i 's/0, 1, 2/0, 1, 3/g' |
View addNewLine.sh
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/sh | |
#adds the line 'the new first line' at the beginning of file 'filename' | |
sed -i '1 i\the new first line' filename |
View easyMock2Mockito
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 | |
fgrep -Rl "EasyMock" testsrc | fgrep -v ".svn" | while read item | |
do | |
sed -i 's/org.easymock.EasyMock.createNiceMock/org.mockito.Mockito.mock/g' $item | |
sed -i 's/org.easymock.EasyMock.createMock/org.mockito.Mockito.mock/g' $item | |
sed -i 's/org.easymock.EasyMock.expect/org.mockito.Mockito.when/g' $item | |
sed -i 's/org.easymock.EasyMock/org.mockito.Mockito/g' $item | |
sed -i 's/EasyMock/Mockito/g' $item | |
sed -i 's/createNiceMock/mock/g' $item | |
sed -i 's/createMock/mock/g' $item |
View link2text.sh
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 | |
grep -Rl "a href=" dirname | while read item | |
do | |
sed -i 's/<a href=".*">\(.*\)<\/a>/\1/' $item | |
done |
View numberOfDuplicates.sql
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
-- replace myfield1, myfield2 and mytable with appropriate names | |
select COUNT(*) AS num, myfield1, myfield2 from mytable group by myfield1, myfield2 HAVING COUNT(*) > 1; |
View intellijidea.desktop
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
[Desktop Entry] | |
Type=Application | |
Name=IntelliJ IDEA | |
Comment=IntelliJ Integrated Development Environment | |
Icon=/opt/idea/bin/idea128.png | |
Exec=/opt/idea/bin/idea.sh | |
Terminal=false | |
StartupWMClass=Intellij_IDEA | |
Categories=Development;IDE;Java; |
View junit4template.java
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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import static org.junit.rules.ExpectedException.none; | |
public class ${NAME} { | |
@Rule | |
public final ExpectedException thrown = none(); | |
} |
View twitterspring.jsp
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
<form:errors path="a" cssClass="alert alert-error" element="div"/> | |
<form:errors path="*" cssClass="alert alert-error" element="div" delimiter='</div><div class="alert alert-error">'/> |
View playdeb.sh
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 | |
# playdeb builds a debian package of the play framework. playdeb downloads | |
# the playframework by itself. You run it by | |
# playdeb.sh <version> <maintainer> | |
# Example: | |
# playdeb.sh 1.2.3 "Denny Colt <d.colt@eisner.qcg>" | |
# | |
# The script has been tested with version 1.2.3. | |
if [ -z $1 ] |
OlderNewer