Skip to content

Instantly share code, notes, and snippets.

@tonsky
tonsky / init.lua
Created November 10, 2021 13:57
Hammerspoon config to toggle keyboard layouts
require("hs.hotkey")
require("hs.keycodes")
hs.hotkey.bind({}, "F13", function()
-- hs.keycodes.currentSourceID("me.tonsky.keyboardlayout.helix.english-helix")
hs.keycodes.setLayout("English - Helix")
end)
hs.hotkey.bind({}, "F14", function()
-- hs.keycodes.currentSourceID("me.tonsky.keyboardlayout.helix.russian-helix")
aabacadaeafagahaiajakalamanaoapaqarasatauavawaxayaza
babbcbdbebfbgbhbibjbkblbmbnbobpbqbrbsbtbubvbwbxbybzb
cacbccdcecfcgchcicjckclcmcncocpcqcrcsctcucvcwcxcyczc
dadbdcddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd
eaebecedeefegeheiejekelemeneoepeqereseteuevewexeyeze
fafbfcfdfeffgfhfifjfkflfmfnfofpfqfrfsftfufvfwfxfyfzf
gagbgcgdgegfgghgigjgkglgmgngogpgqgrgsgtgugvgwgxgygzg
hahbhchdhehfhghhihjhkhlhmhnhohphqhrhshthuhvhwhxhyhzh
iaibicidieifigihiijikiliminioipiqirisitiuiviwixiyizi
jajbjcjdjejfjgjhjijjkjljmjnjojpjrjsjtjujvjwjxjyjzj
(ns pie-a-la-mode)
;; Concurrency example from The Pragmatic Programmers. Waiters check if there's
;; enough pie and ice cream before they sell an order, but if they don't
;; coordinate it's still possible to sell more than we have.
;;
;; The below code should return either :ok or :not-available for a given order.
;; If we oversell, then it will throw an exception.
;;
;; How would you change this to ensure that that doesn't happen?
@tonsky
tonsky / youtube.css
Last active April 10, 2025 14:22
Youtube Userstyle
:root {
--grey50: #A0A0A0;
--grey75: #C0C0C0;
--grey90: #E0E0E0;
--opacity: 1;
}
.ytp-gradient-bottom { display: none; }
.ytp-cairo-refresh-signature-moments .ytp-play-progress { background: #F00; }
.ytp-button[data-tooltip-target-id=ytp-autonav-toggle-button],