Skip to content

Instantly share code, notes, and snippets.

View wfouche's full-sized avatar

Werner Fouché wfouche

View GitHub Profile
@wfouche
wfouche / asciidoctorj.java
Created July 7, 2025 22:08
JBang - asciidoctorj.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.asciidoctor:asciidoctorj:3.0.0
//DEPS org.asciidoctor:asciidoctorj-api:3.0.0
//DEPS org.asciidoctor:asciidoctorj-cli:3.0.0
//DEPS org.asciidoctor:asciidoctorj-epub3:2.1.3
//DEPS org.asciidoctor:asciidoctorj-diagram:3.0.1
//DEPS org.asciidoctor:asciidoctorj-diagram-batik:1.17
//DEPS org.asciidoctor:asciidoctorj-diagram-ditaamini:1.0.3
//DEPS org.asciidoctor:asciidoctorj-diagram-plantuml:1.2025.3
@wfouche
wfouche / jmv.java
Created July 5, 2025 06:21
JVM major version number - Java 8+
public class jmv {
static String getJvmMajorVersion() {
String version = System.getProperty("java.version");
if (version.startsWith("1.")) {
version = version.substring(2);
}
return version.replaceAll("(\\d+).+", "$1");
}
public static void main(String[] args) {
@wfouche
wfouche / jbang-deps.py
Last active July 1, 2025 09:57
Show newers versions of JBang //DEPS
import json, os, sys
os.system("jbang info tools %s > jbang-deps.json"%(sys.argv[1]))
file = open("jbang-deps.json")
d = json.load(file)
file.close()
os.unlink("jbang-deps.json")
os.system("jbang toolbox@maveniverse versions " + ",".join(d["dependencies"]))
@wfouche
wfouche / asciidoc.java
Last active June 28, 2025 11:27
asciidoc
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.asciidoctor:asciidoctorj:3.0.0
//DEPS org.asciidoctor:asciidoctorj-diagram:3.0.1
//DEPS org.asciidoctor:asciidoctorj-diagram-plantuml:1.2025.3
import org.asciidoctor.Asciidoctor;
import org.asciidoctor.Options;
import org.asciidoctor.SafeMode;
import java.io.File;
@wfouche
wfouche / git-workflow.puml
Last active May 25, 2025 09:59
Using PlantUML to represent a Git Workflow
@startuml
skinparam ParticipantPadding 50
participant "master" as dev
participant "v8" as s4
participant "v9" as s5
participant "v10" as s6
activate dev