Skip to content

Instantly share code, notes, and snippets.

@xdlg
xdlg / keymap.c
Last active September 15, 2024 18:47
Better Super Alt+Tab for QMK
// Adds the ALT_TAB keycode to a QMK keymap.
// Based on https://www.reddit.com/r/MechanicalKeyboards/comments/mrnxrj/better_super_alttab/
// Functionality is the following (basically the same thing as a normal Alt + Tab but without having
// to leave Alt pressed):
// - On pressing ALT_TAB, the window switch menu pops up.
// - While the menu is visible, it's possible to cycle through the selection by pressing ALT_TAB
// again, or Shift + ALT_TAB, or the arrow keys.
// - The selected window can be brought up by pressing Enter, which also closes the menu.
@xdlg
xdlg / vimium
Created May 2, 2022 07:22
Vimium config
unmapAll
map e scrollDown
map o scrollUp
map E scrollPageDown
map O scrollPageUp
map uu LinkHints.activateMode
map uU LinkHints.activateModeToOpenInNewTab
map UU LinkHints.activateModeToOpenInNewForegroundTab
map q goBack
map j goForward
@xdlg
xdlg / CMakeLists.txt
Last active February 2, 2022 22:03
CMake file with pkgconfig for FFMpeg/libav
cmake_minimum_required(VERSION 3.17)
project(Foo)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET
libavdevice
libavfilter
libavformat
libavcodec
@xdlg
xdlg / .clang-format
Last active April 29, 2022 15:52
Basic .clang-format
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
@xdlg
xdlg / character_frequency_counter.py
Created January 9, 2020 13:17
Simple script to count character frequencies in text files
#!/usr/bin/python3
import argparse
import string
from os.path import join
from glob import glob
from collections import Counter