Skip to content

Instantly share code, notes, and snippets.

View johnw42's full-sized avatar

John Williams johnw42

  • Microsoft
  • Seattle
  • 16:10 (UTC -08:00)
View GitHub Profile
@johnw42
johnw42 / Default.json
Created January 27, 2026 02:38
My input-remapper config for a Razer Naga V2 Hyperspeed
[
{
"input_combination": [
{
"type": 1,
"code": 29,
"origin_hash": "04c22fed0a139a48a5920ef29e84cc76"
},
{
"type": 1,
from itertools import takewhile
from typing import Iterable, Sequence, TypeVar
T = TypeVar("T")
def common_prefix(seqs: Iterable[Sequence[T]]) -> Iterable[T]:
"Returns the common prefix of a sequence of sequences."
return (c[0] for c in takewhile(lambda x: all(x[0] == y for y in x), zip(*seqs)))
;;;###autoload
(defun before-compile-hook (&rest _)
"Saves the current buffer if it is associated with a file."
(interactive)
(when buffer-file-name
(save-buffer)))
(provide 'before-compile-hook)