Skip to content

Instantly share code, notes, and snippets.

View simonetripodi's full-sized avatar

Simone Tripodi simonetripodi

View GitHub Profile
@simonetripodi
simonetripodi / exec.xml
Created February 20, 2012 15:48
exec.xml
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-beta-1</version>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>exec-war-only</goal>
</goals>
@simonetripodi
simonetripodi / FluentGraph.java
Created January 20, 2012 16:07
Fluent APIs for Graph
UndirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge> graph =
newUndirectedMutableWeightedGraph( new AbstractGraphConnection<BaseLabeledVertex, BaseLabeledWeightedEdge>()
{
public void connect()
{
BaseLabeledVertex start = addVertex( new BaseLabeledVertex( "start" ) );
BaseLabeledVertex a = addVertex( new BaseLabeledVertex( "a" ) );
BaseLabeledVertex b = addVertex( new BaseLabeledVertex( "b" ) );
BaseLabeledVertex c = addVertex( new BaseLabeledVertex( "c" ) );
Index: maven-classic-skin/pom.xml
===================================================================
--- maven-classic-skin/pom.xml (revision 1227886)
+++ maven-classic-skin/pom.xml (working copy)
@@ -33,7 +33,7 @@
<name>Maven Classic Skin</name>
<description>Maven Classic Skin</description>
- <url>http://maven.apache.org/skins/${project.artifactId}</url>
+ <url>http://maven.apache.org/skins/${site.destination}</url>
@simonetripodi
simonetripodi / skin-staged-site.patch
Created January 5, 2012 22:39
Skin staged sites
Index: maven-classic-skin/pom.xml
===================================================================
--- maven-classic-skin/pom.xml (revision 1227826)
+++ maven-classic-skin/pom.xml (working copy)
@@ -41,6 +41,16 @@
<profiles>
<profile>
+ <id>rc</id>
+ <distributionManagement>
@simonetripodi
simonetripodi / super-type-tokens.patch
Created December 16, 2011 09:41
add advanced generic type handling in MyBatis
Index: src/test/java/org/apache/ibatis/type/TypeHandlerRegistryTest.java
===================================================================
--- src/test/java/org/apache/ibatis/type/TypeHandlerRegistryTest.java (revision 4287)
+++ src/test/java/org/apache/ibatis/type/TypeHandlerRegistryTest.java (working copy)
@@ -15,6 +15,13 @@
*/
package org.apache.ibatis.type;
+import java.net.URI;
+import java.sql.CallableStatement;
package com.xxx;
import java.util.HashSet;
import java.util.Set;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.digester3.annotations.rules.BeanPropertySetter;
@simonetripodi
simonetripodi / SynchronizedObjectPool.java
Created December 12, 2011 17:22
SynchronizedObjectPool using Read/Write lock
private static class SynchronizedObjectPool<T> implements ObjectPool<T> {
/** Object whose monitor is used to synchronize methods on the wrapped pool. */
private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
/** the underlying object pool */
private final ObjectPool<T> pool;
/**
* Create a new SynchronizedObjectPool wrapping the given pool.
@simonetripodi
simonetripodi / gist:1462486
Created December 11, 2011 20:11
ANTLR 3.4 jar content
$ jar -tvf ~/.m2/repository/org/antlr/antlr/3.4/antlr-3.4.jar
0 Tue Jul 19 09:36:30 CEST 2011 META-INF/
125 Tue Jul 19 09:36:28 CEST 2011 META-INF/MANIFEST.MF
0 Tue Jul 19 09:36:24 CEST 2011 org/
0 Tue Jul 19 09:36:26 CEST 2011 org/antlr/
0 Tue Jul 19 09:36:28 CEST 2011 org/antlr/misc/
0 Tue Jul 19 09:36:28 CEST 2011 org/antlr/codegen/
0 Tue Jul 19 09:36:24 CEST 2011 org/antlr/codegen/templates/
0 Tue Jul 19 09:36:24 CEST 2011 org/antlr/codegen/templates/Python/
0 Tue Jul 19 09:36:24 CEST 2011 org/antlr/codegen/templates/CPP/
@simonetripodi
simonetripodi / gist:1455467
Created December 10, 2011 16:08
mybatis migrations options
Usage: migrate [options] [command] [command options]
Options:
-e, --env Environment to configure.
Default: development
-f, --force Forces script to continue even if SQL errors are
encountered.
Default: false
-h, --help Displays this usage message.
Default: false
-p, --path Path to repository. Default current working directory.
@simonetripodi
simonetripodi / gist:1396291
Created November 26, 2011 21:06
parent.pom.patch
Index: src/site/site.xml
===================================================================
--- src/site/site.xml (revision 1206581)
+++ src/site/site.xml (working copy)
@@ -51,9 +51,9 @@
<version position="left" />
<skin>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-skin</artifactId>