Skip to content

Instantly share code, notes, and snippets.

View alphapapa's full-sized avatar

Adam Porter alphapapa

  • USA
View GitHub Profile
@alphapapa
alphapapa / emacsconf2013-sacha.org
Created March 9, 2017 15:21 — forked from sachac/emacsconf2013-sacha.org
Source code for my Emacs conference talk

Comments? sacha@sachachua.com

  • Emacs learning curve?

Meta information

Assumptions

  • Mix of Emacs geeks skewed towards people who’ve been using this for a while (after all, takes a certain commitment to come all the way to an Emacs conference!)

Outcomes

@alphapapa
alphapapa / createshortcut.js
Created October 23, 2016 01:26 — forked from amzyang/createshortcut.js
create pentadactyl commandline options
// createshortcut.js -- ++pentadactyl
// @Author: eric.zou (frederick.zou@gmail.com)
// @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
// @Created: Tue 29 Nov 2011 01:24:05 PM CST
// @Last Change: Tue 29 Nov 2011 02:23:36 PM CST
// @Revision: 41
// @Description:
// @Usage:
// @TODO:
// @CHANGES:
@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 / .gitignore
Created September 11, 2016 07:52 — forked from wzhd/.gitignore
Parsing Evernote export file (.enex) using Python
*.enex
@alphapapa
alphapapa / filter-buffer.el
Created April 22, 2016 09:44 — forked from wasamasa/filter-buffer.el
Emacs buffer filtering
(defun my-filter-current-buffer (program &rest args)
(let* ((stdout-buffer (generate-new-buffer " stdout"))
(ret (apply 'call-process-region (point-min) (point-max) program
nil (list stdout-buffer) nil args)))
(when (zerop ret)
(let ((output (with-current-buffer stdout-buffer
(buffer-string))))
(erase-buffer)
(insert output)))
(kill-buffer stdout-buffer)))
@alphapapa
alphapapa / diskchecker.pl
Created April 18, 2016 04:11 — forked from bradfitz/diskchecker.pl
diskchecker.pl
#!/usr/bin/perl
#
# Brad's el-ghetto do-our-storage-stacks-lie?-script
#
sub usage {
die <<'END';
Usage: diskchecker.pl -s <server[:port]> verify <file>
diskchecker.pl -s <server[:port]> create <file> <size_in_MB>
diskchecker.pl -l [port]
@alphapapa
alphapapa / _reader-macros.md
Created October 26, 2015 04:34 — forked from chaitanyagupta/_reader-macros.md
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.