Skip to content

Instantly share code, notes, and snippets.

View Pixelsuft's full-sized avatar
:octocat:

pixelsuft‮ Pixelsuft

:octocat:
View GitHub Profile
@joanbm
joanbm / nvidia-470xx-fix-linux-6.12.patch
Last active March 4, 2025 20:24
Tentative fix for NVIDIA 470.256.02 driver for Linux 6.12-rc1
From 839b964bd5be20275a4d1add020e68e407380adb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <[email protected]>
Date: Sat, 17 Aug 2024 14:26:04 +0000
Subject: [PATCH] Tentative fix for NVIDIA 470.256.02 driver for Linux 6.12-rc1
Note that the fix requires enabling DRM kernel mode setting
(add the `nvidia-drm.modeset=1` parameter to the kernel command line).
(Thanks xtexChooser for the memory management fixes!)
---
@Pixelsuft
Pixelsuft / nodejs_text_screen.js
Last active August 3, 2022 12:36
v86 nodejs text screen example
#!/usr/bin/env node
"use strict";
var fs = require("fs");
var V86Starter = require("../build/libv86.js").V86Starter;
function readfile(path)
{
return new Uint8Array(fs.readFileSync(path)).buffer;
}
@rounk-ctrl
rounk-ctrl / Dark.md
Last active May 13, 2025 22:51
Win32 Dark Mode

Dark Mode APIs.

API Signatures.

ShouldAppsUseDarkMode()

Checks whether system is using dark mode or not.
Signature:

using fnShouldAppsUseDarkMode = bool (WINAPI*)(); // ordinal 132

AllowDarkModeForWindow(In HWND hWnd, In bool allow)

@StanislavPetrovV
StanislavPetrovV / voxel_starfield.py
Last active January 20, 2024 15:24
VoxelStarfield
import pygame as pg
import random
import math
vec2, vec3 = pg.math.Vector2, pg.math.Vector3
RES = WIDTH, HEIGHT = 1600, 900
NUM_STARS = 1500
CENTER = vec2(WIDTH // 2, HEIGHT // 2)
COLORS = 'red green blue orange purple cyan'.split()
@Pixelsuft
Pixelsuft / backward_midi.py
Created October 12, 2021 10:29
MIDI Backward
from mido import MidiFile
fn = input('Enter file name: ').replace('"', '')
ext = fn.split('.')[-1].strip()
no_ext = '.'.join(fn.split('.')[:-1])
cv1 = MidiFile(fn, clip=True)
@Pixelsuft
Pixelsuft / pip_hooker.py
Last active September 29, 2021 09:28
Running pip without creating process
'''
MIT License
Copyright (c) 2021 Pixelsuft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@Pixelsuft
Pixelsuft / unsplitter.py
Created September 27, 2021 09:04
Unity assents unsplitter
'''
MIT License
Copyright (c) 2021 Pixelsuft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@probonopd
probonopd / Wayland.md
Last active May 13, 2025 23:44
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

@psqq
psqq / main.cpp
Last active September 15, 2024 04:07
Simple SDL_net example
#include <SDL.h>
#include <SDL_net.h>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main(int argc, char **argv) {
if (SDL_Init(0) == -1) {
printf("SDL_Init: %s\n", SDL_GetError());