Skip to content

Instantly share code, notes, and snippets.

@yrro
yrro / backup.py
Last active April 21, 2025 15:25
Orchestrate backups via borgbackup
#!/usr/bin/python3
# Usage: 'backup' alone will back the system up
# 'backup ARGS' will run borg with ARGS, configuring repository location, passphrase etc.
# e.g., 'backup list ::' will list backups in the repository
# Goals: run on RHEL 8's default Python interpreter (3.6) with no non-RHEL packages required
# Non-goals: backing up multiple filesystems, any configurability save modifying values set
# in code.
@crides
crides / layout.py
Last active November 26, 2023 20:04
# Extracts QMK `info.json` layout data from kicad pcb
# You need to have the `pcbnew` module importable (should be installed when kicad is installed)
import re, pcbnew, json
from typing import Callable
from functools import reduce
kicad7 = pcbnew.Version().startswith("7")
if kicad7:
@rock3r
rock3r / MainActivity.kt
Created June 16, 2022 16:13
WebView Compose scroll example
package dev.sebastiano.webviewcompose
import android.annotation.SuppressLint
import android.content.Context
import android.os.Bundle
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
@dovahkiin98
dovahkiin98 / AutoSizeText.kt
Created October 4, 2021 09:03
AutoSize text implementation in Jetpack Compose
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.text.InlineTextContent
import androidx.compose.foundation.text.InternalFoundationTextApi
import androidx.compose.foundation.text.TextDelegate
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@NullSense
NullSense / bilateral_combos.patch
Created April 22, 2021 11:07
QMK Bilateral combinations patch
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 2387f50dc8..4448ceae4b 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -51,6 +51,10 @@ int retro_tapping_counter = 0;
# include "fauxclicky.h"
#endif
+#if (BILATERAL_COMBINATIONS + 0)
+# include "quantum.h"
@tararoys
tararoys / May12knausj-master-cheatsheet.pdf
Last active April 9, 2025 09:47
Code to print out all voice commands in the knausj talon repository,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@torgeir
torgeir / zoom-mute-status-setup.md
Last active October 13, 2022 21:21
Example configurations for AnyBar and Ubsersicht to get a visual cue representing your zoom mute status. Credits https://gist.github.com/tyhawkins/66d6f6ca8b3cb30c268df76d83020a64
@prologic
prologic / LearnGoIn5mins.md
Last active February 12, 2025 06:52
Learn Go in ~5mins
#!/usr/bin/env kotlin
@file:DependsOn("com.github.ajalt.clikt:clikt-jvm:3.0.1")
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.UsageError
import com.github.ajalt.clikt.output.TermUi
class App : CliktCommand() {
enum class DaemonType {
@kaushikgopal
kaushikgopal / karabiner.edn
Last active May 16, 2024 00:57
My source Karabiner file in Goku's edn format - Now lives @ https://github.com/kaushikgopal/dotfiles/blob/master/.karabiner.edn
;; File has moved over to https://github.com/kaushikgopal/dotfiles/blob/master/.karabiner.edn
;; Feel free to raise github issues in that repo, if you have questions/comments/edits