Skip to content

Instantly share code, notes, and snippets.

View rxw1's full-sized avatar
☠️

rxw1

☠️
  • Upper Silesia, Germany
View GitHub Profile
@HPZ07
HPZ07 / FixYoutubeAltTabPlayPauseIssue.user.js
Last active May 26, 2024 08:39
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 May 20, 2024 14:45
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==
@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 6, 2023 19:14
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 November 3, 2024 14:11
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 August 14, 2022 23:40 — 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
#
@jpentland
jpentland / tabc.sh
Last active July 11, 2024 04:36
Add or remove windows from suckless' tabbed
#!/bin/sh
# Usage:
# tabc.sh <tabbed-id> <command>
# Commands:
# add <window-id> - Add window to tabbed
# remove <window-id> - Remove window from tabbed
# list - List all clients of tabbed
#