Leatherman

Leatherman is a project to migrate scripts from my dotfiles to golang. The first candidates are scripts written in Perl or Python that have non-core deps, as those tend to be a hassle. On the other hand they seem to be the least used.

Any standalone go things I use should be migrated to this framework (for example weird AWS things that I optimize in go.)

Next Steps

  • more online docs (notes manual, eg)
  • status: import history of unproductive and make default component of status?
  • Convert mail-picture
  • add context support wherever context.TODO shows up

github.com/frioux/leatherman/pkg/configuration

var config Config
configuration.Load(&config, configuration.In{
        Environ: os.Environ(),
        Args: os.Args(), // os.Args()[1:] ?
})

type LoadFromEnviron interface {
        LoadFromEnviron([]string) error
}

type LoadFromArgs interface {
        LoadFromArgs([]string) error
}

type FieldToArg interface {
        FieldToArg([]string) string
}

type FieldToEnv interface {
        FieldToArg([]string) string
}

type SetField interface {
        SetField(string, string) error
}

type Set interface {
        Set(string) error
}

notes: mdlua

type indentAssist interface {
  parse(*string) bool
  next()  string
}
  • nested lists support
  • json header
  • sorting support
  • form entry

eventdb

The idea here is a little TSDB backed by SQLite that lets local applications (shell scripts really) do things more intelligently than "just failed" or "just succeeded." I'd make the schema very simple, something like:

CREATE TABLE events ( timestamp DEFAULT NOW(), eventname IS NOT NULL, success, extra )

The tool would have a relatively simple interface like:

$ eventdb insert -eventname marble -success true

By default timestamp is NOW() and extra is NULL.

Later on you could do something like:

$ eventdb query -eventname marble -before 'NOW() - 1h' # seems sketchy

Aside: allowing raw SQL access seems sketchy, but creating a good abstraction seems hard. Probably start with raw SQL with an eye to replace?

Branches

  • branch debug-vim add's a tool to debug vim plugins

draw

discord integration

  • Add basic tests for code discovery

ical parser