Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am thomp on github.
  • I am dthomp (https://keybase.io/dthomp) on keybase.
  • I have a public key ASCxAIFMFXn8f8LosijWg72aaNgv1gGwtjYaz3tI1Z2B3go

To claim this, I am signing this object:

@thomp
thomp / mktmp.el
Created August 25, 2023 19:50
quickly generate a temporary Emacs buffer
;; quickly generate a temporary Emacs buffer
;; mktmp.el
;; current location:
;;
;; related:
;; https://stackoverflow.com/questions/22289271/in-gnu-emacs-how-to-create-new-empty-buffer-with-one-keystroke
;; aquamacs ~new-tab~
@thomp
thomp / ts-sandbox.el
Last active August 17, 2023 19:54
transient-el-sandbox
;; https://gist.github.com/thomp/ff0fb98d4239af4e3f26a7b0cc64f4b6
(require 'transient)
;; simple transient
(transient-define-prefix tsc-hello ()
"Prefix that is minimal and uses an anonymous command suffix."
;; Binding suffixes with the ("key" "description" suffix-or-command) form within a group is extremely common.
[("s" "call suffix"
(lambda ()
(interactive)
@thomp
thomp / ascii-man-page.txt
Created October 10, 2022 03:28
ASCII man page
ASCII(7) Linux Programmer's Manual ASCII(7)
NAME
ascii - ASCII character set encoded in octal, decimal,
and hexadecimal
DESCRIPTION
ASCII is the American Standard Code for Information In‐
terchange. It is a 7-bit code. Many 8-bit codes (e.g.,
ISO 8859-1) contain ASCII as their lower half. The in‐
@thomp
thomp / org-latex-header--2022-09.org
Last active May 25, 2023 16:04
Emacs org-mode LaTeX boilerplate

@thomp
thomp / dired-file-url.el
Created February 8, 2022 22:15
Grab file URL corresponding to file at point in Dired
(defun dat-url-of-dired-file ()
"Add to the kill ring the URL for tthe file named at the current Dired point."
(interactive)
(let ((tem (dired-get-filename t t)))
(if tem
; (message "file: %s"
(kill-new
(concatenate 'string "file://"
(expand-file-name tem)))
(error "No file on this line"))))
/* car and driver; road and track */
img.i-amphtml-replaced-content {
display:none
}
div.gpt-adslot {
display:none
}
div.content-ads {
@thomp
thomp / latex_header-examples.md
Created January 19, 2021 22:23
org LaTeX_HEADER examples

Example of LaTeX_header for org

Misc. examples

#+LaTeX_HEADER: \usepackage{parskip} \usepackage{nopageno} \usepackage{tabularx}

#+LaTeX_HEADER: \usepackage[margin=1.5cm,portrait,letterpaper]{geometry} \newenvironment{identity} {\endgroup\ignorespaces} {\begingroup\def\@currenvir{identity}\ignorespacesafterend}
@thomp
thomp / gist:e85ffb7329b1ccf409c6f4ee8d405384
Last active February 9, 2023 14:41
youtube styling - block suggestions, previews, etc.
/*
the main page
*/
ytd-browse.style-scope {display: none;}
ytd-browse.ytd-page-manager {display: none;}
/*
single video page
*/
@thomp
thomp / dat-diary-idle-timer.lisp
Created March 31, 2020 20:15
run emacs diary if idle and we're on a new day
(defvar dat-diary-idle-timer
;; day of week
(let ((dat-ran-diary-on-day -1)
(idle-sec 600))
(run-with-idle-timer
idle-sec
t
#'(lambda ()
;; check if we've run diary yet today
(let ((day-number (calendar-day-of-week (calendar-current-date)))))