Skip to content

Instantly share code, notes, and snippets.

View jbrackett's full-sized avatar

Josh Brackett jbrackett

View GitHub Profile
@jbrackett
jbrackett / TestAppConfig.java
Created February 9, 2014 13:46
Load in memory database and generate schema from annotated Java files.
import java.util.Properties;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.hibernate.cfg.Environment;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@jbrackett
jbrackett / ServletInitializer.java
Created December 12, 2012 02:11
Basic Servlet initializer for Spring to replace web.xml in Servlet 3 containers (Tomcat 7, Jetty 8, etc.)
import javax.servlet.ServletContext;
import javax.servlet.ServletRegistration;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
public class ServletInitializer implements WebApplicationInitializer {
@Override
@jbrackett
jbrackett / gist:1044667
Created June 24, 2011 12:20
My win _vimrc file
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif