Skip to content

Instantly share code, notes, and snippets.

View eeichinger's full-sized avatar

Erich Eichinger eeichinger

View GitHub Profile
eeichinger /
Created March 31, 2014 13:44
#microservice best practice
public class StateServiceImpl implements StateService {
protected StateDao stateDao;
public List<State> findStates() {
return stateDao.findStates();
eeichinger /
Created April 8, 2014 14:17
My favorite "use spring to instantiate but register as a static global singleton" solution
public class ActivityStateManagerImpl implements ActivityStateManager {
private static ActivityStateManager ACTIVITY_STATE_MANAGER;
public static ActivityStateManager getStateManager() {
eeichinger /
Created October 4, 2014 15:11
Custom Embedded Jetty Runner for easier debugging - run xml free webapps
based on
eeichinger /
Last active August 29, 2015 14:09
CORS Request Filter for debugging/testing purposes
package com.example.web;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
eeichinger /
Created November 19, 2014 18:03
svn tag command line
svn rm -m "Remove existing Test Tag" --no-auth-cache --non-interactive --username eeichinger --password pass1234
svn copy -m "Test Tag" --no-auth-cache --non-interactive --username eeichinger --password pass1234
eeichinger /
Created January 5, 2015 14:18
Wrap raw AAC files in MP4 container and copy ID3v2 tags to MP4 metadata
# Wrap raw AAC files in MP4 container and copy ID3v2 tags to MP4 metadata. Original files are not touched, new files appear besides them with .m4a extension
# requires MP4Box and kid3 (install via homebrew. You may need to install MP4Box manually from Homebrew had troubles installing mp4box. The executable is found inside the, see below)
# kid3 also has problems with full qualified filepaths as well as spaces in the filenames
for fic in Music/**/*.aac
echo processing $fic
eeichinger /
Created April 1, 2015 14:15
Tomcat start & wait until success
# Usage:
# start_wait <modulename> <servername>
# Default vals for args
eeichinger /
Created May 20, 2015 05:56
an rxjava catch-like operator
package myrx;
import org.junit.Test;
import rx.Observable;
import rx.Producer;
import rx.Subscriber;
import rx.exceptions.Exceptions;
import rx.functions.Func1;
import rx.plugins.RxJavaPlugins;
eeichinger / pom.xml
Created May 20, 2015 08:42
A pom template, use for- set file encoding- compile java 8, target java 7 jvm- embed manifests with jenkins build info into jar and war- configure enforcer plugin- define various commonly used libs + versions (slf4j, logback, logstash, spring, spring-cloud, hystrix, rxjava, dropwizard, concordion, wiremock, guava, jolokia)
View pom.xml
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
A default pom template - use for
- set file encoding
eeichinger / .gitconfig
Created August 11, 2011 09:42
Default Git global config fule
View .gitconfig
name = <committer name>
email = <email address>
encoding = utf-8
autocrlf = off
ignorecase = true
pretty = format:%h %cr %cN: %s