Skip to content

Instantly share code, notes, and snippets.

View maxcharlier's full-sized avatar

Maximilien Charlier maxcharlier

View GitHub Profile
import json
import os
import subprocess
import sys
def get_video_duration(filepath: str, verbose: bool) -> float:
"""Return the video duration in seconds using ffprobe."""
try:
result = subprocess.run(
@maxcharlier
maxcharlier / xbox_controller_mapper_mac.py
Last active September 10, 2025 23:54
Map Xbox controler to key on MacOS
# pip install pygame pynput
import pygame
from pynput.keyboard import Controller, Key
import time
# Initialize
pygame.init()
pygame.joystick.init()
# Wait for joystick to initialize
@maxcharlier
maxcharlier / dbVizPasswordDecrypt.groovy
Last active April 20, 2022 11:33 — forked from marcgeld/dbVizPasswordDecrypt.groovy
Decode DbVisualizer settings password. (https://www.dbvis.com/)
#!/usr/bin/env groovy
import groovy.xml.*;
import javax.crypto.SecretKeyFactory
import javax.crypto.SecretKey
import javax.crypto.Cipher
import javax.crypto.spec.PBEParameterSpec
import javax.crypto.spec.PBEKeySpec
import java.util.Base64
import java.util.Base64.Decoder