Skip to content

Instantly share code, notes, and snippets.

View oitan's full-sized avatar
💯
Focused

Alikhan Oitan oitan

💯
Focused
View GitHub Profile
@oitan
oitan / README.md
Created June 5, 2026 12:48
Karabiner-Elements Cleaning Mode for macOS — toggle a keyboard-disable lock with a 3-second hold so you can wipe down your Mac keyboard without typing anything

Karabiner-Elements Cleaning Mode (macOS)

A Karabiner-Elements complex modification that turns your Mac keyboard into a brick on demand — useful when wiping down keys without typing gibberish into whatever app has focus.

What it does

  • Hold right_shift + right_command for 3 seconds → cleaning mode ON, all keyboard input is swallowed
  • Hold the same combo again for 3 seconds → cleaning mode OFF
  • macOS notification fires on each toggle so you know the state
//taken from: https://www.hackingwithswift.com/example-code/media/how-to-render-a-uiview-to-a-uiimage
//Available from iOS 10.0
let renderer = UIGraphicsImageRenderer(size: view.bounds.size)
let image = renderer.image { ctx in
view.drawHierarchy(in: view.bounds, afterScreenUpdates: true)
}