Skip to content

Instantly share code, notes, and snippets.

@avendael
avendael / weaving.org
Created March 25, 2016 18:51 — forked from egh/weaving.org
Weaving a budget with org-mode & ledger

Weaving a budget with org-mode & ledger

ledger comes with a built in budget system, but I wanted to get an “envelope”, or “YNAB” style budget working. While this was easy to do in theory, in practice it proved more difficult. The theory is pretty simple; enevelope budgeting merely requires you to create some new accounts to keep track of each “envelope” of money. But in practice, it requires a huge amount of duplicate data-entry, because even when using ledger’s automatic transactions, because each month’s budget is mostly the same but not necessarily exactly the same.The following

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

@avendael
avendael / gist:e8c3b6023d26af4c4a904d67c6dd5ca7
Created August 31, 2016 09:00 — forked from tamoyal/gist:2ea1fcdf99c819b4e07d
Upgrade Postgres 9.3 to 9.4 on Ubuntu
# Be sure to save your config files. Optional but I do:
sudo cp /etc/postgresql/9.3/main/postgresql.conf ~
sudo cp /etc/postgresql/9.3/main/pg_hba.conf ~
# Package repo (for apt-get)
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
# Also probably optional but I like to update sources and upgrade
sudo apt-get update

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@avendael
avendael / .vimperatorrc
Last active August 22, 2018 12:48
Emacs Keybindings for Vimperator. Paste this into your `.vimperatorrc`
" Show tab numbers
set guioptions+=n
" Hide scrollbars
set guioptions-=r
" zenburn color theme
colo zenburn
" Default editor when C-i is invoked
@avendael
avendael / vimium.conf
Created October 17, 2013 17:06
Emacs keybindings for vimium. Paste this into vimium's advanced settings.
map <c-n> scrollDown
map <c-p> scrollUp
map <c-b> scrollLeft
map <c-f> scrollFullPageDown
map <c-b> scrollFullPageUp
map <c-v> scrollFullPageDown
map <a-v> scrollFullPageUp
map <c-w> copyCurrentUrl
map <a-w> copyCurrentUrl
map <c-k> copyCurrentUrl
@avendael
avendael / .emacs
Last active March 29, 2020 19:53 — forked from ef4/.emacs
Flycheck with JSCS
;; Flycheck JSCS
(flycheck-def-config-file-var flycheck-jscs javascript-jscs ".jscs.json"
:safe #'stringp)
(flycheck-define-checker javascript-jscs
"A JavaScript code style checker.
See URL `https://github.com/mdevils/node-jscs'."
:command ("jscs" "--reporter" "checkstyle"
(config-file "--config" flycheck-jscs)
source)
:error-parser flycheck-parse-checkstyle