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 | |
## extract uniq commands and store them | |
sort .bash_history uniqhistory.txt | uniq > uniqhistory.txt |
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 md5 sum of all files in current directory | |
find . -type f -print0 | xargs -0 md5sum | sort > out.txt | |
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.text.DecimalFormat; | |
... | |
DecimalFormat df = new DecimalFormat("###,##0.00"); | |
df.format(number); | |
// in the format string, | |
// # -> shows Digit if present else blank | |
// 0 -> shows Digit if present else 0 | |
// details at : http://docs.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Test Page</title> | |
</head> | |
<body> | |
<h1>Lorem ipsum dolor</h1> | |
<p> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut | |
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris |
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
a { | |
color: blue; | |
text-decoration: none; | |
} | |
a:hover { | |
background-color: blue; | |
color: white; | |
} |
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
@echo off | |
REM set these variables | |
SET HSQLDB_HOME=c:\path\to\hsqldb | |
SET DB_NAME=mydb | |
REM start the server in new window ( prompt visible, so that you can CTRL+C ) | |
REM database files are created in current directory/data | |
start java -cp %HSQLDB_HOME%\lib\hsqldb.jar org.hsqldb.server.Server --database.0 file:data/%DB_NAME% --dbname.0 %DB_NAME% | |
REM start the client GUI and connect to server ( no new cmd window opens because of javaw ) |
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
export PS1="\n[\w]\n\u@\h $ " | |
# a more fancier and colored one | |
#export PS1="\n[\[\e[0;32m\]\w\[\e[0m\]]\n\u@\h $ " |
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
def today = new Date() | |
def three_days_old = today - 3 | |
println three_days_old | |
|
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
println "something|delimited".split("[|]") | |
println "something,delimited".split("[,]") | |
println "something#delimited".split("[#]") |
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
@echo off | |
REM include this cmd file in PATH | |
dir %1 %2 %3 |