Skip to content

Instantly share code, notes, and snippets.

@knu
knu / barrier_karabiner.lua
Last active April 26, 2024 17:58
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 = "Default"
local profileForHost = function (host)
@nadavrot
nadavrot / Matrix.md
Last active May 5, 2024 08:37
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of