Skip to content

Instantly share code, notes, and snippets.

@ShirenY
ShirenY / ime_switcher.cpp
Last active March 10, 2026 06:10
A tray program to switch IME between en/ch with Right CTRL only.
// ime_switcher.cpp (98% vibe coded ;)
// A tray program to switch IME between en/ch with Right CTRL only.
// Build with Visual Studio 2022 (x64 Native Tools):
// cl /EHsc /std:c++17 ime_switcher.cpp user32.lib shell32.lib gdi32.lib imm32.lib /link /SUBSYSTEM:WINDOWS
#define UNICODE
#define _UNICODE
#include <windows.h>
#include <shellapi.h>
#include <imm.h>
#include <chrono>
@ShirenY
ShirenY / RefT.cpp
Last active January 12, 2026 03:54
Ref<T> A zero-overhead, nullable, rebindable smart reference
#ifndef MODERN_REF_HPP
#define MODERN_REF_HPP
#include <type_traits>
#include <functional>
#include <optional>
#include <cassert>
/**
* @brief Ref<T> - A zero-overhead, nullable, rebindable smart reference.