Skip to content

Instantly share code, notes, and snippets.

Benedikt Ritter britter

Block or report user

Report or block britter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@britter
britter / # ant - 2019-09-26_11-06-16.txt
Created Sep 26, 2019
ant on macOS 10.14.6 - Homebrew build logs
View # ant - 2019-09-26_11-06-16.txt
Homebrew build logs for ant on macOS 10.14.6
Build date: 2019-09-26 11:06:16
@britter
britter / junit-4+5.pom.xml
Last active Sep 4, 2018
Full POM file for using JUnit 4 alongside JUnit 5
View junit-4+5.pom.xml
<?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>de.codecentric.junit5</groupId>
<artifactId>junit4-junit5</artifactId>
<version>1.0-SNAPSHOT</version>
@britter
britter / ParentActor.scala
Last active Mar 9, 2017
Closing over the enclosing scope using Props
View ParentActor.scala
final class ParentActor extends Actor {
private var value: Int = 0
override def receive = {
case Increment => value++
case CreateChild => context.actorOf(Props(new ChildActor(value)))
}
}
View Do stuff with scala
scala> val xs = List(5,-2,4,9)
scala> xs.zip(xs.scanLeft(0)(_+_).tail)
res2: List[(Int, Int)] = List((5,5), (-2,3), (4,7), (9,16))
@britter
britter / PersonalausweisCheckDigit.java
Created May 5, 2016
Apache Commons Validator CheckDigit implementation for validating German identity card ("Personalausweis") numbers
View PersonalausweisCheckDigit.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
@britter
britter / run.log
Created Mar 31, 2016
Result of running run.sh from codecentric/spring-boot-configuration-example
View run.log
$ ./run.sh
run.sh: Running application without configuration
Application.java: Application initialized with the following configuration:
Application.java: TypeSafeConfiguration{propertyName='null', propertyname='null', property_name='null'}
Application.java: AnnotationConfiguration{propertyDashName='not set', propertyPointName='not set', propertyName='not set', propertyname='not set', property_name='not set'}
run.sh: Running application with environment variables
run.sh: Set the following environment variables:
@britter
britter / pom.xml
Last active Jan 3, 2016
Profile for running the buildnumber-maven-plugin when not running on Heroku
View pom.xml
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
@britter
britter / pom.xml
Last active Dec 23, 2015
Profile for detecting Heroku build
View pom.xml
<profile>
<id>heroku</id>
<activation>
<property>
<name>env.SOURCE_VERSION</name>
</property>
</activation>
<properties>
<buildNumber>${env.SOURCE_VERSION}</buildNumber>
</properties>
@britter
britter / build.log
Created Dec 23, 2015
Excerpt from Heroku build log
View build.log
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ spring-boot-heroku-demo ---
[INFO] Executing: /bin/sh -c cd '/tmp/build_503aea84b3313c9d0ae8587e46ee355c/britter-spring-boot-heroku-demo-846b48d' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /tmp/build_503aea84b3313c9d0ae8587e46ee355c/britter-spring-boot-heroku-demo-846b48d
[INFO] Storing buildNumber: null at timestamp: 1450623519645
@britter
britter / home.html
Created Dec 23, 2015
Using #strings to abbreviate the git commit hash
View home.html
<a href="https://github.com"
th:href="#{git.commit.link}"
th:text="${#strings.substring('__#{git.commit.hash}__', 0, 7)}"
>1bb7244</a>
You can’t perform that action at this time.