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
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | |
version="3.0"> | |
<description>Groovy Web Application</description> | |
<welcome-file-list> | |
<welcome-file>index.html</welcome-file> |
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
#!/usr/bin/env bash | |
# Author: Zemian Deng, Date: 2012-11-16_06:30:00 | |
# java.sh - A Java wrapper that auto setup classpath to run in Cygwin, Unix or Linux shell. | |
# We assume this script is located in a subdiretory inside the application home directory. | |
# Example: | |
# app/bin/java.sh | |
# app/config/log4j.properties | |
# app/lib/log4j.jar | |
# Usage: | |
# bash> java.sh app.Hello |
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
#!/usr/bin/env bash | |
# Author: Zemian Deng, Date: 2012-11-13_22:53:54 | |
# | |
# Compile Kotlin source files and write into 'out' directory. | |
# | |
KOTLIN_DIR=$(cd $(dirname $0)/.. && pwd) | |
SRC='$KOTLIN_DIR/src' | |
if [[ $# -ge 1 ]]; then SRC=$1; shift; fi | |
CP=${CP:=} |
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
Show hidden characters
// SublimeText user keymap | |
// Author: Zemian Deng, Date: 2012-11-01_09:55:03 | |
[ | |
{ "keys": ["ctrl+alt+f6"], "command": "reindent"}, | |
{ "keys": ["ctrl+alt+f5"], "command": "zemian_name_and_date"}, | |
{ "keys": ["ctrl+alt+n"], "command": "new_note_file"} | |
] |
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
// Parse pom.xml and print all dependency elements in single line for gradle use instead. | |
// Zemian Deng 11/1/2012 | |
depMap = [:].withDefault{ [] } | |
project = new XmlParser().parse("pom.xml") | |
project.dependencies[0].each{ dependency -> | |
line = "'" + dependency.groupId.text() + ":" + | |
dependency.artifactId.text() + ":" + | |
dependency.version.text() + "'" | |
scope = dependency.scope.text() ?: 'compile' | |
depMap[scope] << line |
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
PROJ=java-demo | |
if [[ $# -ge 1 ]]; then PROJ=$1; fi | |
echo "Creating $PROJ project." | |
if [[ -e $PROJ ]]; then | |
echo "ERROR: $PROJ already exists." | |
exit 1 | |
fi | |
# Create a java project with Gradle build script. |
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
// Problem with http://issues.gradle.org/browse/GRADLE-2381 | |
apply plugin: 'java' | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
} | |
dependencies { | |
testCompile( | |
'org.neo4j:neo4j-kernel:1.8.M05:tests' |
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 Gradle build script for a typical Hiberante+Spring data project. | |
// | |
// Author: Zemian Deng <[email protected]> 10/31/2012 | |
apply plugin: 'java' | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
} | |
dependencies { |
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
// Gragle build script for a Java application | |
apply plugin: 'java' | |
repositories { mavenCentral() } | |
dependencies { | |
testCompile( | |
//compile(fileTree(dir: gradle.gradleHomeDir, include: 'lib/**/*.jar')), | |
'org.hamcrest:hamcrest-library:1.3', | |
'junit:junit:4.11-beta-1' | |
) | |
compile( |
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
# Terminate all java processes forcefully! | |
# This script is for Cygwin only. | |
# WARN: Be very sure what's what you want. You usually want this if they are stuck and | |
# not responsive. | |
LIST=$(jps -l | grep -v 'sun.tools.jps.Jps') | |
echo $LIST | |
for PID in $(echo $LIST | ruby -a -ne 'puts $F[0]'); do | |
echo "Killing Java PID $PID" | |
/usr/bin/kill -f $PID | |
done |
NewerOlder