Skip to content

Instantly share code, notes, and snippets.

View daviwil's full-sized avatar

David Wilson daviwil

View GitHub Profile
@goshatch
goshatch / weeklyreview.el
Created August 16, 2021 10:24
Create a weekly review note from hotkey
(defvar gt/weekly-review-capture-template
`(("d" "default" entry
"* %?"
:if-new (file+head
"%<%Y-%m-%d>-weekly-review.org"
"%[~/org/roam/templates/weekly-review-template.org]"))))
(defun gt/weekly-review-capture (&optional no-visit)
"Create a weekly review note from the appropriate template"
(interactive)
@maxminoS
maxminoS / mu4e.el
Last active February 13, 2021 20:20
Automatic mu4e contexts
;; I wanted to be able to use mu4e contexts without showing my emails in GitHub dotfiles or creating another file to store the email accounts.
;; All email account information can be found in "~/.mbsyncrc", so I decided to work out a way to automatically create mu4e contexts based on all the sync-ed email accounts with mbsync.
;; (This method will not work for people not using mbsync, but the same idea can be applied to achieve the same results)
;; Since this function uses regular expressions to scrape the required data, it has some pre-defined format needed in "~/.mbsyncrc":
;; - "# Account: " is placed on top of every account to indicate different accounts
;; - "# Full Name: " below "# Account: " for the user's name
;; - "# SMTP " below "# Full Name: " needs the SMTP configurations
;; - "IMAPAccount ..." is used as the name of the account context
;; - "User ..." is the email address
@alphapapa
alphapapa / dired.sh
Last active April 4, 2021 09:37
Standalone Dired launcher
#!/bin/bash
# Launch Dired in a plain Emacs configuration.
# Arguments are passed to Emacs, e.g. "-nw" works as expected.
emacs -q "$@" \
--eval "(dired default-directory)" \
--eval "(defun kill-window-or-emacs () (interactive) (if (one-window-p) (kill-emacs) (delete-window)))" \
--eval "(setq dired-dwim-target t delete-by-moving-to-trash t)" \
(use-package general
:config
(general-create-definer rune/leader-keys
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
;; okay so take from : https://github.com/noctuid/general.el
;; rune/leader-keys is defined just above this as a "general-create-definer"
(declare (standard-bindings)(extended-bindings)(block)(fixnum)(not safe))
;;; From Text-File Databases at https://sites.google.com/site/schemephil/
;;; READ-CSV-RECORD [SEP] [PORT]
(define (read-csv-record . args)
(define (add-char-to-field c field)
(let ((length (field-length field))

Guix on WSL2

(updated versions of this document, plus more, live here)

This will show you how to get Guix running on WSL2.
We're going to go as "minimal" as possible, without starting off one of the readily available WSL2 distros.
Parts of this guide should help with understanding how to set up any custom distro on WSL, not just Guix.

Disclaimer: I'm a Guix nOOb! (hence going through the trouble of installing it on WSL2)

@isomorphisms
isomorphisms / gist:3114ab86960656a729a6b4653001aae2
Created November 27, 2019 06:08
how to pull from docker hub using podman/buildah
On void linux.
Under `/etc/containers/` there is a file called `registries.conf`. It is complemented by `man 5 containers-registries.conf`.
Change (for me lines 11-12) which say
[registries.search]
registries = []
@mfikes
mfikes / cljs.md
Last active January 6, 2024 07:13
cljs command

If you wan't a cljs that acts like clj, but for ClojureScript, there are a few minor changes you can make:

First, add the following entry to ~/.clojure/deps.edn under the :deps key:

org.clojure/clojurescript {:mvn/version "1.10.439"}

Then make copies of clj and clojure named cljs and clojurescript, and put those copies on your path.

@Francesco149
Francesco149 / docker-cross-device-link.md
Last active October 27, 2023 08:51
docker error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active April 9, 2024 02:09
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.