Skip to content

Instantly share code, notes, and snippets.

@flaki
flaki / upmix.js
Last active January 1, 2022 17:44
Console fix for mono audio in stereo videos on YouTube like this one https://youtu.be/P3X3J-8ICAo
(function(){
vid=document.querySelector('video.html5-main-video');
ct = new AudioContext();
src = ct.createMediaElementSource(vid);
splitter = ct.createChannelSplitter(2);
src.connect(splitter);
merger = ct.createChannelMerger(2);
splitter.connect(merger, 0, 0);
splitter.connect(merger, 0, 1);
merger.connect(ct.destination);
@flaki
flaki / README.md
Last active April 27, 2021 09:15
Patched Strapi router to honor prefix routes for the Admin interface
@flaki
flaki / translate_storage_fluent.py
Created September 8, 2021 20:48
Fix for Fluent serialization in translate/weblate
#
# Copyright 2021 Jack Grigg
#
# This file is part of the Translate Toolkit.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@flaki
flaki / runnable-v1.js
Last active June 20, 2022 05:58
Creating a Twitter-Mastodon crossposter in WebAssembly with Atmo
// DON'T FORGET to update the domain name below to your instance's host!
const MASTODON_INSTANCE = 'mastodon.example';
// Add your access token in here
const MASTODON_ACCESS_TOKEN = '';
// We want to use the HTTP client API
import { http } from "@suborbital/runnable";
// The runtime will invoke the exported "run" function to run our logic
export const run = (input) => {
@flaki
flaki / dissecting-reactr.md
Created June 23, 2022 18:45
Dissecting a generated JS/TS binding in Reactr
this.env.cacheSet(key, bytes, ttl, this.ident);

Generated bindings.js:

// The original generated binding:
cacheSet(arg0, arg1, arg2, arg3) {
@flaki
flaki / docker-to-proxmox.md
Created February 7, 2023 21:36
Importing a Docker container image into Proxmox Linux Containers (LXC)

Importing a Docker container into Proxmox/LXC

Importing the container

For this we are going to be using lxc-create, which comes pre-installed on Proxmox but needs further dependencies to fetch the OCI images from Docker:

apt update && apt -y install skopeo umoci jq
@flaki
flaki / customize.sh
Created March 5, 2023 22:24
Patch Mastodon to allow more than 500 characters for toots
#!/bin/sh
STATUS_MAX_CHARS=1000
# Enable > 500 characters in the toot composer of the web interface
COMPOSEROOT=/opt/mastodon/app/javascript/mastodon/features/compose/components
if [ -e $COMPOSEROOT/compose_form.js ]; then
# Sets the custom limit
cat <<EOF > $COMPOSEROOT/compose_max.js