Skip to content

Instantly share code, notes, and snippets.

View erikmack's full-sized avatar

Erik Mackdanz erikmack

  • Austin, Texas, USA
View GitHub Profile
@erikmack
erikmack / gist:7522440
Created November 18, 2013 04:22
Disco map job to transform ledger inputs to mapreduce-friendly flat file
"""
Transforms raw ledger input into a denormalized line-per-entry-leg flat file
disco run ledger.Ledger tag://ledger
"""
from disco.job import Job
from disco.worker.classic.func import nop_map
import io, re, uuid
datepattern = re.compile('\d\d\d\d/\d\d/\d\d')
lineno = -1
@erikmack
erikmack / knife.sh
Last active December 23, 2015 22:59 — forked from nukemberg/knife.sh
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com> and Erik Mackdanz <erikmack@gmail.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
@erikmack
erikmack / Importer.vbs
Last active December 21, 2015 16:39
A macro for LibreOffice base for importing a music database from a spreadsheet (which is wrapped as a database)
REM ***** BASIC *****
Option Explicit
Option VBASupport 1 ' Enables InStrRev()
Sub Main
' Src database is .odb wrapper around .ods Spreadsheet
DIM oSrcContext AS OBJECT
oSrcContext = createUnoService("com.sun.star.sdb.DatabaseContext")