Earlier this year, I wrote a tool to help me gather various assigned issues from GitLab and GitHub. Recently, we missed a dentist appointement and I decided to include the ability to pull in iCalendar records (specifically Google Calendar). I got it done (along with some patches) and published it.
Calendars
It was actually fairly easy to do, I spent most of the time refactoring the code to make it easier. Once I got that done, I found a couple of libraries on NPM that would parse and manage iCalendar. The next thing I knew it, I had it pulling in calendar entries.
The configuration is pretty simple:
sources:
- id: household
type: icalendar
title: events / household
sort: _000
for: 1 month
url: https://calendar.google.com/path/basic.ics
The useful fields are:
type
: Tells the system to use the iCalendar mode.sort
: If provided, lets you move the events to the top or bottom. I'm using_000
to jam it up at the top of the file.for
: This is in the format of “X type” such as “3 days”, “1 year”, “2 weeks”.
When run, it generates a Markdown like:
# events / household
- Payday {2018-07-16}
Budgeting
I'll preface this with “I'm not good at money management skills”. Tracking money? I love doing that, but there are too many variables and inconsistencies that make paying bills consistently hard for me. Having a kid in day care doesn't help.
To help that, I decided to extend the iCalendar feature to include a simple budget that I can put at the bottom of my notes file. The main thing is to let me know if I'm going to expect an overdraft.
sources:
- id: budget
type: icalendar-budget
title: budget / household
sort: zzz
categories:
- title: Until Payday
dayOfMonth: [1, 16]
- title: Next Month
for: 1 month
- title: Next Quarter
for: 3 months
- title: Per Paycheck
for: 1 year
avg: 24 # semi-monthly paychecks
url: https://whichUrl
In the calendar, I have entries with titles like:
- $-170.00 Day Care
- $300.00 Payday
The system parses all of those (including repeating rules) and then combines them together into a notes section.
# budget / household
- Until Payday (in 2 days): $-222.22 = 111.11 - 333.33
- Next Month: $-2,222.22 = 1,111.11 - 3,333.33
- Next Quarter: $-22,221.22 = 11,111.11 - 3,3333.33
- Per Paycheck: $111.00 = 444.44 - 333.33
Like before, the sort
is used to jam it to the bottom.
Ideally, I'd get better at money management… but that will take a bit longer. I have a lot of bad habits to unlearn.
Development
With this release, I decided to use some automated tools for development. One of them is conventional commits. This is commit-line specification that tools can use to automatically build up a change log to give something useful for users to read.
I know not a lot of people use my libraries, but learning to be more structured about development on my open-source software projects. It will also help with working on Author Intrusion with the assumption that the project will get far bigger in the following years.
Of course, it probably won't stop the “push a version… found a bug in ten seconds, push another… then another” that I need to work on.
Overall, having a commit message format such as:
- fix(calendar): calendar dates should be exclusive of end date
Isn't too hard, but the structure means that the change log will be automatically updated as part of the release. It also means I don't have to figure out version number bumping.
I suspect I'll start doing this with novels also.
Installation
I wrote this in Typescript because I really like it as a scripting language and it has a nice ecosystem. Installation is pretty simple:
npm install --global mfgames-tasks-cli
Documentation
Yeah, I still don't have a lot of documentation, just a single file.
Metadata
Categories:
Tags: