Skip to content

Instantly share code, notes, and snippets.

@akssri
akssri / totp.el
Created September 1, 2025 10:50
totp.el
(defun call-function-on-region (cmd args &optional b e)
(let ((buf (buffer-substring b e)))
(with-temp-buffer
(apply #'call-process cmd nil t nil (append args (list buf))) ;;(split-string buf)))
(let ((bufstr (buffer-string)))
(x-select-text bufstr)
(kill-new bufstr)
(princ bufstr)))
(deactivate-mark)))
@akssri
akssri / defmethod.py
Created May 12, 2025 01:46
defmethod
# Copyright (c) 2016, 2021 Akshay S <[email protected]> (lispy)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the