Skip to content

Instantly share code, notes, and snippets.

View britter's full-sized avatar

Benedikt Ritter britter

View GitHub Profile
@britter
britter / README.md
Created February 6, 2021 12:11
HTTP return codes cheat sheet

HTTP return codes cheat sheet

1**: Hold on

2**: Here you go

3**: Go away

4**: You fucked up

@britter
britter / # ant - 2019-09-26_11-06-16.txt
Created September 26, 2019 09:11
ant on macOS 10.14.6 - Homebrew build logs
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 April 14, 2020 06:32
Full POM file for using JUnit 4 alongside JUnit 5
<?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 March 9, 2017 15:53
Closing over the enclosing scope using Props
final class ParentActor extends Actor {
private var value: Int = 0
override def receive = {
case Increment => value++
case CreateChild => context.actorOf(Props(new ChildActor(value)))
}
}
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 11:24
Apache Commons Validator CheckDigit implementation for validating German identity card ("Personalausweis") numbers
/*
* 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 March 31, 2016 13:04
Result of running run.sh from codecentric/spring-boot-configuration-example
$ ./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 January 3, 2016 11:58
Profile for running the buildnumber-maven-plugin when not running on Heroku
<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 December 23, 2015 13:26
Profile for detecting Heroku build
<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 December 23, 2015 13:20
Excerpt from Heroku 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