Skip to content

Instantly share code, notes, and snippets.

View vidurb's full-sized avatar
💉

Vidur B vidurb

💉
View GitHub Profile
@vidurb
vidurb / barrier_karabiner.lua
Last active April 29, 2021 06:00 — forked from knu/barrier_karabiner.lua
Barrier and Karabiner-Elements integration using Hammerspoon
knu = require("knu") -- https://github.com/knu/hs-knu
-- Switch between Karabiner-Elements profiles as Barrier enters a different host
do
-- Configure Barrier (https://github.com/debauchee/barrier) to output log to ~/Library/Logs/barrier.log
local logFile = os.getenv("HOME") .. "/Library/Logs/barrier.log"
local lineNo = 1
local host = nil
local defaultProfile = "Vidur's Profile"
local profileForHost = function (host)
@vidurb
vidurb / fontloader.js
Last active May 1, 2019 06:11 — forked from rungta/fontloader.js
Load CSS `@font-face` fonts by listening for font loading events. A workaround while we wait for browsers to support the `font-rendering: swap` property.
/**
* fontloader.js
Helps you avoid FOIT and progressively load in multiple
sets of webfonts as asynchronous non-blocking resources.
Apply them on the page when the fonts are ready, like so:
.title-type { font-family: serif; }
.prose-type { font-family: sans-serif; }