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
package dayang.tools.db; | |
import java.net.URL; | |
import org.apache.commons.cli.CommandLine; | |
import org.apache.commons.cli.CommandLineParser; | |
import org.apache.commons.cli.HelpFormatter; | |
import org.apache.commons.cli.Options; | |
import org.apache.commons.cli.ParseException; | |
import org.apache.commons.cli.PosixParser; |
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
<meta http-equiv="X-UA-Compatible" content="IE=8" > |
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 win32? | |
require 'Win32API' | |
return true | |
rescue LoadError | |
return false | |
end |
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
public String getIpAddr(HttpServletRequest request) { | |
String ip = request.getHeader("x-forwarded-for"); | |
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | |
ip = request.getHeader("Proxy-Client-IP"); | |
} | |
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | |
ip = request.getHeader("WL-Proxy-Client-IP"); | |
} | |
if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | |
ip = request.getRemoteAddr(); |
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.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.Locale; | |
import java.util.Map; | |
import lombok.extern.log4j.Log4j; |
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
CATALINA_HOME=/home/lvjian/libs/tomcat6 | |
#PATH=$CATALINA_HOME/bin:$PATH | |
# some alias about tomcat | |
alias tm='cd $CATALINA_HOME'; | |
alias tmout='tail -f $CATALINA_HOME/logs/catalina.out'; | |
alias tmstart='$CATALINA_HOME/bin/startup.sh'; | |
alias tmstop='$CATALINA_HOME/bin/shutdown.sh'; | |
alias tmconf='vim $CATALINA_HOME/conf/server.xml'; | |
alias tmclear='rm -rf $CATALINA_HOME/work/*'; |
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
mvn archetype:create -DgroupId=lv.site.wb -DartifactId=wb -DarchetypeArtifactId=maven-archetype-webapp |
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
#ifdef DEBUG | |
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
# define DLog(...) | |
#endif | |
// ALog always displays output regardless of the DEBUG setting | |
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
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
# the scss: http://sass-lang.com/ | |
# scss plugins: https://github.com/kuroir/SCSS.tmbundle | |
# dependences: | |
# mac os x & textmate 2 | |
# git | |
mkdir -p ~/Library/Application\ Support/Avian/Bundles | |
cd ~/Library/Application\ Support/Avian/Bundles | |
git clone git://github.com/kuroir/SCSS.tmbundle.git "SCSS.tmbundle" |
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
# generate ctags for rails project | |
ctags -R --exclude=.git --exclude=log * --exclude=coverage |
OlderNewer