Org-mode formatting improvements
org-mode is so much better with some rich formatting. It really
makes it appealing as a text format with embedded and actionable code —
whether that is as a source file for literate-programming or just some notes
with code snippets.
I've added the following to my
.emacs, based on
Org as a Word Processor:
;; org-mode formatting improvements
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(add-hook 'org-mode-hook (lambda () (whitespace-mode -1)))
(setq org-hide-emphasis-markers t)
(let* ((variable-tuple (cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
((x-list-fonts "Verdana") '(:font "Verdana"))
((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
(nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
(base-font-color (face-foreground 'default nil 'default))
(headline `(:inherit default :weight bold :foreground ,base-font-color)))
`(org-level-8 ((t (,@headline ,@variable-tuple))))
`(org-level-7 ((t (,@headline ,@variable-tuple))))
`(org-level-6 ((t (,@headline ,@variable-tuple))))
`(org-level-5 ((t (,@headline ,@variable-tuple))))
`(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1))))
`(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25))))
`(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5))))
`(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75))))
`(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline nil))))))
And then I start the .org files with the following parameters:
#+TITLE: document title
Some nice info on how to get emacs' org-mode looking nice (well, for a plain text format at least).
Eel - A little Python library for making simple Electron-like HTML/JS GUI apps
I recently updated my podcast pre-processing script to Python 3.6 & the
multiprocessing.Pool module and then a few days later realized the whole thing would be much better as a simple
The goal is to:
- reduce filesize of podcasts (192kbit/s is overkill for spoken word!)
- normalize the volume and convert to mono (easier to listen to when riding/running and it's windy)
- speed up playback (people talk too slow!)
- strip tags (so my dinky mp3 player doesn't put the podcasts into different "folders")
Getting new posts from friends on Facebook with Selenium
I made a
to create a single page containing all the new posts from my Facebook friends.
This lets me see everything that is posted without having to seek it out and
wade through the ads and other things Facebook is trying to recommend to me.
The output is currently very rough, but it'll do for now - in particular, it
just screenshots the post, rather than trying to extract the content and
See also https://sites.google.com/a/chromium.org/chromedriver/
Browser automation got a lot easier with
Easily add user-friendly command-line arguments.
Lightweight CSS grid and typography
JSON version of RSS/Atom
Lightweight Python template engine
Python, Go and Rust bot comparison
After implementing my bot in Python, I thought I'd try porting it to other languages as an opportunity to learn a bit of Go and Rust.
Both Go and Rust are statically typed and compile to a single self-contained binary, which is appealing as there is no need to maintain a virtualenv and install dependencies on the server.
The parsing code for "rain" messages is a good starting point to compare the bots. Each is using a "parser combinator" library to parse the messages.
Quick thoughts: Python & Go are both pretty sane. There's almost certainly a better way in Rust, but I found it considerably harder.
The tests are stored in different places in each version so the total line count is not comparable, and the Rust version includes "ignore case" code that is built into Python's parser combinators, and that I added into a fork of the Go parser library.