Skip to content

Instantly share code, notes, and snippets.

View hlissner's full-sized avatar
💭
Cleaning up Doom's issue trackers

Henrik Lissner hlissner

💭
Cleaning up Doom's issue trackers
View GitHub Profile
@hlissner
hlissner / emacs-info.el
Last active June 9, 2026 19:37
Generate an info dump about your Emacs environment. Usage instructions are in comments.
(defun emacs-info ()
(interactive)
(pop-to-buffer
(with-current-buffer (get-buffer-create "*emacs info*")
(erase-buffer)
(let ((standard-output (current-buffer)))
(mapc (lambda (line)
(princ (format "%s %s" (car line) (cdr line)))
(terpri (current-buffer)))
`((generated . ,(format-time-string "%b %d, %Y %H:%M:%S"))
@hlissner
hlissner / capture.el
Last active March 30, 2025 14:49
Examples of Doom CLI scripts
#!/usr/bin/env doomscript
;; An example script showing off how use Doom's CLI framework to write your own.
(defcli! (capture)
((key ("-k" "--key" key))
&input input &args args)
"Open an org-capture window."
(exit! "emacsclient" "-a" "" "-e"
(format "(+org-capture/open-frame %S %S)"
(concat input (string-join args " "))
@hlissner
hlissner / synology-ddns.linode.php
Last active July 29, 2022 14:44
A DDNS service provider script for Synology NAS (based off https://github.com/cpascal/syno-ddns-linode/blob/master/linode.php)
#!/usr/bin/php -d open_basedir=/usr/syno/bin/ddns
<?php
if ($argc !== 5) {
echo 'badparam';
exit();
}
// Entered into DSM (Control Panel > External Access > DDNS)
$username = (string) $argv[1]; // Resource ID
(defvar +org-babel-mode-alist
'((cpp . C)
(C++ . C)
(D . C)
(sh . shell)
(bash . shell)
(matlab . octave)
(amm . ammonite))
"An alist mapping languages to babel libraries. This is necessary for babel
libraries (ob-*.el) that don't match the name of the language.
@hlissner
hlissner / custom-set-faces.el
Last active May 30, 2020 13:18
Convenience macro for additively setting face attributes in Doom Emacs
(defmacro custom-theme-set-faces! (theme &rest specs)
"Apply a list of face specs as user customizations for THEME.
THEME can be a single symbol or list thereof. If nil, apply these settings to
all themes. It will apply to all themes once they are loaded.
(custom-theme-set-faces! '(doom-one doom-one-light)
`(mode-line :foreground ,(doom-color 'blue))
`(mode-line-buffer-id :foreground ,(doom-color 'fg) :background \"#000000\")
'(mode-line-success-highlight :background \"#00FF00\")
@hlissner
hlissner / doom-persist-frame.md
Last active April 15, 2024 19:20
(Doom Emacs) Persists the Emacs' frame's dimensions, location and full-screen state across sessions
@hlissner
hlissner / touch-bending.md
Created April 4, 2019 17:56
Some literature on touch-bending in Unity or HLSL
@hlissner
hlissner / install-yay.sh
Created April 3, 2019 05:46
Install yay on Arch Linux
if ! command -v yay >/dev/null; then
tmp=$(mktemp -d)
function finish { rm -rf "$tmp"; } # clean up after yourself...
trap finish EXIT # ...no matter how you exist
git clone https://aur.archlinux.org/yay.git "$tmp"
pushd "$tmp"
makepkg -sri --noconfirm --needed
popd
@hlissner
hlissner / hs-special-modes-alist.el
Created June 21, 2018 23:12
Adds hideshow folding rules for yaml-mode and ruby-mode
(defun +data-hideshow-forward-sexp (arg)
(let ((start (current-indentation)))
(forward-line)
(unless (= start (current-indentation))
(require 'evil-indent-plus)
(let ((range (evil-indent-plus--same-indent-range)))
(goto-char (cadr range))
(end-of-line)))))
(map-put hs-special-modes-alist
'yaml-mode