Skip to content

Instantly share code, notes, and snippets.

View efenderbosch's full-sized avatar

Eric Fenderbosch efenderbosch

  • Ohio
  • 14:35 (UTC -04:00)
View GitHub Profile
@efenderbosch
efenderbosch / versions-comparison-ruleset.xml
Created May 8, 2017 19:06
versions-maven-plugin ruleset
<ruleset comparisonMethod="maven"
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
<!-- when running mvn versions:display-dependency-updates (or reports), ignore beta and alpha releases -->
<ignoreVersions>
<ignoreVersion type="regex">.*-atlassian-.*</ignoreVersion>
</ignoreVersions>
<rules>
<rule groupId="com.fasterxml.jackson">
<ignoreVersions>
@efenderbosch
efenderbosch / Envelope.java
Last active February 28, 2017 16:18
fetch up to N entries from a redis sorted set
public class Envelope {
private Object body;
private long timestamp;
private int retries;
public Envelope() { }
public Envelope(Object body) {
this(body, System.currentTimeMillis());

Keybase proof

I hereby claim:

  • I am efenderbosch on github.
  • I am efenderbosch (https://keybase.io/efenderbosch) on keybase.
  • I have a public key whose fingerprint is 2FF1 1200 B190 3F01 79E8 C5A9 201D A2A3 0DDF BF6E

To claim this, I am signing this object:

@efenderbosch
efenderbosch / ScheduledActor.java
Last active November 1, 2016 13:24
Scheduled Akka Actor to pipeline events to Redis
package com.example;
import akka.actor.ActorRef;
import akka.actor.Props;
import akka.actor.UntypedActor;
import play.Configuration;
import play.libs.Json;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.Pipeline;
@efenderbosch
efenderbosch / ResultStatusMatcher.java
Last active September 2, 2016 20:16
Hamcrest matcher for a Play Future Result status
package controllers;
import akka.util.Timeout;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import play.api.mvc.Result;
import play.api.test.Helpers;
import scala.concurrent.Future;
import java.util.concurrent.TimeUnit;
@efenderbosch
efenderbosch / KryoUtil.java
Created February 24, 2016 17:33
Thread safe Kryo w/ Java 8 streams
import static java.util.Spliterator.NONNULL;
import static java.util.Spliterator.ORDERED;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.util.Iterator;
import java.util.NoSuchElementException;
@efenderbosch
efenderbosch / gist:87286f898afe6501aa5e
Created November 19, 2015 16:35
SLF4J Eclipse code template
${:import(org.slf4j.Logger, org.slf4j.LoggerFactory)}
private static final Logger log = LoggerFactory.getLogger(${enclosing_type}.class);
@efenderbosch
efenderbosch / NgnixEnvironmentController.java
Created February 10, 2015 14:52
Ngnix Config Controller
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.config.Environment;
@efenderbosch
efenderbosch / PipelinedRedisTokenStore
Last active February 5, 2016 12:48
Pipelined Redis Token Store
package com.example
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
@efenderbosch
efenderbosch / RedisTokenStore
Created January 19, 2015 20:27
Redis Token Store for Spring Security
public class RedisTokenStore implements TokenStore {
private static final StringRedisSerializer STRING_SERIALIZER = new StringRedisSerializer();
private static final ObjectMapper OBJECT_MAPPER = new JodaMapper().disable(WRITE_DATES_AS_TIMESTAMPS);
private final BoundHashOperations<String, String, OAuth2AccessToken> accessTokenStore;
private final BoundHashOperations<String, String, OAuth2AccessToken> authenticationToAccessTokenStore;
private final ListOperations<String, OAuth2AccessToken> userNameToAccessTokenStore;
private final ListOperations<String, OAuth2AccessToken> clientIdToAccessTokenStore;
private final BoundHashOperations<String, String, OAuth2RefreshToken> refreshTokenStore;