This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
prototype ledger file parser in squeak | |
Simon Michael | |
test scripts: | |
s1 := LedgerParserTests sample1 readStream | |
PositionableStream | |
2007/10/7 the fairmont sonoma mission inn & spa | |
expenses:food:dining $11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simon's taskwarrior aliases | |
######################################## | |
# general commands | |
alias t="task" | |
alias ta="task add" | |
alias td="task done" | |
alias t-="task delete" | |
alias tm="task modify" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# hledger-number - try to extract just one single machine-readable number from hledger: | |
# the grand total of `hledger balance` run with any provided arguments. | |
# Requires hledger 1.24 or newer (the December 2021 release, see https://hledger.org/download.html ) | |
# https://gist.github.com/simonmichael/feee7fc1567c5f10355f952b87bd3090 | |
VALUATION_COMMODITY="$" | |
hledger bal -0 -N -X "$VALUATION_COMMODITY" --infer-market-prices -c "$VALUATION_COMMODITY 1000" --layout=bare "$@" | awk '{print $1}' | |
# Tired of complex financial reports ? This is a silly but fun and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; whenever there's a food expense, deduct the same amount from the budget | |
= /^expenses:food$/ | |
(budget:food) -1 | |
1/1 opening balances | |
assets:checking 1000 | |
equity:opening balances | |
1/2 budget allocation ; could also do this with an automated posting on income txns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack script --compile --resolver lts-18 --verbosity=warn | |
{-# OPTIONS_GHC -Wno-missing-signatures -Wno-unused-imports #-} | |
{-# LANGUAGE RecordWildCards #-} | |
-- ski.hs - Downhill Skier Driver Space Pilot ! | |
import Control.Concurrent | |
import Control.Monad | |
-- import Data.Char | |
-- import Data.List |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; avodonosov problem, HN 2021-09-05 | |
; part of https://gist.github.com/simonmichael/3bb42cd82b4afd437305d10ad914b9ec | |
; "For example | |
; Jan 1 | |
; Received 1000 EUR for a contract | |
; The rate 1 EUR = 2 BYN | |
; Jan 2 | |
; Exchanged 300 EUR to BYN | |
; The rate 1 EUR = 2.1 BYN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; avodonosov problem, from https://news.ycombinator.com/item?id=28424432 | |
; For example | |
; Jan 1 | |
; Received 1000 EUR for a contract | |
; The rate 1 EUR = 2 BYN | |
; Jan 2 | |
; Exchanged 300 EUR to BYN | |
; The rate 1 EUR = 2.1 BYN | |
; Jan 3 | |
; Received 2000 EUR for a contract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YEAR:=$(shell date +%Y) | |
PRICES=$(YEAR).prices | |
# Fetch latest market prices, add P records to prices file. | |
MARKET_PRICES=~/src/PLAINTEXTACCOUNTING/hledger-scripts/market-prices/market-prices.py <market-prices.json | |
.PHONY: prices prices-dry | |
prices-dry: | |
@$(MARKET_PRICES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Perform any auto-commits that are due, in the proper order. | |
autocommit: \ | |
autocommit-time \ | |
autocommit-txns \ | |
autocommit-misc | |
# Auto-commit any timelog changes. | |
autocommit-time: | |
@echo `date` $@ >>$@.log | |
@( git commit -qm 'time (auto)' $(TIMEDOT) | grep -E '(^\[|file changed)' ) >>$@.log \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download recent transaction history from Paypal as JSON, | |
# and print on stdout. | |
# | |
# Requirements: a Paypal developer account, curl, jq (just for pretty-printing) | |
# | |
# brew install jq | |
# | |
# Limitations: | |
# - sees only the last 30 days of history |