Skip to content

Instantly share code, notes, and snippets.

Erik Pragt bodiam

Block or report user

Report or block bodiam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View build.gradle.kts
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 Apr 19, 2019
A refactored version of the TicTacToe
View TicTacToeRefactored.kt
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")
View TicTacToe.kt
package nsmain
import kotlin.random.Random
typealias PlayerMark = String
//Board is a list of marks, indexed by x,y coords from upper left 0 based
class Board(private var cells: List<PlayerMark?>) {
companion object {
View how-to-setup-lambda-to-talk-to-internet-and-vpc.md

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@bodiam
bodiam / file.adoc
Last active Jul 5, 2016
Output of ./gradlew bestbooks-export:dependencies
View file.adoc
testCompileOnly - Compile dependencies for source set 'test'.
+--- project :bestbooks-core
|    +--- org.springframework.boot:spring-boot-starter-freemarker: FAILED
|    +--- org.springframework.boot:spring-boot-starter-web: FAILED
|    +--- org.springframework.boot:spring-boot-devtools: FAILED
|    +--- org.springframework.boot:spring-boot-starter-actuator: FAILED
|    +--- org.springframework.boot:spring-boot-starter-undertow: FAILED
|    +--- org.springframework.boot:spring-boot-starter-security: FAILED
|    +--- org.springframework.boot:spring-boot-starter-data-jpa: FAILED
@bodiam
bodiam / AsciiLite.groovy
Created Apr 19, 2016
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.
View AsciiLite.groovy
/**
* 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
*/
@bodiam
bodiam / healthcheck.groovy
Created May 25, 2015
A small script to check the health status of your Grails 3 and Spring Boot applications
View healthcheck.groovy
#!/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:
@bodiam
bodiam / asciidoc.css
Last active Aug 29, 2015 — forked from ImJasonH/markdown.css
Render HTML as unrendered Asciidoc - See http://jsbin.com/mifepiqosa/1/edit?html,css,output
View asciidoc.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@bodiam
bodiam / benchmark.java
Created Nov 22, 2014
AsciiDoc benchmark for JDK 1.6 and JDK 1.8
View benchmark.java
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.FileReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException, ScriptException {
ScriptEngineManager manager = new ScriptEngineManager();
View Slow.groovy
@Grab(group='org.gperfutils', module='gbench', version='0.4.2-groovy-2.1')
import java.lang.String
trait NoStackTrace {
Throwable fillInStackTrace() {
return this
}
}
class ExpensiveException extends RuntimeException { }
You can’t perform that action at this time.