Skip to content

Instantly share code, notes, and snippets.

View JacobASeverson's full-sized avatar

Jacob Severson JacobASeverson

  • Favor Delivery
  • Austin, TX
View GitHub Profile
@JacobASeverson
JacobASeverson / rebuildRunHelloMod
Created November 13, 2014 00:25
Rebuilding hello-mod and running.
./gradlew clean
./gradlew fatJar
java -jar build/libs/hello-mod-1.0.0-SNAPSHOT-fat.jar
@JacobASeverson
JacobASeverson / removeWorldModLocal
Created November 13, 2014 00:17
Removing world-mod from the local maven repo.
rm -rf ~/.m2/repository/com/objectpartners/world-mod
@JacobASeverson
JacobASeverson / buildVertxFatJarRun
Created November 13, 2014 00:10
Building the hello-world fat jar and running.
cd ../hello-mod/
./gradlew fatJar
java -jar build/libs/hello-mod-1.0.0-SNAPSHOT-fat.jar
@JacobASeverson
JacobASeverson / pullInstallVertxExample
Last active August 29, 2015 14:09
Pulling and installing the Vert.x fat jar example.
git clone https://github.com/JacobASeverson/vertx-fatjar-example.git
cd vertx-fatjar-example/world-mod/
./gradlew install
@JacobASeverson
JacobASeverson / UdpPacketToServer
Last active August 29, 2015 14:09
Sending a UDP packet to the Reactor server.
echo -n 'Success!' | nc -4u -w1 localhost $UDP_SERVER_PORT
@JacobASeverson
JacobASeverson / reactorUdpBuild
Created November 11, 2014 03:30
Building and running the udp-reactor.
git clone https://github.com/JacobASeverson/udp-reactor.git
cd udp-reactor/
./gradlew build
java -jar build/libs/udp-reactor-0.0.1-SNAPSHOT.jar
public class TestCasAuthenticationUserDetailsService implements AuthenticationUserDetailsService {
@Override
public UserDetails loadUserDetails(Authentication token) throws UsernameNotFoundException {
List<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
return new User("joe", "joe", authorities);
}
}
<security:user-service id="userService">
<security:user name="joe" password="joe" authorities="ROLE_USER" />
...
</security:user-service>
@JacobASeverson
JacobASeverson / WebSecurityConfig
Last active August 7, 2025 12:47
Example java config for using CAS with Spring Security
@Configuration
@EnableWebMvcSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService("https://localhost:8443/cas-sample/j_spring_cas_security_check");
serviceProperties.setSendRenew(false);
return serviceProperties;
@JacobASeverson
JacobASeverson / grailsJndiLocalConfig
Last active December 30, 2015 18:19
Gist for OPI Blog post "Grails Config Values Per Tomcat Host"
...
if (Environment.current in [Environment.DEVELOPMENT, Environment.TEST]) {
exConfig = "file:/path/to/local/applicationConfig.groovy"
} else {
try {
exConfig = ((Context)(new InitialContext().lookup("java:comp/env"))).lookup("grailsExtConfFile")
...