Skip to content

Instantly share code, notes, and snippets.

{
"openapi": "3.0.1",
"info": {
"title": "Apply Default Global SecurityScheme in springdoc-openapi",
"version": "1.0.0"
},
"servers": [
{
"url": "http://localhost:8080",
"description": "Generated server url"
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.0.5"
id("io.spring.dependency-management") version "1.1.0"
// id("org.graalvm.buildtools.native") version "0.9.20"
kotlin("jvm") version "1.8.20"
kotlin("plugin.spring") version "1.8.20"
kotlin("plugin.jpa") version "1.8.20"
}
@bodiam
bodiam / AsciiLite.groovy
Created April 19, 2016 13:50
AsciidoctorJ has a dependency on JRuby, which is quite a heavy library to download and load. This one is based on Groovy, and could easily be ported to Java, and while limited, does provide quite some functionality.
/**
* A very basic regex based parser for Asciidoc.
*
* Based on Slimdown (Markdown) parsers:
* - https://gist.github.com/jbroadway/2836900
* - https://gist.github.com/renehamburger/12f14a9bd9297394e5bd
* - https://gist.github.com/paulcuth/8967731
*
* @author Erik Pragt
*/
import io.nacular.doodle.application.Application
import io.nacular.doodle.application.application
import io.nacular.doodle.core.Display
import io.nacular.doodle.theme.ThemeManager
import io.nacular.doodle.theme.native.NativeTheme
import org.kodein.di.instance
class MyApp(display: Display,
manager: ThemeManager,
theme : NativeTheme
import io.nacular.doodle.application.Application
import io.nacular.doodle.application.application
import io.nacular.doodle.controls.panels.GridPanel
import io.nacular.doodle.controls.text.Label
import io.nacular.doodle.core.*
import io.nacular.doodle.geometry.Size
import io.nacular.doodle.layout.constrain
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.kodein.di.instance
@bodiam
bodiam / SoftAssert.kt
Created September 23, 2021 04:57
SoftAssertions for AssertJ in Kotlin
import org.assertj.core.api.SoftAssertions
fun softAssert(function: SoftAssertions.() -> Unit) {
SoftAssertions().apply { function() }.assertAll()
}
@bodiam
bodiam / ValidatorTest.kt
Created November 24, 2019 05:22
Validator test
package net.schematix.validator
import com.fasterxml.jackson.dataformat.csv.CsvMapper
import com.worldturner.medeia.api.UrlSchemaSource
import com.worldturner.medeia.api.jackson.MedeiaJacksonApi
import org.junit.jupiter.api.Test
class ValidatorTest {
@bodiam
bodiam / healthcheck.groovy
Created May 25, 2015 20:16
A small script to check the health status of your Grails 3 and Spring Boot applications
#!/usr/bin/env groovy
import groovy.json.JsonSlurper
/**
* Displays the status of registered Spring Boot URL's.
* To register URL's, create a file called healthcheck.txt in the following format
*
* <name>,<url>
*
* Eg: healthcheck.txt:
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.1.6.RELEASE"
id("io.spring.dependency-management") version "1.0.7.RELEASE"
kotlin("jvm") version "1.2.71"
kotlin("plugin.spring") version "1.2.71"
}
group = "io.jworks.feeds"
@bodiam
bodiam / TicTacToeRefactored.kt
Created April 19, 2019 04:19
A refactored version of the TicTacToe
package nsmain2
import kotlin.random.Random
inline class PlayerMark(val value: String)
class Board(private val cells: List<PlayerMark?>) {
companion object {
val playerX = PlayerMark("x")