This file contains hidden or 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
module Jdbc : sig | |
type 'a connection | |
val connect : config:string -> [`regular] connection | |
(* execute sql statement, like "CREATE TABLE ..." *) | |
val execute : _ connection -> string -> unit | |
val query : _ connection -> string -> string list | |
(* wraps [f] in BEGIN ... END, does error handling/cleanup *) |
This file contains hidden or 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
module Jdbc : sig | |
type connection | |
val connect : config:string -> connection | |
(* execute sql statement, like "CREATE TABLE ..." *) | |
val execute : connection -> string -> unit | |
val query : connection -> string -> string list | |
(* wraps [f] in BEGIN ... END, does error handling/cleanup *) |
This file contains hidden or 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
module Asset_v1 = struct | |
type t = {serial:string option; inventory_id:string option; other_data:string} | |
let set_inventory_id asset inv_id = {asset with inventory_id = Some inv_id} | |
let needs_inventory_id asset = | |
match asset.inventory_id with | |
| None -> true | |
| Some _ -> false | |
end |
This file contains hidden or 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
# This is fine | |
$ hledger bal -f paypal.journal | |
£-100 cash | |
2 SHR shares | |
-------------------- | |
2 SHR | |
£-100 | |
# Attempt to report cost makes paypal account go blerghhh :( |
This file contains hidden or 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
$ hledger register -f transfer.journal cash | |
2019/01/01 Bought 1 share @ .. bank:cash £-100 £-100 | |
2019/02/01 Bought 1 share @ .. bank:cash £-300 £-400 | |
2019/03/01 Bought 1 share @ .. bank:cash £-300 £-700 | |
2019/03/01 Sold my shares @ .. bank:cash £600 £-100 | |
2019/03/01 Bough my shares b.. bank:cash £-600 £-700 | |
$ hledger register -f transfer.journal shares | |
2019/01/01 Bought 1 share @ .. assets:shares 1 1 |
This file contains hidden or 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 | |
( | |
echo "source,target,value"; | |
( | |
hledger -f 2018.journal is --cost -O csv -N --tree \ | |
| sed -nre 's/["£]//g; /expenses,/{s/^/income,/;p}; /expenses[^,]/{s/(.+):([^:]+),/\1,\1:\2,/;p}; /income[^,]/{s/(.+):([^:]+),/\1:\2,\1,/;p};' \ | |
| awk -vOFS=, -F, '$3>300 {print $1,$2,$3}' \ | |
| sort -rn -t, -k3 | |
) | |
) > sankey.csv |
This file contains hidden or 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
<html> | |
<body> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<div id="sankey_multiple" style="width: 1800px; height: 1200px;"></div> | |
<script type="text/javascript"> | |
var raw_data = []; |
This file contains hidden or 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<body> | |
<!-- Styles --> | |
<style> | |
#chartdiv { | |
width: 100%; | |
height: 1000px | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<body> | |
<!-- Styles --> | |
<style> | |
#container { | |
min-width: 300px; | |
max-width: 1600px; | |
height: 1000px; |
This file contains hidden or 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
2019-01-01 init | |
equity:opening balances | |
assets:bank $100 |
NewerOlder