Skip to content

Instantly share code, notes, and snippets.

View balanza's full-sized avatar

Emanuele De Cupis balanza

View GitHub Profile
@balanza
balanza / api.yaml
Created June 1, 2021 11:08
Example mock DGC service API specification
swagger: '2.0'
info:
version: 0.0.1
title: DGC API for IO integration
host: example.com
schemes:
- https
paths:
# arbitrary path, let's find a proper one togheter
/certificate:
@balanza
balanza / navigation.md
Created February 15, 2022 23:30
Analisi della navigazione dell'ecosistema SelfCare

Contesto

Supponiamo di avere tre Organizzazioni (A, B, C), tre Prodotti (X, Y, Z) e un Referente delegato secondo la seguente matrice:

A B C
X
Y
Z

Sintassi

@balanza
balanza / 01.ts
Last active August 2, 2022 01:51
fp-ts didactic examples
type Option<A> = None | Some<A>;
@balanza
balanza / index.js
Created April 22, 2024 13:57
Prove random UUID distribution upon the character space
const uuid = require("node:crypto").randomUUID;
const m = new Map();
const N = 1e7;
for (let i = 0; i < N; i++) {
const k = uuid().split("").reverse()[0];
if (m.has(k)) {
m.set(k, m.get(k) + 1);
} else {
m.set(k, 1);
@balanza
balanza / reply.sh
Created October 29, 2025 20:38
shell: replay
#!/bin/sh
# Replay N commands from history, in sequence
# Usage:
# replay <start command index> <number of commands to replay>
replay() {
local A="$1"
local N="$2"
local end=$((A + N))
# get current shell
@balanza
balanza / osc-packaging-distrobox.ini
Last active February 23, 2026 10:58
A Distrobox manifest to build rpm package with osc and openSUSE Build System, in different languages.
[packaging]
image=registry.opensuse.org/opensuse/distrobox-packaging:latest
root=true
additional_packages="osc obs-service-tar obs-service-obs_scm"
additional_packages="obs-service-recompress obs-service-set_version obs-service-format_spec_file"
additional_packages="sudo"
additional_packages="vi git make gcc gcc-c++"
additional_packages="libxml2 libxml2-devel webkit2gtk4-devel"
additional_packages="spec-cleaner"
additional_flags = "--cap-add=SYS_ADMIN --security-opt label:disable"
@balanza
balanza / lost-contributors.sh
Created March 6, 2026 22:21
Calculate the list of contributor that will lose their contribution after files are deleted
#!/usr/bin/env bash
#
# lost-contributors.sh
#
# 1. Lists files deleted in the current branch compared to a target branch
# 2. Finds contributors who ever participated in those deleted files (full history)
# but have no lines remaining in any surviving file
#
# Usage:
# ./lost-contributors.sh [target_branch]