Skip to content

Instantly share code, notes, and snippets.

View alphapapa's full-sized avatar

Adam Porter alphapapa

  • USA
View GitHub Profile
@alphapapa
alphapapa / emacs-27-svg-screenshot.svg
Last active August 22, 2020 15:53
Emacs 27 can take SVG screenshots of itself
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alphapapa
alphapapa / init.el
Created September 21, 2016 22:18
Fira code symbols in emacs. You need to grab the Fira Code Symbol font for this to work. https://github.com/tonsky/FiraCode/files/412440/FiraCode-Regular-Symbol.zip
;;; Fira code
;; This works when using emacs --daemon + emacsclient
(add-hook 'after-make-frame-functions (lambda (frame) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")))
;; This works when using emacs without server/client
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")
;; I haven't found one statement that makes both of the above situations work, so I use both for now
(defconst fira-code-font-lock-keywords-alist
(mapcar (lambda (regex-char-pair)
@alphapapa
alphapapa / org-books.el
Created September 8, 2017 08:44
Insert book information as an Org entry with author, title, etc. as properties
(require 'esxml-query)
(require 'org-web-tools)
(defun ap/amazon-book-data (url)
"Return plist of data for book at Amazon URL."
(cl-flet ((field (target-field list)
(cl-loop for li in list
for (field value) = (ignore-errors
(-let (((_ _ (_ _ field) value) li))
(list field value)))
@alphapapa
alphapapa / tarx.sh
Last active May 14, 2020 01:58
tarx: Tar and compress files showing progress using tqdm or pv
#!/bin/bash
# Tar and compress files using tqdm or pv for a progress bar.
# * Safety
# NOTE: These are disabled by default in this template but should be
# enabled when feasible. Documentation is from the Bash man page.
# ** errexit
@alphapapa
alphapapa / helm-swish.el
Created December 1, 2017 08:47
Like helm-swoop, but faster (bare-bones featurewise, so not a replacement)
;;; Code:
;;;; Requirements
(require 'helm)
;;;; Commands
;;;###autoload
(defun helm-swish ()
@alphapapa
alphapapa / magit.sh
Last active April 5, 2020 10:18
Run a standalone Magit editor!
# Please see the script's new home: https://github.com/alphapapa/magit.sh
@alphapapa
alphapapa / pyt.sh
Last active March 29, 2020 09:50
#!/bin/bash
# * pyt
# ** TODOS
# *** TODO Branch for downloading audio/video separately and playing with mplayer or something
# Both VLC and mplayer can play separate audio and video files
# together, but VLC doesn't have a command-line option for
(defun ap/python-mode-outline-hook ()
(setq outline-level 'ap/python-outline-level)
(setq outline-regexp
(rx (or
;; Commented outline heading
(group
(* space) ; 0 or more spaces
(one-or-more (syntax comment-start))
(one-or-more space)
- command-execute 207 89%
- call-interactively 207 89%
- funcall-interactively 146 63%
- execute-extended-command 116 50%
- sit-for 61 26%
- redisplay 49 21%
- redisplay_internal (C function) 4 1%
- funcall 4 1%
- #<compiled 0x26ac9b> 4 1%
- gui-backend-selection-exists-p 4 1%
@alphapapa
alphapapa / elfeed-views.el
Last active February 11, 2020 23:47
Elfeed views (i.e. filter sets)
;; See https://github.com/alphapapa/unpackaged.el#filter-hydra