Skip to content

Instantly share code, notes, and snippets.

@simonmichael
simonmichael / invoicing.journal
Created January 28, 2016 18:23
invoicing entries
; accrual basis accounting
2016/2/1 * (201602ab) ab client invoice
revenues:business:consulting:ab $-1000
assets:business:accounts receivable:ab $1000
; or,
; cash basis accounting doesn't include invoices, but use an unbalanced posting to track it anyway
2016/2/1 * (201602ab) ab client invoice
(assets:business:accounts receivable:ab) $1000
@alphapapa
alphapapa / org-insert-structure-template-or-enclose-region.el
Last active May 11, 2016 20:25
Enclose a region in an org-mode block (e.g. #+BEGIN_SRC), or insert a structure template with completion
(defun org-read-structure-template ()
"Read org-mode structure template with completion. Returns template string."
(let* ((templates (map 'list 'second org-structure-template-alist))
(prefixes (map 'list (lambda (tp)
;; Get template and pre-whitespace prefix for completion
(reverse (s-match (rx (group
(1+ (not (any "\n" space))))
(1+ anything))
tp)))
templates))