This file contains 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
$ pandoc -f org -t markdown-smart --strip-comments --wrap=none --lua-filter=org.lua index.org -o output.md && sed -i '' 's/{width="[0-9]*%"}//g' output.md | |
org.lua: | |
function Header(el) | |
el.attr = pandoc.Attr("", {}, {}) | |
return el | |
end | |
function CodeBlock(el) |
This file contains 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 advised:elisp-demos--search (orig-fun symbol) | |
(cl-letf* ((orig-insert-file-contents (symbol-function 'insert-file-contents)) | |
((symbol-function 'insert-file-contents) | |
(lambda (filename &optional visit beg end replace) | |
(apply orig-insert-file-contents filename visit beg end replace nil) | |
(apply orig-insert-file-contents "/private/tmp/mine.org" visit beg end replace nil)))) | |
(funcall orig-fun symbol))) | |
(advice-add 'elisp-demos--search :around #'advised:elisp-demos--search) |
This file contains 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
(defcustom send-to-kindle-from-email | |
nil | |
"Your own email address to send from via mu4e." | |
:type 'string | |
:group 'send-to-kindle) | |
(defcustom send-to-kindle-to-email | |
nil | |
"Your Kindle email address to send pdf to." | |
:type 'string |
This file contains 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
(defcustom send-to-kindle-from-email | |
nil | |
"Your own email address to send from via mu4e." | |
:type 'string | |
:group 'send-to-kindle) | |
(defcustom send-to-kindle-to-email | |
nil | |
"Your Kindle email address to send pdf to." | |
:type 'string |
This file contains 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 ar/eval-uncommented-region (start end) | |
(interactive "r") | |
(let ((text (buffer-substring-no-properties start end))) | |
(with-temp-buffer | |
(insert text) | |
(emacs-lisp-mode) | |
(uncomment-region (point-min) (point-max)) | |
(eval-buffer) | |
(message "Evaluated")))) |
This file contains 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 dwim-shell-commands-duplicate () | |
(interactive) | |
(dwim-shell-command-on-marked-files | |
"Duplicate file(s)." | |
"cp '<<f>>' '<<f(u)>>'" | |
:utils '("cp" "scp") | |
:post-process-template | |
(lambda (script file) | |
(if (tramp-tramp-file-p file) | |
;; Tramp file path start with "/ssh:". Drop it. |
This file contains 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
(use-package dwim-shell-command | |
:ensure t | |
:bind (:map dired-mode-map | |
("C-c d" . dwim-shell-commands-duplicate)) | |
:config | |
;; Loads all my own dwim shell commands. | |
(require 'dwim-shell-commands)) |
This file contains 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
;; Needs make-mu4e-context :vars mu4e-spam-folder set. | |
;; Generates `mu4e-headers-mark-for-spam'. | |
(mu4e~headers-defun-mark-for spam) | |
(defun ar/mu4e-mark-junk-candidates-using-chatgpt () | |
"Mark potential messages as junk by asking ChatGPT." | |
(interactive) | |
(save-restriction | |
(narrow-to-region (window-start) |
This file contains 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 ar/chatgpt-decline-offer-from-sender () | |
(interactive) | |
(unless (eq major-mode 'mu4e-compose-mode) | |
(user-error "Not in mu4e:compose mode")) | |
(let ((chatgpt-shell-prompt-query-response-style 'inline)) | |
(chatgpt-shell-send-to-buffer | |
(concat "write a succinct email reply body and kindly decline explictly to the following email as I am not interested: \n\n" | |
(buffer-substring-no-properties (point-min) (point-max)))))) |
This file contains 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 dwim-shell-commands-video-to-hevc-mkv () | |
"Convert all marked videos to hevc mkv." | |
(interactive) | |
(dwim-shell-command-on-marked-files | |
"Convert video to h265 " | |
"REPO_DIR=/tmp/other_video_transcoding | |
if ! [ -d \"$REPO_DIR\" ] | |
then | |
git clone https://github.com/donmelton/other_video_transcoding.git $REPO_DIR | |
fi |
NewerOlder