Skip to content

Instantly share code, notes, and snippets.

View rxw1's full-sized avatar
☠️

rxw1

☠️
  • Germany
View GitHub Profile
@HPZ07
HPZ07 / FixYoutubeAltTabPlayPauseIssue.user.js
Last active March 15, 2025 14:43
Fix YouTube's Alt-Tab Pause/Play Issue
// ==UserScript==
// @name Fix YouTube's Alt-Tab Pause/Play Issue
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Fix YouTube's Alt-Tab Pause/Play Issue
// @author HPZ07
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
@HPZ07
HPZ07 / DisableYoutubeScrolling.user.js
Last active September 14, 2025 11:30
Disable YouTube Spacebar Scrolling
// ==UserScript==
// @name Disable YouTube spacebar scrolling
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Disables spacebar scrolling and forces it to pause the video instead
// @author HPZ07
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@josefandersson
josefandersson / bspwmhacky.c
Last active March 18, 2021 09:20
Method for bypassing bspwm 'focus' bug for chromium based apps. Build bspwmhacky.c, start it with bspwm, use xdotool to move hacky window to desktop before focusing on desktop.
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(void) {
XEvent e;
Display *d = XOpenDisplay(NULL);
@Indribell
Indribell / sql.go
Last active July 14, 2022 14:19
Extension for sql package
// Fixing some of the errors in the:
// https://gist.github.com/PumpkinSeed/b4993c6ad20ea90e3da8c991a90a91e1
//
// 1. It was only able to extract database information, based upon a Struct.
// The code now can deal with a struct or a slice with structs.
//
// 2. The code relied on the json tag in the struct.
// You need to match the data with database fields, not the output fields.
// This will match up more 1 to 1 as you are in controle of your Database naming and selecting of that data.
// If a client expect different named exported json fields, ...

Comments on optimizations around string concatenation.

Note: The code links are to CPython 3.8.5, the most recent release when this was written.

I was recently asked about a performance optimization in CPython around using += and + for string objects. As some people may already know, if you use += or + a string, it can sometimes be just as fast as ''.join. The question was to explain when that optimization couldn't be performed.

We will be going through the following example scenarios:

@poop-person
poop-person / .POOP.md
Last active January 24, 2025 23:28
POOP: Peacefully Opposing Oppressive Puritanism

big-poop logo

POOP: Peacefully Opposing Oppressive Puritanism

POOP is a badge for any software project that is [under attack by modern day puritans][opalgate]. Use this badge to declare that your project is POOP: Peacefully Opposing Oppressive Puritanism.

@LnLcFlx
LnLcFlx / archlogo.txt
Last active October 10, 2025 23:00
Arch Linux logo using unicode block characters
\033[38;2;23;147;209m ▄
▟█▙
▟███▙
▟█████▙
▟███████▙
▂▔▀▜██████▙
▟██▅▂▝▜█████▙
▟█████████████▙
▟███████████████▙
▟█████████████████▙
@thugcee
thugcee / sxhkdrc
Last active May 18, 2022 09:46 — forked from jpentland/tabc.sh
Suckless' tabbed integration with BSPWM. This configuration supports joining any two neighbouring windows into a new tabbed, removing windows from tabbed and when last window is from tabbed removed then tabbed instance is closed. This slightly modified `tabc.sh` allows to omit id of the removed window (the current one is removed by default).
# Remove current tab from tabbed
super + mod1 + t; r
tabc.sh $(bspc query -N -n focused) remove
# At given direction: join two windows into a new tabbed or add window to an existing tabbed
super + mod1 + t; {Left,Down,Up,Right}
tabc.sh $(bspc query -N -n {west,south,north,east}) add $(bspc query -N -n focused)
@BrodieRobertson
BrodieRobertson / tabc.sh
Last active June 13, 2025 21:50 — forked from jpentland/tabc.sh
Add or remove windows from suckless' tabbed
#!/bin/sh
# Usage:
# tabc.sh <command>
# Commands:
# add <direction-of-tabbed> <window-id> - Add window to tabbed
# remove <window-id> - Remove window from tabbed
# list <tabbed-id> - List all clients of tabbed
#