This file contains hidden or 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> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
<meta http-equiv="Content-Style-Type" content="text/css" /> | |
<title>Gallery Example</title> | |
<style type="text/css"> |
This file contains hidden or 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
# create a domain with portbase + 80 as the HTTP port | |
asadmin create-domain --portbase [port] [svc-name] | |
# create windows service wrapper for glassfish domain | |
asadmin create-service [svc-name] |
This file contains hidden or 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
git remote add --track master mleung git://github.com/mleung/feather.git | |
git fetch mleung | |
git merge mleung/master |
This file contains hidden or 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
# run at top level project | |
mvn3 versions:set -DnewVersion=[x.y.z] |
This file contains hidden or 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
// TEST 1: what happens in this scenario? | |
List<String> test1 = new ArrayList<String>(); | |
test1.add(new Integer(5)); | |
// TEST 2: what happens and/or is printed in this scenario? | |
List<String> test2 = new ArrayList<String>(); | |
Method method2 = | |
test2.getClass().getMethod("add", String.class); | |
System.out.println(method2); |
This file contains hidden or 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
<!-- task to trim spaces on properties in Ant via inline javascript (requires 1.7+) --> | |
<!-- NOTE that properties in Ant are immutable so you must define the variable with a different name --> | |
<target name="trim-properties"> | |
<script language="javascript"> | |
<![CDATA[ | |
var myproperty= project.getProperty("myproperty"); | |
if (myproperty!= null) { | |
project.setProperty("myproperty.trimmed", myproperty.trim()) | |
} | |
]]> |
This file contains hidden or 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
/** | |
* Convert any collection to a map by iterating over its contents | |
* and taking a result of the entry as the key to the map. The | |
* argument may either be a closure which is invoked once per item | |
* in the collection, or may be a string identifying the property | |
* to act as the key for each entry. | |
*/ | |
Collection.metaClass.asMap = { arg -> | |
def result = [:] | |
delegate.each { |
This file contains hidden or 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
// anonymously invoke a closure into callable and submit to executor | |
// this fails w/o the explicit (Callable) since it converts it to Runnable | |
def executor = java.util.concurrent.Executors.newFixedThreadPool(5) | |
def future = executor.submit((java.util.concurrent.Callable) { | |
'TEST' | |
}) | |
assert('TEST' == future.get()) |
This file contains hidden or 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
# control color output via ASCII codes for better visual aspsect in terminal | |
git config --global color.ui auto | |
# update line-ending support for win/unix cross-platform (cr/cflf) | |
# force to be LF in the repo (regardless of OS) | |
git config --global core.autocrlf input | |
# force windows t oconvert to platform on checkout and back on commit | |
git config --global core.autocflf true | |
# individually control portions of a file (patch mode) |
This file contains hidden or 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
File tmpDir = (File) servletContext.getAttribute(SERVLET_TMP_DIR); | |
if (tmpDir == null) { | |
throw new ServletException("Servlet container does not provide temporary directory"); | |
} | |
File workDir = new File(tmpDir, "classes"); | |
if (!workDir.mkdirs()) { | |
throw new ServletException("Unable to create classes temporary directory"); | |
} |
OlderNewer