Skip to content

Instantly share code, notes, and snippets.

@jborean93
jborean93 / NoGui.ps1
Last active July 1, 2025 13:58
Generates an exe called NoGui.exe that can spawn a hidden windows
<#
NOTE: Must be run in Windows PowerShell (5.1), PowerShell (7+) cannot create standalone exes.
This is designed to create a simple exe that can be used to spawn any console
application with a hidden Window. As NoGui.exe is a GUI executable it won't
spawn with an associated console window and can be used to then create a new
process with a hidden console window with the arguments it was created with.
By default, NoGui will spawn the child process with same stdio handles as
@SF-300
SF-300 / komorebi_async_events.py
Last active November 17, 2023 21:12
async reading of win32 named pipe containing komorebi window manager events
# NOTE(zeronineseven): Heavily based on https://gist.github.com/denBot/4136279812f87819f86d99eba77c1ee0
import asyncio
import contextlib
import json
from contextlib import AsyncExitStack
from pathlib import Path
from typing import AsyncContextManager, Protocol, AsyncIterator, Never
import win32event
import win32pipe
@urob
urob / git_for_zmk.md
Last active July 6, 2025 17:16
Maintaining a personal ZMK fork
@da-rth
da-rth / komorebi_named_pipe.py
Created October 25, 2021 18:09
An example of how to have komorebi subscribe and send events to a named pipe in python
import win32pipe
import win32file
import pywintypes
import subprocess
import json
import time
KOMOREBI_BUFF_SIZE = 64 * 1024
KOMOREBI_PIPE_NAME = "yasb"
@sfaleron
sfaleron / immutarray.py
Last active June 6, 2025 16:19
Immutable/hashable numpy Array
# ISC License (ISC)
#
# Copyright 2021 Christopher Fuller
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active June 27, 2025 08:37
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@samoshkin
samoshkin / toggle_keybindings.tmux.conf
Last active June 28, 2025 14:39
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive