Skip to content

Instantly share code, notes, and snippets.

View 573's full-sized avatar

Daniel Kahlenberg 573

View GitHub Profile
@tadfisher
tadfisher / build.nix
Last active October 15, 2024 10:00
Simplified Nix integration with Gradle
{ lib
, stdenv
, jdk
, gradle
, mavenRepo
}:
stdenv.mkDerivation {
pname = "built-with-gradle";
version = "0.0";
@mankoff
mankoff / README.md
Last active February 5, 2024 13:46 — forked from tararoys/May12knausj-master-cheatsheet.pdf
Code to print out all voice commands in the knausj talon repository,

Talon Voice Commands Cheatsheet

This is a demo for how to get a cheatsheet of all Talon voice commands.

To recreate what I did:

  1. Have talon installed on your computer following the instructions at talonvoice.com
  2. Paste both the cheatsheet.py and cheatsheet.talon into the user directory of ~/talon. This makes these scripts available to talon.
  3. Open the talon repl and type
@tararoys
tararoys / Replacement.md
Last active June 16, 2023 15:39
A cheat sheet for learning several of the most useful talon commands
@lheckemann
lheckemann / aarch64-vm.nix
Created January 28, 2021 17:03
AArch64 VM
{ pkgsPath ? <nixpkgs> }:
let
pkgs = import pkgsPath {};
pkgsAarch64 = import pkgsPath { system = "aarch64-linux"; };
iso = (pkgsAarch64.nixos {
imports = [ (pkgsPath + "/nixos/modules/installer/cd-dvd/installation-cd-base.nix") ];
users.users.root.openssh.authorizedKeys.keyFiles = [(builtins.fetchurl https://github.com/lheckemann.keys)];
}).config.system.build.isoImage;
;;; plantuml_helpers.el --- Provides plantuml helper functions -*- lexical-binding: t -*-
;;; Commentary:
;; plantuml helper functions
;;; Code:
(require 'iimage)
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
(add-to-list 'iimage-mode-image-regex-alist '("@startuml\s+\\(.+\\)" . 1))
;; Rendering plantuml
@amygrinn
amygrinn / .emacs
Last active May 8, 2025 09:48
Autoshare -> Tasker -> Termux -> Org Protocol -> Org Capture
;; Required setup for emacs init file
(package-initialize)
(require 'org)
(require 'org-protocol)
;; Set 'my-org-directory' to the base directory of all of
;; your org files (with a trailing slash). For me it's:
(setq my-org-directory "/scp:org:/home/orgmode/")
;; But it could be a local directory for you
@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active June 27, 2025 08:37
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@oxalica
oxalica / flake.nix
Created January 16, 2021 14:49
Rust wasm example development environment
{
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
rust-overlay.url = github:oxalica/rust-overlay;
};
outputs = { nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs {
primes :: [Int]
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
pr :: [Int] -> [Int]
-- if 2 elements n & m :
pr (n:m:tail) = n*m : pr (m:tail)
-- 1. calculate their product --^ ^-- 2. continue with shifted list 'm:tail'
@angerman
angerman / build.sh
Created November 27, 2020 12:11
Cross compiling ws-tunnel
# prefetch wstunnel's master for nix, and store the result in wstunnel.json
nix-prefetch-git https://github.com/erebe/wstunnel > wstunnel.json
# and build the wstunnel-tarball with nix, using the haskell.nix infra structure as above (see default.nix)
nix build \
-f default.nix \
rpi64-musl.wstunnel-tarball \
-o rpi64-musl-wstunnel-tarball
--arg wstunnel-json ./ws-tunnel.json