Skip to content

Instantly share code, notes, and snippets.

@pongo
pongo / 170531.ahk
Last active June 8, 2025 10:49 — forked from bobuk/switcher.ahk
So bored to use default keyboard layouts switcher so write mine with ahk
en := DllCall("LoadKeyboardLayout", "Str", "00000409", "Int", 1)
ru := DllCall("LoadKeyboardLayout", "Str", "00000419", "Int", 1)
~<+RControl::SetLayout(ru)
~>^LShift::SetLayout(ru)
~RControl::SetLayout(en)
#Space::ChangeLayout()
!Space::ChangeLayout()
ol {
padding-inline-start: 0;
list-style: none;
counter-reset: my-counter;
display: grid;
grid-template-columns: auto 1fr;
row-gap: 0.5rem;
}
ol li {
display: contents;
function debounce(fn, delay) {
let timer;
return function (...args) {
clearTimeout(timer);
timer = setTimeout(() => fn.apply(this, args), delay);
};
}
#SingleInstance, force
#NoEnv
#KeyHistory 0
SendMode Input
; Menu, Tray, Icon, C:\Program Files\Mozilla Firefox\firefox.exe
GroupAdd, WorkIn , ahk_exe firefox.exe
GroupAdd, WorkIn , ahk_exe chrome.exe
GroupAdd, WorkIn , ahk_exe msedge.exe
GroupAdd, WorkIn , ahk_exe browser.exe
@pongo
pongo / no-flash-window.wh.cpp
Created March 18, 2025 16:50
NoFlashWindow for 10 seconds
// ==WindhawkMod==
// @id no-flash-window-fork
// @name NoFlashWindow
// @description Prevent programs from flashing their windows on the taskbar
// @version 1.0
// @author m417z
// @github https://github.com/m417z
// @twitter https://twitter.com/m417z
// @homepage https://m417z.com/
// @include *
CREATE TABLE `wordle_day` (
`day` INT(11) NOT NULL,
`uid` INT(11) NOT NULL,
`attempts` TINYINT(1) NULL DEFAULT NULL,
`won` TINYINT(1) NULL DEFAULT '0',
PRIMARY KEY (`day`, `uid`)
)
@pongo
pongo / debug-assert.d.ts
Created November 3, 2024 13:16
debug assert
export function debugAssert(condition: any, message?: string | (() => string)): asserts condition;
@pongo
pongo / hddnosleep.zig
Last active October 3, 2024 13:38
Prevent HDD from going to sleep
const std = @import("std");
// zig build-exe hddnosleep.zig -O ReleaseSmall
// install as service via nssm.exe install hddnosleep
const FILENAME = "D:\\tmp\\hddnosleep.txt";
pub fn main() anyerror!void {
// const allocator = std.heap.page_allocator;
// const stdout = std.io.getStdOut().writer();
@pongo
pongo / get_fps.py
Last active September 27, 2024 09:09
Get video FPS in python via ffmpeg (ffprobe)
from pathlib import Path
from typing import TypeAlias
import ffmpeg # https://github.com/kkroening/ffmpeg-python
FPS: TypeAlias = float
def get_fps(video_path: str | Path) -> FPS | None:
try:
@pongo
pongo / get_all_files.py
Last active September 27, 2024 09:03
Get all files in folder in python (recursive optional)
from typing import Iterator
from pathlib import Path
def get_all_files(root: Path | str, recursive=False) -> Iterator[Path]:
for item in Path(root).iterdir():
if item.is_file():
yield item
elif recursive and item.is_dir():
yield from get_all_files(item, recursive=True)