Skip to content

Instantly share code, notes, and snippets.

View leavesofgrass's full-sized avatar

Jon Pielaet leavesofgrass

View GitHub Profile
;; pretty print json files when they're opened and minify them when they are saved
(add-to-list 'auto-mode-alist
'("\\.json\\'" . (lambda ()
(json-mode)
(json-pretty-print (point-min) (point-max))
(goto-char (point-min))
(set-buffer-modified-p nil))))
(defun minify-json-buffer-contents()
### Step-by-step terminal instructions to install emacspeak on OS X.
### Copy-paste each step (one step at a time!) into the terminal.
### Much of the information presented here was copied from
### http://e-mac-speak.googlecode.com/svn/trunk/e-mac-speak-howto.org
### More useful settings may be found at https://github.com/ragb/emacs-ragb/blob/master/init.el
## WARNING: These steps worked for me, but they may not work for you. In fact they may break things, turn your computer into
## a paperweight, and/or eat your kittens. These instructions are provided in the hope that they may be useful,
## but you are responsible for running them and for any damange doing so may cause.

Building Emacspeak: Making GNU Emacs Accessible

In 2015, I started diving deeper into GNU Emacs because I saw its potential as an assistive technology. Not only as a way of providing better access to books and code for my students and clients, many of whom are blind, but also as a tool for creating more accessible content. Regular expressions and modes like Org, Markdown, and AucTex are extremely useful in the production of alternate formats.

Although I had used Emacs as a vanilla text editor off and on since the 90's, I didn't learn anything about the underlying Emacs Lisp (elisp) programming language until the end of 2015, when I got a hardcopy Emacs manual, quit my day job, and grew t

@leavesofgrass
leavesofgrass / Kaleidoscope.sh
Last active December 29, 2017 04:25
Keyboardio Model 01 Setup Script
# Java JDK
sudo apt-get install openjdk-8-jdk -y
# Arduino IDE
## Replace "URL"
echo "fetching arduino"
curl -o URL/arduino-1.8.5-linux64.tar.xz
tar xvf arduino-1.8.5-linux64.tar.xz
sudo mkdir /usr/local/arduino
sudo chmod 755 /usr/local/arduino
@leavesofgrass
leavesofgrass / Kaleidoscope.ino
Last active December 20, 2017 22:16
My kaleidoscope sketch
// -*- mode: c++ -*-
// Copyright 2016 Keyboardio, inc. <jesse@keyboard.io>
// See "LICENSE" for license details
#ifndef BUILD_INFORMATION
#define BUILD_INFORMATION "custom built firmware"
#endif
#include "Kaleidoscope-MouseKeys.h"
@leavesofgrass
leavesofgrass / chrysalis-shell-start.el
Last active December 17, 2017 19:24
Elisp function to start Chrysalis in a shell.
(defun chrysalis-shell-start ()
(interactive)
(shell "*chrysalis-shell*")
(goto-char (point-max))
(comint-kill-input)
(insert "cd ~/Chrysalis")
(comint-send-input)
(goto-char (point-max))
(comint-kill-input)
(insert "lein start")
@leavesofgrass
leavesofgrass / kaleidoscope-shell-flash.el
Last active December 17, 2017 19:23
Elisp function to flash Keyboardio Model 01 firmware in a shell.
(defun kaleidoscope-shell-flash ()
(interactive)
(shell "*kaleidoscope-shell*")
(goto-char (point-max))
(comint-kill-input)
(insert "cd ~/kaleidoscope/Kaleidoscope")
(comint-send-input)
(goto-char (point-max))
(comint-kill-input)
(insert "sudo make flash")
break;
case MACRO_LOL:
if (keyToggledOn(keyState)) {
return MACRODOWN(I(25),
D(LeftAlt), T(F2), U(LeftAlt), I(25), T(G), T(N), T(O), T(M), T(E), T(Minus), T(T), T(E), T(R), T(M), T(I), T(N), T(A), T(L), I(200), T(Enter), I(200), T(F), T(O), T(R), T(T), T(U), T(N), T(E), I(25), T(Spacebar), T(Pipe), T(Spacebar), T(C), T(O), T(W), T(S), T(A), T(Y), I(25), T(Spacebar), T(Pipe), T(Spacebar), T(L), T(O), T(L), T(C), T(A), T(T), T(Enter));
}
;;; emacspeak-mpg123.el --- Speech enable MP3 Player
;;; $Id$
;;; $Author: tv.raman.tv $
;;; Description: Emacspeak extension to speech-enable MP3 player
;;; Keywords: Emacspeak, WWW interaction
;;{{{ LCD Archive entry:
;;; LCD Archive Entry:
;;; emacspeak| T. V. Raman |raman@cs.cornell.edu
;;; A speech interface to Emacs |