Skip to content

Instantly share code, notes, and snippets.

View romain-grecourt's full-sized avatar
🤟
[^._.^]ノ彡

Romain Grecourt romain-grecourt

🤟
[^._.^]ノ彡
View GitHub Profile
@romain-grecourt
romain-grecourt / RequestBuffering.java
Last active February 9, 2024 02:36
Helidon Request buffering to compute a payload hash
package com.acme;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
@romain-grecourt
romain-grecourt / README.md
Last active August 1, 2023 16:28
GitHub action cheat sheet
@romain-grecourt
romain-grecourt / idea.gdsl
Created November 8, 2021 22:07
idea.gdsl
// see https://confluence.jetbrains.com/display/GRVY/Scripting+IDE+for+DSL+awareness
import com.intellij.lang.jvm.types.JvmReferenceType
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiClassObjectAccessExpression
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiElementVisitor
import com.intellij.psi.PsiMethod
import com.intellij.psi.PsiParameter
import com.intellij.psi.PsiQualifiedNamedElement
@romain-grecourt
romain-grecourt / ArchetypeScript.groovy
Last active October 21, 2021 00:57
Helidon Archetype Groovy DSL
package io.helidon.build.archetype.dsl
interface ArchetypeScript {
/**
* Declares an archetype script.
* @param body archetype body closure
*/
void archetype(@DelegatesTo(Archetype) Closure body)
@romain-grecourt
romain-grecourt / helidon-site-guide-notes.md
Last active May 17, 2021 18:18
Helidon Site Guide Notes

Style guide inconsistencies

Overall observations

The guide has been made after the sketchs and only document them. It does not provide any actual guide-lines for building other pages.

The style guide is not adaptable to our framework (vuetify) as-is, thus we need to tune both the framework and the guide.

Hard CSS tuning might result in broken components.

Enum ordinal as bit position

enum Modifier {
	DEFAULT, PRIVATE, PROTECTED, PUBLIC, STATIC, FINAL
}
DEFAULT     ordinal: 0  bitmask: 2^0 = (int) 1
@romain-grecourt
romain-grecourt / recette.md
Last active August 27, 2020 01:55
quenelles de poisson sauce nantua

INGREDIENTS

Quenelles:

Ingredient Quantity
Butter 120 gr
Flour 200 gr
Milk 75 cl
White fish 200 gr
@romain-grecourt
romain-grecourt / dual-init-state-binary.md
Last active July 24, 2020 17:23
dual init state with atomic integer
int DOWNSTREAM_INIT = Integer.MIN_VALUE >>> 1
int UPSTREAM_INIT = Integer.MIN_VALUE >>> 2
int SUBSCRIPTION_LOCK = Integer.MIN_VALUE >>> 3

AtomicInteger contenders = new AtomicInteger(Integer.MIN_VALUE)

private boolean halfInit(int mask) {
    int c = contenders.getAndUpdate(v -> v < 0 ? v | mask : v);
    return c < 0 && (c & mask) == 0;
@romain-grecourt
romain-grecourt / helidon-stager-maven-plugin.md
Last active June 11, 2020 01:19
Helidon Stager Maven Plugin

Helidon Stager Maven Plugin

The stager Maven plugin allows to stage a directory. This is somehow similar to the maven-assembly-plugin but more compact and specific to our needs.

<!-- Maven properties used below -->
<properties>
    <site.output.dir>${project.build.directory}/site</site.output.dir>
    <cname>helidon.io</cname>

CLI Extension

Separate modules to be forked by the cli to handle things that are too expensive to be bundled with native-image (e.g. "https").

It shall be invoked with java -jar and not require classpath, either self-contained code or a standalone JAR (e.g. shaded).

The JAR file is embedded as a resource in the native CLI binary.

NOTE: Proxy has to be propagated to the forked JVM properly.