Skip to content

Instantly share code, notes, and snippets.

@creichert
creichert / validate-json-schema-documents-with-org-mode.md
Last active November 14, 2018 06:21
Validate JSON Schema documents with Org mode
@creichert
creichert / gmail_checker.rb
Created November 1, 2018 05:09 — forked from liangzan/gmail_checker.rb
Gmail checker for Xmobar
# Gmail checker for Xmobar
#
# Install the ruby-gmail and mime gem to system
# Put the script under ~/path/to/gmail_checker.rb
# Make sure it is executable
require 'gmail'
gmail = Gmail.new('example@gmail.com', 'password')
mail_count = gmail.inbox.count(:unread)
@creichert
creichert / USAGE.md
Created October 29, 2018 08:31 — forked from mterwill/USAGE.md
Beancount importers, scripts, etc.

Note: everything here is pretty specific to my usage/accounts and not written for public use... You'll probably have to tweak a bunch of stuff.

$ bean-extract config.py ~/Downloads # the csvs should be in here
@creichert
creichert / xprop.xmonad
Created October 13, 2018 21:25
xprop dump
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_USER_TIME(CARDINAL) = 86660406
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified location: 1, 19
program specified minimum size: 1 by 1
WM_NAME(UTF8_STRING) = "Page not found · GitHub"
_NET_WM_NAME(UTF8_STRING) = "Page not found · GitHub"
XdndAware(ATOM) = BITMAP
@creichert
creichert / .gnus.el
Last active October 13, 2018 21:08
gnus multiple nnimap accounts
;; see my config for the other parts:
;;
;; https://github.com/creichert/dotfiles/blob/master/emacs/.gnus
;;
;; I typically put the below settings into a file called `gnus-private.el`,
;; and require that into my gnus to populate these settings.
;;
;; https://github.com/creichert/dotfiles/blob/master/emacs/.gnus#L61
@creichert
creichert / template.el
Created October 13, 2018 05:23 — forked from cbowdon/template.el
Macro to add string interpolation to Emacs Lisp
(defmacro template (text)
"Expand text like \"Hello <<name>>\" to (format \"Hello %s\" name)."
(let ((pattern "<<\\(.*?\\)>>"))
;; The regexp matches anything between delimiters, non-greedily
(with-temp-buffer
(save-excursion (insert text))
(let ((matches '()))
(while (re-search-forward pattern nil t)
(push (match-string 1) matches)
(replace-match "%s" t t))
@creichert
creichert / bbdb-evil-bindings.el
Created October 5, 2018 07:57
Emacs keybindings for BBDB
;;; evil-bbdb-rebellion.el --- Key-bindings for evil bbdb3 rebels
;; Copyright © 2013–2014 Albert Krewinkel
;;
;; Author: Albert Krewinkel <albert+evil@zeitkraut.de>
;; Keywords: evil bbdb rebellion
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@creichert
creichert / haskell-mode-toggle-process-type.el
Last active October 3, 2018 23:15
Toggle the haskell-process-type between Stack & Cabal in haskell-mode for Emacs
;; Toggle the haskell-mode haskell-process-type variable between
;; cabal and stack
;;
;; https://stackoverflow.com/a/27385914/3066608
(defvar haskell-process-use-ghci nil)
(defun haskell-process-toggle ()
"Toggle GHCi process between cabal and ghci"
@creichert
creichert / .brittany.yaml
Created October 2, 2018 21:22
Haskell Brittany formatter configuration
conf_layout:
lconfig_altChooser:
tag: AltChooserBoundedSearch
contents: 3
lconfig_importColumn: 50
lconfig_hangingTypeSignature: true
lconfig_alignmentLimit: 30
lconfig_indentListSpecial: true
lconfig_indentAmount: 4
lconfig_alignmentBreakOnMultiline: true
@creichert
creichert / compile-quietly-mode.el
Created October 1, 2018 00:45
Emacs compilation buffer visibility (hide on success, keep in background, show on toggle)
(defvar compilation-buffer-visible nil)
(defun toggle-compilation-visible ()
(interactive)
(setq compilation-buffer-visible (not compilation-buffer-visible))
(message "Compilation buffer %s"
(if compilation-buffer-visible "visible" "not visible")))
(defun notify-compilation-result(buffer msg)