Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Michael simonmichael

View GitHub Profile
@simonmichael
simonmichael / hledger-scripts.sh
Last active Nov 8, 2019
bash scripts for starting hledger(-ui) in various ways
View hledger-scripts.sh
# short aliases for hledger commands
alias h='hledger'
alias acc='hledger accounts'
alias act='hledger activity'
alias add='hledger add'
alias bal='hledger balance'
alias close='hledger close'
alias iadd='hledger-iadd --date-format %Y/%m/%d'
alias print='hledger print'
alias reg='hledger register'
@simonmichael
simonmichael / README.md
Last active Oct 23, 2019
Build times of hledger dependencies on a slow machine
View README.md

Build times in minutes of hledger's dependencies, running cabal and ghc 8.4.4 with a single Cortex-A53 CPU and 4G RAM, emulated on some faster machine.

From xiroux on #hledger:

sm: If you wanna take a look at the times, I just listed the files in .cabal-sandbox/lib/ with their last modification time and computed how much time passed between one file and another. The data is here: https://hastebin.com/egexogarek

@simonmichael
simonmichael / hledger-print-location.hs
Last active Oct 6, 2019
hledger script, prototyping print --location
View hledger-print-location.hs
#!/usr/bin/env stack
{- stack runghc --verbosity info
--package hledger-lib
--package hledger
--package here
--package text
-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
@simonmichael
simonmichael / a.bash
Last active Dec 4, 2019
scripts for finding available versions in nixpkgs
View a.bash
# Some nixpkgs query scripts inspired by #nixos chat.
# Goal: find the HASH that will let an install command like
# nix-env -i -f https://github.com/NixOS/nixpkgs/archive/HASH.tar.gz -A hledger hledger-web hledger-ui
# install the latest available build of the packages, on all platforms of interest.
# These scripts don't seem to quite do that but they help.
NIXARCHS="darwin linux"
HLEDGERPKGS="hledger hledger-ui hledger-web"
# show help for the following commands
View hledger.prof
This file has been truncated, but you can view the full file.
Fri Jul 26 00:40 2019 Time and Allocation Profiling Report (Final)
hledger +RTS -P -RTS bal -V -f examples/1000x1000x10.journal
total time = 1.35 secs (1347 ticks @ 1000 us, 1 processor)
total alloc = 1,482,942,296 bytes (excludes profiling overheads)
COST CENTRE MODULE SRC %time %alloc ticks bytes
@simonmichael
simonmichael / a.txt
Created May 18, 2019
nix show-config
View a.txt
11:41:36 ~$ nix show-config
allow-import-from-derivation = true
allow-unsafe-native-code-during-evaluation = false
allowed-impure-host-deps = /System/Library /bin/sh /dev /usr/lib
allowed-uris =
allowed-users = *
auto-optimise-store = false
build-hook = /nix/store/1jz25hcma179wbpi56blgajw47n5kgqd-nix-2.2.1/libexec/nix/build-remote
build-poll-interval = 5
build-users-group =
@simonmichael
simonmichael / pricing.ledger
Created May 14, 2019
Testing ledger cost/price syntax, lots, revaluation, capital gains
View pricing.ledger
; Test ledger cost/price syntax, lots, revaluation, capital gains
P 2019-01-01 ETC 11 EUR
P 2019-02-01 ETC 12 EUR
; Fluctuating cost/price
; @, @@ https://www.ledger-cli.org/3.0/doc/ledger3.html#Posting-cost
; { }, {{ }} https://www.ledger-cli.org/3.0/doc/ledger3.html#Commodity-prices
; "functionally.. no difference" https://www.ledger-cli.org/3.0/doc/ledger3.html#Prices-versus-costs
@simonmichael
simonmichael / plaid-wf-pchecking.csv.rules
Created Mar 27, 2019
hledger CSV rules for CSV downloaded from Plaid
View plaid-wf-pchecking.csv.rules
include common.rules
include plaid.rules
account1 sm:assets:bank:wf:pchecking
@simonmichael
simonmichael / a.org
Last active Mar 15, 2019
intellij-haskell 0.44 notes
View a.org

intellij-haskell 0.44 feedback

tested with IntelliJ IDEA 2018.3, mac mojave, 2013 macbook air with 8G ram, hledger repo

issues

had to remove alpha plugins repo to see beta 44

installed smoothly in a few minutes (most things probably previously installed)

continuing intermittent errors about starting stack repl taking more than 5s and haskell support not available yet

while building hoogle db ?

turned off power save mode for inspections, and for hlint installation to complete (?)

type signature on hover seemed to work intermittently, was hard to discover

I tried all of these, only the last works, shouldn’t it be just hover ? Or at least, don’t require moving off word

@simonmichael
simonmichael / a.txt
Created Mar 13, 2019
nix install log
View a.txt
~$ nix-env -f channel:nixos-unstable -iA hledger
unpacking 'https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz'...
replacing old 'hledger-1.14.1'
installing 'hledger-1.14.1'
these derivations will be built:
/nix/store/7wivsw87z43crbg9rabnrxlhrb2f74ad-blaze-builder-0.4.1.0.drv
/nix/store/yd9y6rgf5sxq2xpjh915q5nwwmdjlsyj-blaze-markup-0.8.2.2.drv
/nix/store/pxnw4hz2g7jzm3kw6pdxn50kwl3qzbjp-hledger-lib-1.14.drv
/nix/store/n6mbb0i2l46vi2m3a9kxxs829g3l32a5-blaze-html-0.9.1.1.drv
/nix/store/spymmgc5542ggx2d07bdg09a9bf5c7rb-shakespeare-2.0.20.drv