Skip to content

Instantly share code, notes, and snippets.

View agentgt's full-sized avatar

Adam Gent agentgt

View GitHub Profile
@agentgt
agentgt / AbstractConfigResourcesFactoryBean.java
Last active August 29, 2015 13:56
Spring Configuration Overlaying
import static java.util.Arrays.asList;
import static org.springframework.util.StringUtils.hasText;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContext;
import org.slf4j.Logger;
@agentgt
agentgt / cleanup-maven.sh
Last active August 29, 2015 13:56
Delete releases
MAVEN_REPO=/home/maven/repo/release
PACKAGES="com/snaphop/snaphopsuite-web com/snaphop/snaphop-ats-web"
for p in $PACKAGES; do
PACKAGE=$MAVEN_REPO/$p
echo "Truncating $p"

You are a {SPECIES} living in a large forest. After loosing your parents to a fur trader your in search of human retribution.

Talents:

  • Scariness
  • Cuteness
  • Trickery
  • Fighting
  • Breeding
package main
import "fmt"
type ThreadConfig struct {
MaxThreads int
CorePoolSize int
Consumers int
TxSize int
QueueSize int
@agentgt
agentgt / IntelliBadLineContinuationTest.java
Last active August 29, 2015 14:20
IntelliJ line continuation breaks on functions that take lambda/anonymous
public class IntelliBadLineContinuationTest {
@Test
public void testBlah() throws Exception {
//ok not so bad
asList("a")
.get(0)
.toString();
//ok
asList(
@agentgt
agentgt / AppendableAspect.aj
Created July 13, 2011 23:27
AspectJ to make appendable easier to use
package com.evocatus.aop;
import java.io.IOException;
import java.lang.Appendable;
public aspect AppendableAspect {
pointcut appendCall(): call(* Appendable.append(..));
declare soft : IOException : appendCall();
@agentgt
agentgt / gist:1081576
Created July 13, 2011 23:29
Maven snippet for google zxing
<repositories>
<repository>
<id>mvn-adamgent</id>
<url>http://mvn-adamgent.googlecode.com/svn/maven/release</url>
<name>Adam Gent Maven Repository</name>
</repository>
</repositories>
<dependencies>
<dependency>
@agentgt
agentgt / gist:1081569
Created July 13, 2011 23:22
AspectJ filed ending in .java fails maven javadoc.
/var/lib/hudson/jobs/evocatus-web/workspace/src/main/java/com/evocatus/aop/DomainNotifyAdvice.java:22: class, interface, or enum expected
public void DomainNotify.postPersist() {
@agentgt
agentgt / gist:1082008
Created July 14, 2011 05:55
Why I hate JSP
javax.el.ELException: Cannot convert [] of type class com.google.common.collect.Collections2$FilteredCollection to interface java.util.List
at org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:434)
@agentgt
agentgt / SimpleContextListenerConfig.java
Created July 14, 2011 18:35
Simple way to do configuration for a web app.
package com.evocatus.util;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class SimpleContextListenerConfig /*extend ResourceBundle */ implements ServletContextListener{
private ServletContext servletContext;