Skip to content

Instantly share code, notes, and snippets.

View petabyt's full-sized avatar

Daniel Cook petabyt

View GitHub Profile
@torvalds
torvalds / gist:6faadce34c56d53b2d5352da0c3cd093
Last active April 1, 2026 16:03
Not involved with any fishy crypto fishy business
I'm told that there are people claiming to "tokenize" my git repositories with my approval.
I just want to clarify that that is not the case. I do not believe in monetizing my repositories.
If you believe crypto-currencies are anything but a scam, I have a bridge to sell you.
But I'm not selling source code.
@rounk-ctrl
rounk-ctrl / Dark.md
Last active March 15, 2026 00:54
Win32 Dark Mode

Dark Mode

How to use the newly added dark mode system added in recent Windows 11 builds. They added a dark mode variant of almost every control.

API Signatures.

ShouldAppsUseDarkMode

Whether apps should use dark mode or not.

typedef bool (WINAPI* ShouldAppsUseDarkMode_t)(); // ordinal 132
@CrystalGamma
CrystalGamma / rk3399 sgrf.rst
Last active April 9, 2024 19:00
RK3399 SGRF

RK3399 SGRF Documentation

Rockchip does not publish documentation about the contents of the (PMU)SGRF register block in the RK3399. This document attempts to compile what is known through various documents, code drops and experiments.

Conventions

Unless otherwise noted, SGRF registers are 16 bits wide and are accessed with 32-bit accesses (and 4-byte alignment), where the upper half is a write mask. Registers are identified by their offset, e. g. :reg:`R0x1C` would refer to the 8th register in the block. Bit ranges such as :reg:`R0x40[10:13]` are inclusive. Bit positions are counted from 0, the least significant bit.

@jbsulli
jbsulli / cmd.reg
Created May 16, 2017 02:38
Add "Open with CMD" option to the Windows 10 context menu (both when right-clicking on a folder and in a folder).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWithCMD]
@="Open with CMD"
"Icon"="C:\\WINDOWS\\system32\\cmd.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWithCMD\command]
@="cmd.exe /k cd %V"
[HKEY_CLASSES_ROOT\Directory\shell\OpenWithCMD]
@aras-p
aras-p / preprocessor_fun.h
Last active March 20, 2026 15:26
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@maluta
maluta / cc
Created July 22, 2011 19:33
dd wrapper to avoid mistakes
#!/usr/bin/python
import sys
import subprocess
def usage():
return " \n Misssing config file, you must create a file called ~/.blocklist-dd and insert which device dd should avoid \n\n \
Ex: \n \
$ echo \"/dev/sda\" > ~/.blocklist-dd \n \
$ echo \"/dev/sdb\" >> ~/.blocklist-dd \n \