Skip to content

Instantly share code, notes, and snippets.

View lviggiano's full-sized avatar

lviggiano lviggiano

View GitHub Profile
@lviggiano
lviggiano / DbStarter.java
Created May 18, 2012 19:25
ServletContextListner (DbStarter) using a connection pool for h2 database
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.sql.DataSource;
import org.h2.Driver;
@lviggiano
lviggiano / DbSetupScript.java
Created May 18, 2012 20:26
ServletContextListener that Sets up the database schema after first creation; and sample web.xml usage.
// DbStarter class: take it from https://gist.github.com/2727189
import static com.foo.bar.DbStarter.ctx;
import static com.foo.bar.DbStarter.getConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.ServletContext;
@lviggiano
lviggiano / gist:4075095
Created November 14, 2012 21:53
Optimizing IntelliJ on Mac OS X
22:48:27 luigi@hal9000:/Applications/IntelliJ IDEA 11.app/Contents$ diff Info.plist.original Info.plist
153c153
< <string>-ea -Xverify:none -Xbootclasspath/a:../lib/boot.jar</string>
---
> <string>-Xverify:none -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts -XX:+CMSClassUnloadingEnabled -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:-TraceClassUnloading -Xbootclasspath/a:../lib/boot.jar</string>
156c156
< <string>-Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m</string>
---
> <string>-Xms512m -Xmx1024m -XX:MaxPermSize=812m -XX:ReservedCodeCacheSize=64m</string>
159c159

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@lviggiano
lviggiano / gist:4ce8330e157144c0eb91
Created August 12, 2014 16:38
owner-patch-for-list-problem.diff
diff --git a/owner/src/main/java/org/aeonbits/owner/Converters.java b/owner/src/main/java/org/aeonbits/owner/Converters.java
index fcf28c6..ca01d31 100644
--- a/owner/src/main/java/org/aeonbits/owner/Converters.java
+++ b/owner/src/main/java/org/aeonbits/owner/Converters.java
@@ -58,6 +58,9 @@ enum Converters {
for (int i = 0; i < chunks.length; i++) {
String chunk = chunks[i];
Object value = converter.tryConvert(targetMethod, type, chunk);
+ if ( value == SKIP ) {
+ throw unsupportedConversion(type, chunk);

Keybase proof

I hereby claim:

  • I am lviggiano on github.
  • I am lviggiano (https://keybase.io/lviggiano) on keybase.
  • I have a public key ASCh7iEexScgFFhnt8dOIzYHJFt5ZdDKdCKFuvtIMuOdeQo

To claim this, I am signing this object: