Skip to content

Instantly share code, notes, and snippets.

View belgattitude's full-sized avatar

Sébastien Vanvelthem belgattitude

View GitHub Profile
@belgattitude
belgattitude / openfoodfact-sql-extract.sql
Last active November 11, 2026 15:15
Example of openfoodfact duckdb extraction
-- Open Food Facts → clean products sold in Europe (EAN-13 + UPC-A), with a quality score
-- Source : data/food.parquet (Hugging Face openfoodfacts dump)
-- Output : data/food_ean13.parquet (zstd, Parquet v2, sorted by ean13)
-- Requires DuckDB 2.x (lambda syntax: lambda x: ...)
-- ─────────────────────────────────────────────────────────────
-- 1. Helper macros
-- ─────────────────────────────────────────────────────────────
@belgattitude
belgattitude / how-to-docker-mssql-docker-compose.md
Last active October 20, 2025 07:56
Example of mssql/server:2022-CU16-ubuntu-22.04 docker compose with healthcheck

Docker mssql server

Features

  • Recent mssql server version (server:2022-CU16-ubuntu-22.04 with mysql-tools-18)
  • Healthcheck

Requirements

  • Docker engine > 2.7
@belgattitude
belgattitude / typescript-issue-with-async-discriminated-union.ts
Last active October 23, 2024 15:26
typescript-issue-with-async-discriminated-union
import type { Compilable, InferResult, Kysely } from 'kysely';
type QueryResultSuccess<T> = {
success: true;
data: T;
};
type QueryResultError = {
success: false;
errorMsg: string;
};

Comparison

  • Yarn 4.0.0-rc.23: 2+ minutes (constant yarn cache is preserved between lock changes: cache saved in .next/cache/yarn)
  • Pnpm 7.13.x: 4+ mins (cold cache) / 3+ minutes (warm cache)

Deploy size

PS: add NEXT_DEBUG_FUNCTION_SIZE=1 in the vercel envs/

@belgattitude
belgattitude / ci-pnpm-install.md
Last active October 15, 2026 11:19
Composite github action to improve CI time with pnpm

Why

Although @setup/node as a built-in cache option, it lacks an opportunity regarding cache persistence. Depending on usage, the action below might give you faster installs and potentially reduce carbon emissions (♻️🌳❤️).

Requirements

pnpm v7 or v8 (not using pnpm ? see the corresponding yarn action gist)

Bench

@belgattitude
belgattitude / ci-yarn-install.md
Last active October 14, 2025 07:43
Composite github action to improve CI time with yarn 3+ / node-modules linker.
@belgattitude
belgattitude / benchmark-package-managers.md
Last active June 20, 2023 11:19
Package managers comparison from the CI time perspective
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions