Skip to content

Instantly share code, notes, and snippets.

View irgendwr's full-sized avatar

Jonas Bögle irgendwr

View GitHub Profile
@irgendwr
irgendwr / 10-i2i.conf
Created July 20, 2022 22:00
PipeWire configuration to remap channels from an external audio interface to separate virtual devices.
context.modules = [
{ name = libpipewire-module-loopback
args = {
node.description = "i2i Left"
capture.props = {
node.name = "capture.i2i_Left"
audio.position = [ FL ]
stream.dont-remix = true
target.object = "alsa_input.usb-Focusrite_Scarlett_2i2_USB_Y886QAJ09537A9-00.analog-stereo"
#node.dont-reconnect = true
@irgendwr
irgendwr / how-to-patch-parcel.md
Last active March 24, 2022 20:23
How to patch parcel (or basically any other npm package)

How to patch parcel

Patch to enable MV3 support

This shows how to apply this PR by @101arrowz to enable manifest v3 support. Please be aware that the patch is not production ready and might still have some issues.

Go to your project and add patch-package and postinstall-postinstall as devDependencies, then download the patch:

cd <path-to-your-project>
npm install -D patch-package
@irgendwr
irgendwr / @parcel+transformer-webextension+2.4.0.patch
Last active March 24, 2022 20:21
A patch that enables Manifest v3 support in @parcel/transformer-webextension
diff --git a/node_modules/@parcel/transformer-webextension/webextension/lib/WebExtensionTransformer.js b/node_modules/@parcel/transformer-webextension/webextension/lib/WebExtensionTransformer.js
new file mode 100644
index 0000000..156e583
--- /dev/null
+++ b/node_modules/@parcel/transformer-webextension/webextension/lib/WebExtensionTransformer.js
@@ -0,0 +1,401 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
@irgendwr
irgendwr / .zshrc
Last active January 28, 2022 20:35
zshrc config for zsh
### irgendwr's .zshrc ###
# Requires the following plugins:
# zsh-autosuggestions, zsh-completions, zsh-history-substring-search, zsh-syntax-highlighting, zsh-theme-powerlevel10k
# and optionally: zsh-z (https://github.com/agkozak/zsh-z)
## Options section
setopt correct # Auto correct mistakes
setopt extendedglob # Extended globbing. Allows using regular expressions with *
setopt nocaseglob # Case insensitive globbing
@irgendwr
irgendwr / arch-1-pre.sh
Created January 26, 2022 15:37
Partial install script for my Arch setup. Still unfinished and experimental.
#!/bin/bash
# Print commands (x) and stop on error (e)
set -ex
# Set the console keyboard layout
loadkeys de-latin1
# Update the system clock
timedatectl set-ntp true
@irgendwr
irgendwr / sitemap.xml
Created October 21, 2021 00:00
Hugo sitemap.xml with exclude/hide functionality. Save as `/layouts/_default/sitemap.xml`. Set `hidden` to `true` in your posts frontmatter to exclude a page from the sitemap.
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Data.Pages }}
{{- if and (.Permalink) (not .Params.hidden) -}}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
@irgendwr
irgendwr / list-fritzbox-devices.py
Created September 18, 2021 03:04
This script lists all devices known to a FritzBox router
#!/bin/env python
# This script lists all devices known to a FritzBox router.
# pip install fritzconnection
# Change this:
ADDRESS = '192.168.178.1'
USER = 'YOUR USER HERE'
PASS = 'YOUR PASSWORD HERE'
@irgendwr
irgendwr / bitwise-operators.lua
Created August 16, 2021 15:27
Bitwise Operator implementations in native Lua.
-- Bitwise Operator implementations in native Lua.
-- Play around with it here: https://replit.com/@irgendwr/lua-bitwise-operators
-- Lua only has native support for bitwise operators since 5.3+
-- see https://www.lua.org/manual/5.3/manual.html#3.4.2
-- and http://lua-users.org/wiki/BitwiseOperators
--[[
@irgendwr
irgendwr / sorter.yml
Last active June 2, 2021 23:44
Set definitions for the Minecraft server plugin 'Item Chest Sorter'
# This is part of our config for the Minecraft server plugin 'Item Chest Sorter'
# see https://www.spigotmc.org/resources/item-chest-sorter.75964/
# Define sets if you want similar items to be moved to just one chest
# Look at the examples below if you want to add a new set.
# Define a new array by beginning the line with - []
# Separate the items by commas.
# You have to use the so called 'namespaced IDs'. You can find those in the minecraft wiki for almost all items.
# Example namespaced IDs: https://minecraft.gamepedia.com/Flower#Data_values
sets:
@irgendwr
irgendwr / svgs2pdf.sh
Last active November 18, 2020 19:32
Converts multiple SVGs to a single PDF and applies OCR
#!/usr/bin/env bash
# Requires rsvg-convert, pdfunite and ocrmypdf
echo "This script will convert all *.svg files in the current directory to *.pdf files and merge them into a single PDF file called all.pdf and then apply OCR to create all_ocr.pdf. Existing files with the same names will be overwritten."
read -p "Do you want to proceed? [Y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^([Yy]| ) ]] || [[ -z $REPLY ]]; then
# Convert all svg files to pdf files
for i in *.svg; do