Skip to content

Instantly share code, notes, and snippets.

View rufer7's full-sized avatar

Marc Rufer rufer7

View GitHub Profile
@rufer7
rufer7 / ExampleApplication.java
Created June 6, 2015 15:40
Example application class for a Dropwizard application
/*
* Copyright (C) 2015 Marc Rufer (m.rufer@gmx.ch)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rufer7
rufer7 / ApplicationConfiguration.java
Created June 6, 2015 15:36
Example application configuration class for a Dropwizard application
/*
* Copyright (C) 2015 Marc Rufer (m.rufer@gmx.ch)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rufer7
rufer7 / .gitignore
Created June 2, 2015 06:59
IDEA-Gitignore for Java
# Java
*.class
target/
# Package Files
*.jar
*.war
*.ear
# IntelliJ
@rufer7
rufer7 / AllmanCodestyleSample.java
Last active August 29, 2015 14:22
Allman codestyle for IntelliJ
/**
* Copyright 2015 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rufer7
rufer7 / pom.xml
Created April 18, 2015 14:59
maven pom.xml-file of flyway-example
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>be.rufer.playground</groupId>
<artifactId>flyway-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Flyway example</name>
@rufer7
rufer7 / additional-spring-configuration-metadata.json
Last active August 29, 2015 14:18
Metadata for spring configuration
"properties": [
{
"name": "sample.property.name",
"type": "java.lang.Integer",
"description": "Description for sample.property.name.",
"defaultValue": 1
},
{
"name": "another.property.name",
"type": "java.lang.String",
@rufer7
rufer7 / SampleHeaderEnricher.java
Last active August 29, 2015 14:18
Custom header enricher, which returns the headers to add to messages
package be.rufer.amqp.integration.messaging.enricher;
import org.springframework.integration.Message;
import java.util.HashMap;
import java.util.Map;
public class SampleHeaderEnricher {
public Map<String, Object> addCustomHeaders(Message<?> message) {
@rufer7
rufer7 / SampleMessageHandler.java
Created April 3, 2015 09:02
Sample of a message handler
package be.rufer.amqp.integration.messaging.handler;
import org.springframework.integration.Message;
import org.springframework.integration.MessagingException;
import org.springframework.integration.core.MessageHandler;
import java.util.Collections;
public class SampleMessageHandler implements MessageHandler {
@rufer7
rufer7 / swissunihockey-key-matcher-result
Created March 26, 2015 22:50
Excerpt of the result of swissunihockey-key-matcher
H1L GF U21C Matches
6 3 3
6 2 3
6 5 3
6 4 3
...
package be.rufer.swissunihockey;
import be.rufer.swissunihockey.matcher.KeyMatcher;
import be.rufer.swissunihockey.matcher.MatchingPrinter;
import be.rufer.swissunihockey.matcher.domain.MatchingResult;
import be.rufer.swissunihockey.matcher.domain.League;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.HashMap;