Skip to content

Instantly share code, notes, and snippets.

@zopieux
zopieux / 0001-Audio-export-conversion-hack-for-training-aids.patch
Created September 21, 2023 20:55
MuseScore audio export hack for training aids
View 0001-Audio-export-conversion-hack-for-training-aids.patch
From bbd014bf407b2ec97fa18cca89d46d1867f62c83 Mon Sep 17 00:00:00 2001
From: Alexandre Macabies <web+oss@zopieux.com>
Date: Thu, 21 Sep 2023 22:53:31 +0200
Subject: [PATCH] Audio export conversion hack for training aids.
---
default.nix | 174 +++++++++++++
flake.lock | 61 +++++
flake.nix | 27 ++
src/app/app.cpp | 2 +
@zopieux
zopieux / README.md
Last active August 17, 2023 16:58
QNAP TS-453 Pro: LCD, LEDs, fan & buttons
View README.md

QNAP TS-453 Pro: LCD, LEDs, fan & buttons

QNAP NAS model TS-453 Pro has limited documentation on how to control its various peripherals, namely:

  • the front LCD display, a 2 row, 16 column blue & white LCD display, and its two menu buttons ("ENTER", "SELECT")
  • the front LEDs "STATUS" (red & green) & "USB" (blue)
  • the 4 "disk error" LEDs (red)
  • the front "USB COPY" button
  • the main rear fan
@zopieux
zopieux / fipradio.py
Last active April 19, 2023 09:59
FIP radio live metadata
View fipradio.py
# Displays the currently playing media at FIP radio
# http://www.fipradio.fr/player
# You may want to update the number at the end of the URL
# if you use a specific "style" channel instead of the
# generic (main) channel, which is 7.
import requests
import time
import subprocess
@zopieux
zopieux / github-clone-fork
Last active December 2, 2022 15:13
Clone GitHub forked repo and add upstream remote
View github-clone-fork
#!/bin/bash
set -e
fatal() {
echo $@
exit 1
}
repo=$1
@zopieux
zopieux / bb_webhook_to_irc.py
Last active August 31, 2022 23:57
Bitbucket webhooks to IRC broker
View bb_webhook_to_irc.py
#!/usr/bin/env python3
# coding: utf-8
# This launches a webserver listening on HTTP_HOST and a IRC client to display the messages.
# Configuration using capital variables below.
# Dependencies: Python 3, pypeul (Python 3 branch)
from http.server import BaseHTTPRequestHandler, HTTPServer
from pypeul import IRC, Tags
import json
@zopieux
zopieux / mpv_streamlink_mosaic.py
Last active May 8, 2022 19:35
Xorg clipboard + streamlink + mpv in a mosaic / tile layout
View mpv_streamlink_mosaic.py
@zopieux
zopieux / hexadecordle.js
Last active March 18, 2022 17:13
A sane horizontal layout for https://hexadecordle.co.uk/
View hexadecordle.js
const trs = [...document.querySelectorAll('#container>table>tbody>tr')]
const beg = trs.splice(0, 2)
trs.filter((x,i) => i%2==0).forEach(tr => {
tr.querySelectorAll(':scope > td').forEach(td => beg[0].insertAdjacentElement('beforeend', td))
})
document.querySelectorAll('#container>table>tbody>tr>td').forEach(e => e.style.width=100/16)
document.querySelector('body').style.fontFamily = 'monospace'
document.querySelector('#body').style.maxWidth = null
document.querySelector('#body').style.width = '100%'
document.querySelector('#game').style.width = '100%'
@zopieux
zopieux / RSL366R.c
Last active January 10, 2021 18:04
Remote RSL366R (433.95MHz) Arduino program
View RSL366R.c
// https://github.com/sui77/rc-switch
#include <RCSwitch.h>
#define CONFIG_BUFSIZE ((8 + 16 + 8) / 8)
typedef union {
struct {
uint8_t transmitPin;
uint16_t pulseLength;
uint8_t repeatTx;
} c;
View gist:5c5f1bd5067613f36fa4409a6890b605
### Keybase proof
I hereby claim:
* I am zopieux on github.
* I am zopieux (https://keybase.io/zopieux) on keybase.
* I have a public key ASCq3dB3j_rLJ_JoF2t2F5Km_8nVHoa-v_nNsWh0aDEBUgo
To claim this, I am signing this object:
@zopieux
zopieux / tree.py
Created May 11, 2015 08:03
Python tree
View tree.py
def tree(root):
"""
Node(label = "string", children = [list of Node])
"""
ret = [root.label]
ln = len(root.children)
for i, child in enumerate(root.children):
for j, s in enumerate(tree(child)):
char = '│ '
if i == ln - 1: # last child