Skip to content

Instantly share code, notes, and snippets.

View irgendwr's full-sized avatar

Jonas Bögle irgendwr

View GitHub Profile
@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 / phpmyadmin.conf
Created March 25, 2019 16:00
Nginx snippet for serving phpmyadmin in a custom subdirectory
location /pma {
alias /usr/share/phpmyadmin;
try_files $uri $uri/ @pma =404;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; # <-- change this to fit your installation
}
}
@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 / 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 / .bashrc
Last active January 28, 2022 20:35
bashrc config for bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@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 / 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
--[[