Skip to content

Instantly share code, notes, and snippets.

View brouberol's full-sized avatar

Balthazar Rouberol brouberol

View GitHub Profile
@brouberol
brouberol / tabletopaudio_dl.py
Created May 1, 2024 12:12
tabletopaudio_dl.py
#!/usr/bin/env python3
import requests
import argparse
import re
import json
from pathlib import Path
from bs4 import BeautifulSoup
from dataclasses import dataclass
@brouberol
brouberol / rerun_failed_circle_tests.py
Created March 13, 2023 14:49
Fetches failed test info from circleCI and run the tests locally
#!/usr/bin/env python3
import requests
import os
import sys
import difflib
import subprocess
from pathlib import Path
@brouberol
brouberol / dnd_ambiance_keypad.py
Created September 15, 2022 08:30
D&D Ambiance Keypad
import time
import math
from pimoroni_rgbkeypad import RGBKeypad
# From red to violet
## Row1
DARK_RED = (220, 20, 60)
RED = (255, 0, 0)
diff --git "a/t\303\251l\303\251chargeur-cheerz.py" "b/t\303\251l\303\251chargeur-cheerz.py"
index 871a79f..b8db037 100755
--- "a/t\303\251l\303\251chargeur-cheerz.py"
+++ "b/t\303\251l\303\251chargeur-cheerz.py"
@@ -1,6 +1,8 @@
#!/usr/bin/env python3
import json
+import aiohttp
+
#!/usr/bin/env python3
"""
Script in charge of cleaning up the tags in your Dungeondraft asset library,
to make sure to only keep tags actually linked with assets.
"""
import logging
import json
import argparse
@brouberol
brouberol / srtoffset.py
Last active December 2, 2019 13:33
Apply a time offset to each subtitle in an srt file
#!/usr/bin/env python3
"""
Script mutating a subtitles (.srt) file by applying a time offset to each subtitle.
Examples:
% srtoffset movie.srt '00:00:31,500'
% srtoffset movie.srt '00:00:03,125' --rewind
"""
@brouberol
brouberol / test-http-readiness-api.yaml
Last active March 21, 2019 10:19
k8s pod readiness http API
---
apiVersion: v1
kind: ConfigMap
metadata:
name: test-readiness-balthazar-readiness-pod-script
namespace: datadog
data:
readiness-pod.py: |
#!/usr/bin/env python3
@brouberol
brouberol / website-proxy.py
Created March 9, 2016 22:55
This snippet creates a proxy from localhost:5000 to an entire website.
import requests
from flask import Flask, request, Response, stream_with_context
from functools import wraps
app = Flask('test', static_folder=None)
def check_auth(username, password):
@brouberol
brouberol / chainetask.py
Last active December 21, 2015 10:40
ChainedTask celery abstract task
from celery import Task
class ChainedTask(Task):
abstract = True
def apply_async(self, args, kwargs, **options):
"""Injects the dict return value of a a task as keyword args of the next one."""
if args:
# handle the case of a bound task (decorated with bind=True)
### Keybase proof
I hereby claim:
* I am brouberol on github.
* I am brouberol (https://keybase.io/brouberol) on keybase.
* I have a public key whose fingerprint is 2E29 FBDD 51F3 D3F6 74D1 9B3D 52BA BA41 74FC 6BD7
To claim this, I am signing this object: