Skip to content

Instantly share code, notes, and snippets.

View mochaaP's full-sized avatar
🦜
I don't use Arch btw.

Zephyr Lykos mochaaP

🦜
I don't use Arch btw.
View GitHub Profile
@luigifab
luigifab / appearance__focus-visible.gtk3.patch
Last active March 13, 2025 20:16
gtk3-classic (GTK 3.24.48) & gtk4-classic (GTK 4.17.4) - for Debian Testing
# GtkWindow3: restore focus on application start
# https://github.com/GNOME/gtk/blob/3.24.37/gtk/gtkwindow.c
Index: b/gtk/gtkwindow.c
===================================================================
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6357,7 +6357,9 @@ gtk_window_map
/* inherit from transient parent, so that a dialog that is
* opened via keynav shows focus initially
*/
@ReneNyffenegger
ReneNyffenegger / peb.c
Created March 21, 2021 19:50 — forked from Wack0/peb.c
Getting a pointer to the PEB in C, for every architecture that NT was ported to (where at least one build of the port was leaked/released)
// Gets a pointer to the PEB for x86, x64, ARM, ARM64, IA64, Alpha AXP, MIPS, and PowerPC.
// This relies on MS-compiler intrinsics.
// It has only been tested on x86/x64/ARMv7.
inline PEB* NtCurrentPeb() {
#ifdef _M_X64
return (PEB*)(__readgsqword(0x60));
#elif _M_IX86
return (PEB*)(__readfsdword(0x30));
@grdl
grdl / nord-theme-k9s-skin.yml
Last active February 6, 2023 20:42
Nord theme skin for k9s
# Nord theme skin for k9s
#
# Install by putting this file in $XDG_CONFIG_HOME/k9s/skin.yml (usually it's ~/.config/k9s/skin.yml).
#
# Palette reference:
# https://www.nordtheme.com/docs/colors-and-palettes
# Polar Night
nord0: &nord0 "#2E3440" #black
nord1: &nord1 "#3B4252" #lighter black
@dcb9
dcb9 / clash-for-asus-merlin-ac-5300.md
Last active November 15, 2024 00:45
ASUS Merlin AC-5300 使用 Clash 搭建透明代理
@valinet
valinet / runpe64.cpp
Last active September 5, 2024 13:14
RunPE for x64
/*
RunPE for x64 - classic RunPE for 64-bit executables
Copyright (C) 2020 Valentin-Gabriel Radu
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@developit
developit / *constant-locals-loader.md
Last active February 4, 2022 17:15
Inline Webpack CSS Modules classNames, reducing bundle size. https://npm.im/constant-locals-loader

constant-locals-loader for Webpack

This loader optimizes the output of mini-css-extract-plugin and/or css-loader, entirely removing the potentially large CSS classname mappings normally inlined into your bundle when using CSS Modules.

Run npm install constant-locals-loader, then make these changes in your Webpack config:

module.exports = {
 module: {
@williamhaley
williamhaley / README.md
Last active February 12, 2023 08:51
GRUB2 Theme With grub-mkstandalone

Problem

grub-mkstandalone creates an image designed to be held in memory. grub-mkstandalone comes with a --themes flag that could be used to specify a theme, but depending on the modules installed, you may encounter this error like I did.

grub-mkstandalone: error: core image is too big (0x1d71b3 > 0x78000).

This means that the image generated by grub-mkstandalone was too large.

One Solution

@joshbarrass
joshbarrass / Readme.txt
Last active July 17, 2023 12:03 — forked from endolith/Readme.txt
Gnome to Wine color scraper
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py" If made executable you can run it in bash as-is
3. Open winecfg, go to Desktop Integration and install the new .theme file created
4. Hit apply and restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
#define INPUTPLANE 1
precision highp float;
uniform sampler2D tex;
uniform mat3 weight[128];
uniform vec2 pixSize;
uniform float bias;
varying vec2 uv;
void main() {
vec4 inputOffset[1];
inputOffset[0] = vec4(0,0,0.062499,0.124999);
@nicowilliams
nicowilliams / fork-is-evil-vfork-is-good-afork-would-be-better.md
Last active March 14, 2025 02:50
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid

I recently happened upon a very interesting implementation of popen() (different API, same idea) called popen-noshell using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

This is not a paper. I assume reader familiarity with fork() in particular and Unix in general, though, of course, I link to relevant wiki pages, so if the unfamiliar reader is willing to go down the rabbit hole, they should be able to come ou