Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
typedef int8_t i8;
typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
typedef uint8_t u8;
From 52d57cf70ca70f55378112f6eeb5708fb7680a6b Mon Sep 17 00:00:00 2001
From: stephematician <steph.fn.contact@proton.me>
Date: Wed, 19 Mar 2025 13:59:21 +1100
Subject: [PATCH] linux-v4l2: Fix virtual camera start failure
Add function that tries to reset v4l2loopback output for module versions
from 0.12.5 to 0.12.7. If successful, then set flag that STREAMON and
STREAMOFF are necessary each time the device is opened/closed.
---
plugins/linux-v4l2/v4l2-output.c | 57 ++++++++++++++++++++++++++++++--
@GingerGraham
GingerGraham / bash_logging.md
Last active February 14, 2026 11:59
Bash Logging

Bash Logging Module

A flexible, reusable logging module for Bash scripts that provides standardized logging functionality with various configuration options.

Important

This version of the bash logging module is now deprecated and the gist is no longer maintained. Please see the full release bash-logger

Note

This deprecated version has been left for reference purposes only.

@mkpolkowski
mkpolkowski / CountYoutubeVideosTime.js
Last active February 12, 2025 18:00 — forked from RafalJDev/CountYoutubeVideosTime.js
Count all videos time duration on youtube channel
//You need to run this in javascript console inside chrome
//Assumptions:
//1. Will count only "expanded" videos on page, you may first need to run script to scroll to last video or do it manually
//2. Tested on chrome, ubuntu, 2019
//3. Time format: hh:mm:ss
// Assuming you have your domlists as an array-like object
const domlists = document.querySelectorAll("ytd-rich-item-renderer");
@christian-korneck
christian-korneck / virtmanager_win11_sata_to_virtio_migration.md
Last active July 12, 2026 12:40
virtmanager: switch windows vm boot disk from sata to virtio

I have a Windows 11 23H2 VM with a SATA boot disk running on virtmanager (KVM/Qemu) on Fedora 39 that I want to convert to a virtio disk.

  • in windows install virtio guest tools (download)
  • create cd drive and attach virtio iso (download)
  • shutdown vm
  • in virtmanager preferences, enable xml editing
  • in the vm disk settings, go to the xml tab, backup the existing xml and change it:

old:

@zer0k-z
zer0k-z / deadstrafe.md
Last active April 23, 2026 00:31
CSGO (and CS2) deadstrafe explained

In CSGO/CS2, deadstrafe period is the term created by the KZ community which refers to the period where the player's airstrafe capacity (and therefore turning capacity) is significantly lowered. For the simple explaination, see this video by RedMooN.

The cause of this involves two functions, CGameMovement::CategorizePosition and CGameMovement::AirAccelerate.

To be more specific, the main culprit is this line of code in CategorizePosition, which reduces the player's surface friction to 0.25 (originally 1) when the player is in the air and has a vertical velocity between 0 and +140.0.

Inside `AirAccelera

@brayevalerien
brayevalerien / monokai.md
Last active July 4, 2026 07:51
Monokai theme color codes

Monokai theme color codes

Intro

This document lists the colors used in the Monokai Pro theme with the Classic filter. Please check the Monokai Pro website for more informations.

Colors

Monokai Pro with Classic filter colors:

Preview Hexadecimal RGB
Activity Bar Background activity bar background preview #272822 (39, 40, 34)
Activity Bar Foreground activity bar foreground preview #f8f8f2 (248, 248, 242)
@braindevices
braindevices / #btrfs benchmark for daily used desktop OS
Last active May 11, 2026 20:49
which file sytem to use for daily work? should we turn on btrfs compression?
#btrfs benchmark for daily used desktop OS

A metatable in Lua defines various extraneous behaviors for a table when indexed, modified, interacted with, etc. They are Lua's core metaprogramming feature; most well known for being useful to emulate classes much like an OOP language.

Any table (and userdata) may be assigned a metatable. You can define a metatable for a table as such:

-- Our sample table
local tab = {}
-- Our metatable
local metatable = {
 -- This table is then what holds the metamethods or metafields
@sopa0
sopa0 / linux_lutemod.md
Last active February 3, 2025 22:13
Running Lutemod on Linux with Proton

Running the Lutemod on Linux and Proton

Installing the Lutemod

Visit this page and download the clientside-mod-autoloader

You should receive a file named similarly to zz_clientmodloadingmap_425.zip

Unzip the contents of the archive, you should be getting a file named zz_clientmodloadingmap_425.pak