Instantly share code, notes, and snippets.

Thilko Richterthilko

• Sort options
Last active Jan 12, 2019
Shopping Cart kata
View gist:2cce5963883855af72067c847c8d87ab
 Implement the code for a supermarket checkout that calculates the total price of a number of items. Products can be scanned and at the end a receipt be printed. 1. A product at a time can be scanned. Customer can see a subtotal which shows just the total of all scanned products. 2. Checkout can print a receipt which contains the Product and the price. 3. Multiple products of one type can be scanned, i.e two milks at once. 4. Products can have a price per weight i.e. apples with costs 2.50€/kg. 5. Discount: if a customer buys 2 bottles of milk they get the two for the price of one 6. Discount: if a customer buys 5 bars of chocolate they receive a discount of 10% for the total price of the chocolates Example products:
Last active Apr 2, 2016
Diamond Kata
View DiamondKataTest.java
 import static java.util.Arrays.asList; import org.hamcrest.MatcherAssert; import static org.hamcrest.core.Is.is; import org.junit.Assert; import org.junit.Test; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.StringJoiner;
Last active Aug 29, 2015
Roman numerals kata
View kata.java
 import org.junit.Test; import java.util.Collections; import java.util.TreeMap; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; public class FizzBuzzTest { // doc:
Created Nov 11, 2014
A java version of game of line shamelessy stolen from rosetta code.
View gdcr14 game of life refactoring session
 public class GameOfLife{ public static void main(String[] args){ String[] dish= { "_#_", "_#_", "_#_",}; int gens= 3; for(int i= 0;i < gens;i++){ System.out.println("Generation " + i + ":"); print(dish);
View gist:7986810
 Stefan Tilkov: Was ist mit Vollständigkeit? Ist es wichtig, dass ich alles dokumentiert habe? Wie detailliert muss denn Architekturdokumentation sein? Gernot Starke: Das ist total überbewertet. Ich bekomme die Krise, wenn mir jemand sagt: „Ich will vollständige Dokumentation haben.” Das ist dieser 70er und 80er Jahre Ansatz – „Ich kann die gesamten Daten eines Unternehmens alle genau modellieren” - welch ein Blödsinn. Niemals kann ich das machen. Ich will keine vollständige Dokumentation, sondern relevante, aktuelle und verständliche haben. Das ist mir viel wichtiger als vollständig.
Last active Dec 31, 2015
View gist:7927171
Created Sep 24, 2012
jira team_dashboard integration sample
View gist:3776056
 module Sources module Number module Jira def tickets_for_filter_id(filter_id) uri = URI('http://jira.blau.de/rest/api/latest/search') params = { :maxResults => "1000", :jql => "filter = #{filter_id}"} uri.query = URI.encode_www_form(params) req = Net::HTTP::Get.new(uri.request_uri) req.basic_auth 'user_name', 'xxxxxx'
Created Oct 30, 2011