This guy’s tutorials look pretty excellent:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(transient-define-prefix denote-transient () | |
"Denote dispatch" | |
[["Note creation (d)" | |
("dd" "new note" denote) | |
("dj" "new or existing journal entry" denote-journal-new-or-existing-entry) | |
("dn" "open or new" denote-open-or-create) | |
("dt" "new specifying date and time" denote-date) | |
("ds" "create in subdirectory " denote-subdirectory)] | |
["Reviewing (r)" | |
("rd" "notes this day" aw/notes-this-day)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; f(x) = x + 1 | |
(define (f x) (+ x 1)) | |
;; g(x) = x*x + 1 | |
(define (g x) (+ (* x x) 1)) | |
(define (respond secret guess) | |
(if (= secret guess) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun aw/denote-normalize-org-frontmatter () | |
"Normalize the front-matter in an org-mode file." | |
(interactive) | |
(when-let* ((file (buffer-file-name)) | |
(denote-filename-is-note-p file) | |
(type (denote-filetype-heuristics file)) | |
(title (denote-retrieve-title-value file type)) | |
(id (denote-retrieve-filename-identifier file))) | |
(let ((kwds (denote-retrieve-keywords-value file type))) | |
(delete-matching-lines "^#\\+title:.*$" (point-min) (point-max)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; nm-org-roam-to-denote.el --- Migrate notes from org-roam to denote | |
;; Copyright (C) 2022 bitspook <[email protected]> | |
;; Author: bitspook | |
;; Version: 0.1.0 | |
;; URL: https://github.com/bitspook/notes-migrator | |
;; Package-Requires: ((emacs "28.1") (denote "1.0.0") | |
;;; Commentary: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Resource: https://stackoverflow.com/questions/11206140/typewriter-sounds-for-emacs | |
(defvar tink "/System/Library/Sounds/Tink.aiff") | |
(defun play (file) | |
(let ((buf (get-buffer-create "playnoise"))) | |
(start-process-shell-command "play" buf (concat "afplay " file)))) | |
(defun do-tink () | |
(play tink)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: snippet -*- | |
# name: pipe inspect | |
# key: pi | |
# -- | |
|> IO.inspect(label: "$1") | |
$0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar bootstrap-version) | |
(setq straight-repository-branch "develop") | |
(let ((bootstrap-file | |
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) | |
(bootstrap-version 5)) | |
(unless (file-exists-p bootstrap-file) | |
(with-current-buffer | |
(url-retrieve-synchronously | |
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; Demonstration of a turing-complete language | |
(define (ev e [ρ '()]) | |
(match e | |
[(? symbol? x) (cadr (assoc x ρ))] | |
[`(λ (,xs ...) ,es) `(cls ,ρ ,xs ,es)] | |
[`(,f ,as ...) | |
(match (ev f ρ) | |
[`(cls ,cρ ,xs ,es) (ev es (append (map list xs (map (λ (v) (ev v ρ)) as)) cρ ρ))])])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define *remaining-choices* '()) | |
(define (choose choices) | |
(call/cc | |
(λ (k) | |
(for ([i (cdr choices)]) | |
(set! *remaining-choices* (cons (cons k i) *remaining-choices*))) | |
(k (car choices))))) |
NewerOlder