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
grails integrate-with --git |
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
:set listchars=tab:>-,trail:- |
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
# -s = silent, -w = write out format, -o = output file | |
curl -s -w %{http_code} http://www.google.co.uk/ -o /dev/nul |
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 BaseHTTPServer | |
class Handler(BaseHTTPServer.BaseHTTPRequestHandler): | |
mappings = {'/' : {'GET' : 'test'}} | |
def main_handler(self, method='GET'): | |
# get request url (without url params) and remove trailing / | |
request_url = self.path.split('?')[0].rstrip('/') |
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
for i in *.txt; do mv $i $(echo "$i" | sed 's/_/-/'); done |
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
# sed | |
sed -n '$=' file | |
# awk | |
wc -l file | awk '{print $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
String fileContent = new Scanner(file).useDelimiter("\\A").next(); | |
String[] fileLines = fileContent.split(System.lineSeparator()); |
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
Calendar calendar = Calendar.getInstance(); | |
calendar.setTime(date); | |
calendar.set(Calendar.HOUR_OF_DAY, 0); | |
calendar.set(Calendar.MINUTE, 0); | |
calendar.set(Calendar.SECOND, 0); | |
calendar.set(Calendar.MILLISECOND, 0); | |
return calendar.getTime(); |
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
find . -type d -name .svn | xargs rm -rf |
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
find src/main/java/ -type f -exec sed -i 's/SimpleJdbcTemplate/NamedParameterJdbcTemplate/g' {} \; |