This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package uk.org.lidalia; | |
| import org.joda.time.Interval; | |
| import org.joda.time.Period; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| import junitparams.JUnitParamsRunner; | |
| import junitparams.Parameters; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package uk.org.lidalia; | |
| import org.joda.time.*; | |
| import com.google.common.base.Function; | |
| import com.google.common.collect.ImmutableMap; | |
| import static com.google.common.collect.FluentIterable.from; | |
| import static java.util.Arrays.asList; | |
| import static org.joda.time.DurationFieldType.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package uk.org.lidalia.lang.collection | |
| trait Iterable[+A] { | |
| type MayBeEmptySelf[+B] <: Iterable[B] | |
| // type NonEmptySelf[+B] <: NonEmptyIterable[B] | |
| type Self[+B] <: Iterable[B] | |
| def head: ?[A] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| digraph these_isles { | |
| node [shape=rectangle,style=filled,fillcolor=lightcyan]; | |
| label1[label="Geographic\nTerms"]; | |
| "Mainland\nEngland"; | |
| "Mainland\nWales"; | |
| "Mainland\nScotland"; | |
| node [shape=oval] | |
| gb[label="Great\nBritain"]; | |
| Ireland; | |
| mona[label="Ynys Mon"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| digraph british_isles { | |
| node [shape=rectangle,style=filled,fillcolor=lightcyan]; | |
| other[label="Other"]; | |
| england[label="Mainland\nEngland"]; | |
| wales[label="Mainland\nWales"]; | |
| scotland[label="Mainland\nScotland"]; | |
| node [shape=oval]; | |
| islands[label="Islands"]; | |
| gb[label="Great\nBritain"]; | |
| Ireland; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| digraph these_isles { | |
| node [shape=rectangle,style=filled,fillcolor=lightpink]; | |
| ireland[label="Ireland"]; | |
| jersey[label="Bailiwick\nof\nJersey"]; | |
| man[label="Isle of\nMan"]; | |
| uk[label="United\nKingdom"]; | |
| ni[label="Northern\nIreland"]; | |
| crown_deps[label="Crown\nDependencies"]; | |
| guernsey[label="Bailiwick\nof\nGuernsey"] | |
| { Scotland England Wales ni } -> uk; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Overview of how this works: | |
| // 1. Initialisation data is used to create an instance of LoadedRoot. | |
| // 2. LoadedRoot contains a component which is the virtual top-level component. | |
| // It uses the initialisation data and can be sure that it won't change (a guarantee you don't have with component props). | |
| // It's the only component to have state. | |
| // The state can applies to the entire SPA, all routes. | |
| // It gets told by the router which page to render. | |
| // It can house logic that applies when certain pages change to certain other pages. | |
| // 3. LoadedRoot is passed to Routes.routerConfig. | |
| // Routes.routerConfig creates a config that sends all routes to the LoadedRoot component, using the Page & RouterCtl as props. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @CompileStatic | |
| class MyString { | |
| @Delegate | |
| private final String decorated | |
| MyString(String decorated) { | |
| this.decorated = decorated | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package scala.util | |
| class RightBuilder[+L] private[util]() { def apply[R](r: R): Right[L, R] = Right(r) } | |
| class LeftBuilder[+R] private[util]() { def apply[L](l: L): Left[L, R] = Left(l) } | |
| object Eithers { | |
| private val leftBuilder = new LeftBuilder[Nothing] | |
| private val rightBuilder = new RightBuilder[Nothing] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| function clear_build_cache { | |
| docker builder prune -f > /dev/null | |
| } | |
| function clean_start { |