Skip to content

Instantly share code, notes, and snippets.

View petabyt's full-sized avatar

Daniel C petabyt

View GitHub Profile
@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 \
@aras-p
aras-p / preprocessor_fun.h
Last active July 1, 2025 20:12
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,
@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]
@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.

@rounk-ctrl
rounk-ctrl / Dark.md
Last active June 20, 2025 17:57
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)

@torvalds
torvalds / gist:6faadce34c56d53b2d5352da0c3cd093
Last active June 30, 2025 17:40
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.