Skip to content

Instantly share code, notes, and snippets.

View bbailleux's full-sized avatar
💭
I may be slow to respond.

Benoît Bailleux bbailleux

💭
I may be slow to respond.
View GitHub Profile
@bbailleux
bbailleux / pg-schema-to-plantuml.sh
Last active May 13, 2025 06:14 — forked from ants/pg-schema-to-plantuml.sh
Small shell script to get postgreSQL schema as PlantUML diagram source
#!/bin/sh
# Unknown license as this work is heavily based on @ants' own work
# See https://gist.github.com/ants/8f46ce7dd1fb7ef41e88ae87064de988
if [ -z "$1" ]; then
(>&2 echo "Usage: $0 \"host=.. user=.. dbname=..\"")
exit 1
fi
CONNSTRING=$*
@bbailleux
bbailleux / README.md
Last active November 5, 2024 07:22
OCR on screeen region

OCR for screen region

Purpose

The goal is just to select a screen area, to perform OCR (Optical Character Recognition) on its content and to put the resulting text into the system clipboard.

Dependencies

On a Linux system, this tricks requires:

@bbailleux
bbailleux / ytd
Last active November 22, 2024 18:48
Small script that wraps yt-dlp to ease most frequent usage
#!/bin/bash
#
# ytd -- yt-dlp simple wrapper. See https://github.com/yt-dlp/yt-dlp
#
# SPDX-License-Identifier: fair
# SPDX-FileCopyrightText: Copyright (c) B. Bailleux, 2022 - 2024
#
# --- license ---
# Copyright B. Bailleux, 2022 - 2024
#
@bbailleux
bbailleux / aliasForAnsiColorsTable.sh
Created January 4, 2022 07:42
ANSI colors in terminal
alias ansi='for x in `seq 0 15`; do for y in `seq 0 15` ; do printf "\e[38;5;$(( x*16+y ))m%-4s" $(( x*16+y )); done ; printf "\n" ; done'
@bbailleux
bbailleux / main.c
Created December 24, 2018 18:46
ANSI color in terminal output
/* Utilisation des couleurs ANSI */
/* Voir https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences */
void display(char* contenu, int piece, int fond) {
// Probablement sous optimal...
// Idéalement, jouer sur les contrastes...
int coulPiece = 33; // caractère jaune
int coulFond = 40; // fond noir
if (piece == 1) {
coulPiece = 30; // caractère noir
}