Skip to content

Instantly share code, notes, and snippets.

@afh
afh / Vagrantfile
Created February 2, 2014 09:09
A vagrant setup to compile and test ledger on various operating systems
# -*- mode: ruby -*-
# vi: set ft=ruby :
show_gui = false
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Ubuntu Saucy Salamander 13.10
#!/usr/bin/env python
import json
import ledger
total = ledger.Balance()
journal = ledger.read_journal('test/input/demo.ledger')
for post in journal.query(''):
total += post.amount
print post.account, post.amount
% python python/demo.py
Welcome to the Ledger.Python demo!
Demo completed successfully.
*** glibc detected *** python: double free or corruption (!prev): 0x0000000002360cd0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x76d76)[0x7f7c56bc4d76]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f7c56bc9aac]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev+0x9e)[0x7f7c5490dd0e]
/lib/x86_64-linux-gnu/libc.so.6(+0x36df2)[0x7f7c56b84df2]
@afh
afh / ushare_1.1a.patch
Created July 21, 2013 07:33
Patch for ushare 1.1a to compile with libupnp 1.6.18
diff --git a/src/.ushare.c.swp b/src/.ushare.c.swp
index 2936c41..e88f39b 100644
Binary files a/src/.ushare.c.swp and b/src/.ushare.c.swp differ
diff --git a/src/ushare.c b/src/ushare.c
index 717e862..8e51bf7 100644
--- a/src/ushare.c
+++ b/src/ushare.c
@@ -188,7 +188,7 @@ handle_action_request (struct Upnp_Action_Request *request)
if (strcmp (request->DevUDN + 5, ut->udn))
return;
@afh
afh / cursor_display.patch
Created September 13, 2012 11:24
urlview patches
diff --git a/urlview.c b/urlview.c
index f23d47f..b0fc63f 100644
--- a/urlview.c
+++ b/urlview.c
@@ -369,7 +369,7 @@ into a line of its own in your \n\
cbreak ();
noecho ();
#ifdef HAVE_CURS_SET
- curs_set (1);
+ curs_set (0);
@afh
afh / ledger_floor_amount.patch
Created October 11, 2011 20:56
ledger floor() test
% cat <<EOF | ledger -f - --amount='(floor(amount()))' reg
D ¤ 0,000.00
01/01 foobar
Account ¤ 12.84
Other
EOF
@afh
afh / utf8_characters.patch
Created July 2, 2011 14:30
mutt 1.5.21 patches
diff --git a/menu.c b/menu.c
index ff830f3..e14caf7 100644
--- a/menu.c
+++ b/menu.c
@@ -112,10 +112,20 @@ static void print_enriched_string (int attr, unsigned char *s, int do_color)
addch (' ');
break;
case M_TREE_RARROW:
- addch ('>');
+ if (option (OPTASCIICHARS))
@afh
afh / german_taxes.ledger
Created March 6, 2011 07:52
Sample ledger expenses file
--date-format %d.%m.%Y
--decimal-comma
--basis
D € 0.000,00
D 0,00%
;= expr account =~ /^Einnahmen:/
= /^Einnahmen:/
(Einnahmen:Netto) (has_tag("Steuersatz") ? (-floor(total / ((tag("Steuersatz")*0,01)+1%))) : 0)
(Passiva:USt:Ein) (has_tag("Steuersatz") ? (floor(amount / ((tag("Steuersatz")*0,01)+1%)) * (tag("Steuersatz")*0,01)) : 0)
@afh
afh / ledger_time_colon.patch
Created March 5, 2011 22:48
Patches for ledger 3
commit 36f87f49d86e931bb99a226cd47721219ccd6301
Author: Alexis Hildebrandt <[email protected]>
Date: Mon Sep 6 15:01:09 2010 +0200
Add --time-colon option
The --time-colon option will display the value for a seconds
based commodity as real hours and minutes.
For example 8100 seconds by default will be displayed as 2.25
% npm install fab
npm info it worked if it ends with ok
npm info using [email protected]
npm WARN not supported on [email protected] fab
npm WARN fab supported engines: undefined
npm WARN not supported on [email protected] fab
npm WARN fab supported engines: undefined
npm ERR! Error: [email protected] not compatible with your version of node
npm ERR! Requires: node@
npm ERR! You have: [email protected]