Skip to content

Instantly share code, notes, and snippets.

@mskorzhinskiy
mskorzhinskiy / org-attach-id-human-readable.el
Created January 23, 2023 07:09
My take on generating human-readable attach id's for org-attach
(use-package ffap)
(defun sanitze-string (str)
"Returns a string which contains only a-zA-Z0-9 with single dashes
replacing all other characters in-between them.
Some parts were copied and adapted from org-hugo-slug
from https://github.com/kaushalmodi/ox-hugo (GPLv3)."
(let* (;; Remove "<FOO>..</FOO>" HTML tags if present.
(str (replace-regexp-in-string "<\\(?1:[a-z]+\\)[^>]*>.*</\\1>" "" str))
@Brainiarc7
Brainiarc7 / One line to rebuild all DKMS modules on Ubuntu
Last active September 20, 2023 10:09
One line to rebuild all DKMS modules on Ubuntu
Here goes.
ls /usr/src/linux-headers-* -d | sed -e 's/.*linux-headers-//' | \
sort -V | tac | sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
Run as root.
(require 'org-table)
(require 'org-clock)
(defun clocktable-by-tag/shift-cell (n)
(let ((str ""))
(dotimes (i n)
(setq str (concat str "| ")))
str))
(defun clocktable-by-tag/insert-tag (params)