Skip to content

Instantly share code, notes, and snippets.

View ChausseBenjamin's full-sized avatar
⚙️
Over-optimizing

Benjamin Chausse ChausseBenjamin

⚙️
Over-optimizing
View GitHub Profile
@ChausseBenjamin
ChausseBenjamin / note2hertz.cpp
Last active January 16, 2023 02:19
converts a note (as a string) to a frequency in hertz
#include "note.h"
#include <math.h>
#include <algorithm>
// note string structure:
// [A-G][0-9][f,n,s]
// A-G: Note entre La (A) et Sol (G)
// 0-9: Octave du piano
// f: bémol (flat), n: naturel, s: dièse (sharp)
// Donc "D3s" va jour le troisième Ré dièse du piano
@ChausseBenjamin
ChausseBenjamin / fastbackup.sh
Last active August 27, 2022 04:28
Backup de données rapides pour Mr. Robot utilisant un script shell
#!/bin/sh
# No Dossier du client
workorder="12518"
# Dossier `User` du client sur son disque d'origine
src="/mnt/ssd/Users/client"
# Dossier `User` du client sur le disque de destination
dest="/mnt/backup/$workorder"
@ChausseBenjamin
ChausseBenjamin / davmail-usherbrooke-mw-tutorial.md
Last active August 25, 2022 20:37
Usherbrooke emails with neomutt (with [davmail][davmail] & [mutt-wizard][mw])

The following is a tutorial shows how to setup [USherbrooke][udes] emails with the amazing terminal-based [neomutt][neomutt]. To simplify the process, I will use [mutt-wizard][mw] to streamline the installation. My current OS is Artix Linux and therefore, any command used in this tutorial will be for that operating system (although most will work on any unix-based system):

Step 1 Install neomutt, mutt-wizard and davmail: yay -S mutt-wizard-git davmail neomutt

@ChausseBenjamin
ChausseBenjamin / postgres.go
Created January 9, 2020 02:56 — forked from rivo/postgres.go
A demo Go application (a PostgreSQL database browser) highlighting the use of the rivo/tview package. See https://github.com/rivo/tview/wiki/Postgres
package main
import (
"database/sql"
"fmt"
"net/url"
"os"
"reflect"
"regexp"
"strconv"