Skip to content

Instantly share code, notes, and snippets.

View marc0der's full-sized avatar

Marco Vermeulen marc0der

View GitHub Profile
@marc0der
marc0der / rules-meta-prompt.md
Last active July 15, 2025 13:11
A meta-prompt for a rules template

Please generate me a rules file template that I can base my rules files on. I have a similar template for prompts 00-prompt-template.md and would like something similar for my rules files.

The rules template should have a structure that is optimised for an LLM to use as system context, yet also human readable. It should be applicable to a variety of topics such as Domain Driven Design, Hexagonal Architecture, Testing Strategy, Functional Kotlin etc. Some of these rules will be more technical in nature while others purely philisophical.

The target rules should generally stay short and concise (under 200 lines), so please factor this into your template too

Please close with a TL;DR section at the end of the rules template!

Please follow industy best practices and emerging patterns found on the internet for rules files when formalating this rules template!

@marc0der
marc0der / domain-driven-design.md
Created July 15, 2025 11:27
Domain Driven Design rules file

Domain Driven Design (DDD)

Strategic design methodology focusing on modeling complex business domains through collaboration between domain experts and developers. Emphasizes creating a shared understanding of the business domain through ubiquitous language and bounded contexts.

Context

Apply DDD principles when building complex business applications where domain complexity is the primary challenge.

Applies to: Complex business domains, enterprise applications, microservices architectures
Level: Strategic/Tactical - guides both high-level architecture and implementation patterns

@marc0der
marc0der / README.md
Last active February 18, 2022 14:17

Functional error handling in Kotlin

Agenda:

  • About the (simple) exercise
  • Higher Order Functions
  • Throwing exceptions: here be dragons!!
  • Sentinel values: better but not great
  • The Option: error as an ADT
  • Functional combinators: add some sugar
@marc0der
marc0der / ST.scala
Last active November 15, 2020 21:20
ST Monad
class ForST private constructor() {
companion object
}
typealias STOf<S, A> = arrow.Kind2<ForST, S, A>
typealias STPartialOf<S> = arrow.Kind<ForST, S>
@Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE")
inline fun <S, A> STOf<S, A>.fix(): ST<S, A> = this as ST<S, A>
@marc0der
marc0der / gist:68e1d71d7542e5cf548f21ba9692afe0
Last active May 15, 2019 14:03
Proposed new Java list view for SDKMAN!
================================================================================
Available Java Versions
================================================================================
Vendor | Current | Version | Status | Identifier
--------------------------------------------------------------------------------
AdoptOpenJDK | | 12.0.1.j9 | available | 12.0.1.j9-adpt
| >>> | 12.0.1.hs | available | 12.0.1.hs-adpt
| | 11.0.3.j9 | installed | 11.0.3.j9-adpt
| | 11.0.3.hs | available | 11.0.3.hs-adpt
| | 8.0.212 | available | 8.0.212-adpt
@marc0der
marc0der / Main.scala
Created December 4, 2016 20:23
Scala Ratpack App
object Main extends App {
RatpackServer.start { spec =>
spec.serverConfig(c => c.env())
.registry(Guice.registry(g => g.bind(classOf[VersionHandler])))
.handlers(chain => chain.get("version", classOf[VersionHandler]))
}
}
case class VersionConfig(@BeanProperty appName: String, @BeanProperty appVersion: String)
@marc0der
marc0der / build.gradle
Created September 16, 2016 10:31
Using a custom version resolution strategy with the Gradle Plugin Publish Plugin
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.6"
classpath "com.netflix.nebula:nebula-kotlin-plugin:1.0.3"
}
}
@marc0der
marc0der / install_jdk_mac.sh
Last active February 7, 2022 08:50
Preliminary CLI installation of JDK on Mac
#!/bin/bash
#Tweak this if need be for you system!
TARGET_VOLUME="/Volumes/Macintosh HD"
DMG_NAME="jdk-8u101-macosx-x64.dmg"
MOUNT_VOLUME="/Volumes/JDK 8 Update 101"
SHA_256="680de8ddead3867fc34e7ff380f437c7ddb8dc75eb606186a3e8ae7e3b8c7fbc"
echo "Getting the DMG..."
@marc0der
marc0der / record.sh
Created June 17, 2016 17:06
Set up tmux to run two Gradle builds side by side in a pre-configured Docker containers
#bin/bash
SESSION="gradle"
tmux -2 new-session -d -s $SESSION
tmux new-window -t $SESSION:1 -n 'benchmark'
tmux split-window -v
tmux select-pane -t 0
tmux send-keys "clear" C-m
tmux send-keys "docker run -it marc0der/gradle:1 zsh" C-m
tmux send-keys "sdk use gradle 2.12" C-m
@marc0der
marc0der / chromecast-mine
Created January 14, 2016 10:50
Mines Chromecast Images
#!/usr/bin/env groovy
@Grab("org.codehaus.geb:geb-core:0.7.2")
@Grab("org.seleniumhq.selenium:selenium-chrome-driver:2.48.2")
import geb.*
import java.security.MessageDigest
import static java.net.URLDecoder.decode