Skip to content

Instantly share code, notes, and snippets.

@ychalier
ychalier / track_harvester.py
Created September 25, 2022 14:44
Download tracks from a YouTube playlist and use an assisted Discogs search to tag them
"""Download tracks from a YouTube playlist and use an assisted Discogs search to tag them.
Requires yt-dlp, ffmpeg and a browser automation driver for selenium.
"""
import io
import os
import re
import glob
import json
import argparse
@ychalier
ychalier / blend_images.py
Created July 25, 2022 19:01
Python script to blend several images from a parametrized striped pattern
import glob
import argparse
import logging
import math
import tqdm
import itertools
from PIL import Image, ImageDraw
class Vector:
@ychalier
ychalier / mosh.js
Last active July 22, 2022 19:40
Photo Moshing
function gcd(a, b) {
if (b == 0) return a;
return gcd(b, a % b);
}
var context;
var width;
var height;
var image_data;
@ychalier
ychalier / shazoom.py
Created June 20, 2021 18:42
Sha-zoom, an implementation of the audio search algorithm described in the Computerphile video 'How Shazam Works (Probably!)' published on YouTube on March 15, 2021 by David Domminney Fowler. Requires FFMPEG.
"""
Sha-zoom, an implementation of the audio search algorithm described in the
Computerphile video 'How Shazam Works (Probably!)' published on YouTube on
March 15, 2021 by David Domminney Fowler. Requires FFMPEG.
"""
import os
import pickle
import logging
import argparse
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ychalier
ychalier / visutrack.py
Created August 20, 2020 01:42
Generate a information thumbnail from a GPX file.
"""Generate a information thumbnail from a GPX file.
"""
import io
import re
import os
import math
import time
import uuid
import base64
@ychalier
ychalier / musicatter.py
Last active May 1, 2020 12:34
Musicater: music library formatter and validator.
# pylint: disable=E0401
"""Musicater: music library formatter and validator.
"""
__version__ = "1.2.0"
__author__ = "Yohan Chalier"
__license__ = "MIT"
__email__ = "yohan@chalier.fr"
@ychalier
ychalier / tripeaks.py
Created December 25, 2019 09:06
Tri Peaks AI
"""A small script that implements a Tri Peaks game as well as a Tri Peaks
approximate solver. The solver uses several heuristics to make moves, that a
human would be able to perform.
More information at https://en.wikipedia.org/Tri_Peaks_(game)
Solver improvement idea: take into account the probability of uncovering a card
that would increase the popping sequence length.
Architecture improvement idea: use a TriPeaksState class to store information
@ychalier
ychalier / ina.py
Last active December 12, 2019 16:58
Web scraper for http://inatheque.ina.fr/. The official INA database is not accessible outside its unpracticle interface. This script automatically gathers all results from a search query into a CSV file, easy to process.
"""Web scraper for http://inatheque.ina.fr/
The official INA database is not accessible outside this unpracticle interface.
This scripts automatically gathers all results from a search query into a CSV
file, easy to process.
Usage:
python ina.py <search-query>
Install:
Download the Firefox driver for selenium at
@ychalier
ychalier / backend.ino
Created September 20, 2019 10:49
Piano cocktail backend
/*
* Main script for the controller
* @project Piano Cocktail
* @author Yohan Chalier
* @date 2019-09-19
*
*/
const int nMotors = 4;
const int motorHigh = LOW;