Skip to content

Instantly share code, notes, and snippets.

View ndeloof's full-sized avatar
💭
Preparing a new set of bugs

Nicolas De loof ndeloof

💭
Preparing a new set of bugs
View GitHub Profile
@ndeloof
ndeloof / tu-es-principal-engineer-proud-peacock.md
Created June 1, 2026 07:44
compose-go v3 — Plan de refonte autour de yaml.Node (lazy interpolation, source diagnostics, in-place rewrite)

compose-go v3 — Refonte autour de yaml.Node

Contexte

La librairie compose-go parse les fichiers compose.yaml pour Docker Compose et d'autres outils tiers. La v2 présente un défaut conceptuel : chaque fichier est désérialisé en map[string]any immédiatement après parsing, puis interpolé avant la fusion multi-fichiers. Le contexte de chargement (variables d'environnement, répertoire de travail, fichier d'origine, position ligne/colonne) est perdu dès la conversion. Conséquence :

  • include: permet de redéfinir project_directory et env_file pour le fichier inclus, mais comme l'interpolation est eager et par-fichier, elle ne peut pas être différée. Toute reconsidération ultérieure du contexte est impossible.
  • extends souffre d'un problème analogue (un service étendu depuis un fichier B devrait être interpolé dans le contexte de B, ce qui marche partiellement aujourd'hui mais via du code spécifique).
  • La résolution des chemins relatifs utilise toujours le WorkingDir racine, même pour de
@ndeloof
ndeloof / gist_compose_go_v3_refactoring.md
Last active May 21, 2026 06:29
compose-go v3 yaml.Node refactoring — initial plan + current postMergeLegacy/mapstructure removal + docker/compose#13799 validation strategy

compose-go v3 — refactoring plan: yaml.Node based loader

This document consolidates the full refactoring story for compose-spec/compose-go's switch from a map[string]any loader to a yaml.Node based pipeline (v3 module path). It supersedes the incremental notes (plan.md at commit 60e91d3 and the subsequent "postMergeLegacy / mapstructure removal" addendum): the design choices that emerged in those two passes are folded in from the start.

@ndeloof
ndeloof / garmin.js
Created May 20, 2026 14:39
Garmin workout cleanup
(async () => {
const DRY_RUN = true;
const PAGE_WAIT = 800;
const DELETE_DELAY = 300;
const MAX_PAGES = 50;
const sleep = ms => new Promise(r => setTimeout(r, ms));
const csrf = document.querySelector('meta[name="csrf-token"]')?.content;
if (!csrf) throw new Error('CSRF token introuvable dans <meta name="csrf-token">');
models:
llama:
model: ai/example-model
context-size: 1024
runtime-flags: "--no-prefill-assistant"
services:
# Option 1 : by host alias
app:
services:
app:
image: app-without-curl-inside
# app is running a webserver on 8080
app-health:
image: curl
command: sleep infinity
network_mode: "service:app"
healthcheck:
@ndeloof
ndeloof / docker.sh
Created February 1, 2023 09:05
completion for docker CLI
# bash completion V2 for docker -*- shell-script -*-
__docker_debug()
{
if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
fi
}
# Macs have bash3 for which the bash-completion package doesn't include
#! /bin/bash
# Compatibility check for registry to support multi-architecutre docker images
# (also required for docker app support)
#
# Usage:
# docker login <REGISTRY>
# ...
# ./multiarch.sh <REGISTRY>
#
#! /bin/bash
# Compatibility check for registry to support multi-architecutre docker images
# (also required for docker app support)
#
# Usage:
# docker login <REGISTRY>
# ...
# ./multiarch.sh <REGISTRY>
#
@ndeloof
ndeloof / eks.md
Created September 11, 2019 08:01
compose-on-eks

Following docs on https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html

Create EKS cluster

~ eksctl create cluster --name kikito --version 1.14 --nodegroup-name standard-workers --node-type m5.large --nodes 2 --nodes-min 1 --nodes-max 4 --node-ami auto --ssh-access
[ℹ]  using region eu-west-3
[ℹ]  setting availability zones to [eu-west-3a eu-west-3b eu-west-3c]
[ℹ]  subnets for eu-west-3a - public:192.168.0.0/19 private:192.168.96.0/19
[ℹ]  subnets for eu-west-3b - public:192.168.32.0/19 private:192.168.128.0/19
pipelines:
build:
steps:
- image: alpine
sh: "hello world"