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
<!-- 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
// 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
# 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
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
# 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
<!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"> |
NewerOlder