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 / 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 / # 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 / .bash_profile
Created December 14, 2013 15:13
My .bash_profile used on my MacBooko Pro: Includes development tools in PATH. Prepends /usr/local/bin and /usr/local/sbin to PATH, since on Mac OS the default PATH has /usr/bin before /usr/local/bin (for what ever reason). Sets up the prompt and bash completion. Configures man pages to be shown in PDF Viewer.
## SDKs ##
export JAVA_6_HOME=`/usr/libexec/java_home -v 1.6`
export JAVA_7_HOME=`/usr/libexec/java_home -v 1.7`
export JAVA_8_HOME=`/usr/libexec/java_home -v 1.8`
export JAVA_HOME=$JAVA_7_HOME
export GROOVY_HOME=/Applications/dev/groovy/groovy-2.1.5
export SCALA_HOME=/Applications/dev/scala/scala-2.10.2
## Build Tools ##
export MAVEN_HOME=/Applications/dev/maven/apache-maven-3.1.1
@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 / jdk7-timezones.txt
Last active January 2, 2016 03:09
TimeZones present in JDK7 and JDK8, sorted alphabetically by their key, as well as a diff.
sun.util.calendar.ZoneInfo[id="ACT",offset=34200000,dstSavings=0,useDaylight=false,transitions=10,lastRule=null]
sun.util.calendar.ZoneInfo[id="AET",offset=36000000,dstSavings=3600000,useDaylight=true,transitions=142,lastRule=java.util.SimpleTimeZone[id=AET,offset=36000000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=9,startDay=1,startDayOfWeek=1,startTime=7200000,startTimeMode=1,endMode=3,endMonth=3,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=1]]
sun.util.calendar.ZoneInfo[id="AGT",offset=-10800000,dstSavings=0,useDaylight=false,transitions=62,lastRule=null]
sun.util.calendar.ZoneInfo[id="ART",offset=7200000,dstSavings=0,useDaylight=false,transitions=125,lastRule=null]
sun.util.calendar.ZoneInfo[id="AST",offset=-32400000,dstSavings=3600000,useDaylight=true,transitions=142,lastRule=java.util.SimpleTimeZone[id=AST,offset=-32400000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,end