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 mything.db | |
| import com.zaxxer.hikari.HikariDataSource | |
| import liquibase.Liquibase | |
| import liquibase.database.DatabaseFactory | |
| import liquibase.database.jvm.JdbcConnection | |
| import liquibase.resource.ClassLoaderResourceAccessor | |
| import org.testcontainers.containers.PostgreSQLContainer | |
| import org.testcontainers.spock.Testcontainers | |
| import spock.lang.Shared |
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
| #! /bin/sh | |
| # Requires curl, jq & /var/run/docker.sock to be mounted into the container | |
| set -eu | |
| main() { | |
| alias=$1 | |
| container_id="$(hostname)" |
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 | |
| domain_name=$1 | |
| brew install certbot | |
| $( brew --prefix certbot )/libexec/bin/pip install certbot-dns-route53 |
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
| sealed interface Integer { | |
| operator fun plus(other: Integer): Integer | |
| operator fun plus(other: NonZeroInteger): Integer | |
| operator fun plus(other: NonNegativeInteger): Integer | |
| operator fun plus(other: NonPositiveInteger): Integer | |
| operator fun plus(other: PositiveInteger): Integer | |
| operator fun plus(other: NegativeInteger): Integer | |
| operator fun plus(other: Zero): Integer | |
| operator fun div(other: NonZeroInteger): Integer |
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
| sealed interface Json { | |
| @JvmInline value class Boolean(val value: kotlin.Boolean) : Json | |
| @JvmInline value class Number(val value: kotlin.Number) : Json | |
| @JvmInline value class String(val value: kotlin.String) : Json | |
| class Object(private val value: Map<kotlin.String, Json?>) : Map<kotlin.String, Json?> by value, Json | |
| class Array(private val value: List<Json?>) : List<Json?> by value, Json | |
| } | |
| interface ToJson { |
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
| inline operator fun <reified T> Map<String, Any?>.get(key: String): Result<T> = | |
| if (this.contains(key)) { | |
| val value = this[key] | |
| if (value is T) { | |
| Result.success(value) | |
| } else { | |
| val message = if (value == null) { | |
| "[$key] returned null, expected [${T::class}]" | |
| } else { | |
| "[$key] returned [$value] of type [${value::class}], expected type [${T::class}]" |
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
| . | |
| ├── build.gradle.kts | |
| └── src | |
| ├── app | |
| │ ├── module-info.java | |
| │ └── Main.kt | |
| ├── auction | |
| │ ├── api | |
| │ │ ├── module-info.java | |
| │ │ └── AuctionHouse.kt |
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
| . | |
| ├── build.gradle.kts | |
| ├── app | |
| │ ├── build.gradle.kts | |
| │ └── src | |
| │ ├── module-info.java | |
| │ └── Main.kt | |
| ├── auction | |
| │ ├── api | |
| │ │ ├── build.gradle.kts |
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
| import io.kotest.core.spec.style.StringSpec | |
| import io.kotest.data.headers | |
| import io.kotest.data.row | |
| import io.kotest.data.table | |
| import io.kotest.matchers.shouldBe | |
| import java.time.LocalDate | |
| class AgeSpec : StringSpec({ | |
| ageScenarios.rows.forEach { (dateOfBirth, date, expectedAge) -> |
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
| import spock.lang.Specification | |
| import spock.lang.Unroll | |
| import java.time.LocalDate | |
| class AgeSpec extends Specification { | |
| @Unroll | |
| def "A person born on #dateOfBirth will be #expectedAge on #date"() { |