Skip to content

Instantly share code, notes, and snippets.

@meatcar
meatcar / Wait for Dark Mode change in Windows.md
Last active April 5, 2024 18:37
Subscribe to Dark Mode change event in Windows

Wait for Dark Mode change in Windows

This is a snippet I came up with that doesn't exist anywhere else on the net (so far). I think its the best way to programmatically detect dark mode change in Windows. Unlike other approaches, there's no busy-waiting/polling involved. Instead, we use the native event system to subscribe to the AppsUseLightTheme registry key change.

A big benefit of this approach is that theme change detection is almost instantaneous.

To run this in a loop, call this script, react to it's output, then call it again. An example script is provided.

@meatcar
meatcar / resume.json
Last active April 16, 2024 21:18
Resume
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"meta": {
"canonical": "https://gist.github.com/meatcar/bc4619384accaeda6e6a0016f060a00e#file-resume-json",
"version": "v0.0.1",
"lastModified": "2024-04-16T21:17:28Z"
},
"basics": {
"name": "Denys Pavlov",
"email": "me@denys.me",
@meatcar
meatcar / 2023-03-20-nhl94-netplay.md
Created March 21, 2023 16:36
2023-03-20-nhl94-netplay.md

Playing NHL94 between two Macs over the internet with Xbox Controllers

2023-03-20 9:56pm, Denys Pavlov me@denys.me

There are a couple different ways to get this done. The "best" way depends on your technical skills.

Internet connection

An absolute requirement is a reliable and fast internet connection. Unreliable Wi-Fi and distance introduces delays and a degraded experience. Hardwired ethernet and geographic proximity makes a better experience.

@meatcar
meatcar / 2021-01-09-peanut-butter-curry.md
Created December 1, 2022 21:46
2021-01-09-peanut-butter-curry.md

Peanut Butter Curry

A recipe from The Starving Artist's Way by Nava Lubelski. Combines off-the-shelf ingredients in strategic ways to make a delicious curry.

Ingredients

  • 1/2 onion, diced
  • 2-3 cloves of garlic, chopped
  • 2-3 teaspoons of chopped fresh ginger
  • 1 tblsp olive, coconut, or sesame oil
@meatcar
meatcar / 2021-01-26-sichuan-wings.md
Last active December 1, 2022 21:46
2021-01-26-sichuan-wings.md
@meatcar
meatcar / gist:64a8427a04883db0467d08a643ded290
Created August 27, 2021 15:59 — forked from tsjnachos117/gist:8231f9f8ed08968cc5f1a7f4d3e06b0e
Get KDE Connect battery info (from desktop/laptop)
I find the ability to get my android devices' battery info on my desktops via cli to be extremely convenient. I used to be able to this with KDE Connect easily, but things have just changed. Since I can't find any documentation on how to do this, and since I just stumbled on the answer myself, I though I might share what I know here. Please note that in the examples below, I will be using `{device-id}` as a placeholder for the string that KDE Connect uses to identify to my devices.
That said, I used to be able to get my various devices' battery status through gdbus through the following:
gdbus call --session --dest org.kde.kdeconnect --object-path /modules/kdeconnect/devices/{device-id} --method org.kde.kdeconnect.device.battery.charge
However on Arch, I now get the following error: `Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownInterface: No such interface 'org.kde.kdeconnect.device.battery' at object path '/modules/kdeconnect/devices/b04294f19e8767f5'`. I don't get this message on Ubuntu 2
@meatcar
meatcar / README.md
Last active July 19, 2023 06:53
GPU System-Tray Toggler

GPU System-Tray Toggler

Using an eGPU requires occasional disabling and enabling of certain devices. This script adds an icon in your system tray to allow that to be done faster than opening Device Mangager.

Technically, you can use this to toggle any device shown in Device Manager, but I've found it most useful for GPUs so far.

Installation

  1. Download gpu-systray.ps1 and save it somewhere.
@meatcar
meatcar / README.md
Last active March 12, 2024 01:38
A better "Reboot to {OS}" script for rEFInd Next Boot selection for Windows