Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Mackdanz erikmack

  • Austin, Texas, USA
View GitHub Profile
@erikmack
erikmack / gist:7522440
Created Nov 18, 2013
Disco map job to transform ledger inputs to mapreduce-friendly flat file
View gist:7522440
"""
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
View 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 Dec 21, 2015
A macro for LibreOffice base for importing a music database from a spreadsheet (which is wrapped as a database)
View Importer.vbs
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")