Of nothing in particular

by James Miller

PostedAugust 15th, 2015#Go

The other day, while playing around with some Alfred workflows, I had the need to store small bits of data between workflows in a key/value fashion. In the past, I've used either environment variables to do so or something like boom by Zach Holman. I don't really like defining tons of environment variables for stuff like this, so boom was a natural fit.

After creating the workflow and adding boom to it, I ran into some issues related to running Ruby via an embedded Alfred script. The way Alfred runs scripts can cause some weirdness and usually involves the user having to source their .zshrc (or .bashrc) in order to configure their terminal to work the way they expect. After doing so, I still had some issues with Ruby and being that I'm not a Ruby guy in the slightest I did what any programmer would do... over-engineer!

I decided to create a clone of boom written in Go. It doesn't help that I've been looking for Go projects to work on lately and this was simple enough to bang out in a few days.

It's called goboom. Yeah yeah, the name isn't as snappy as boom, but we can't all be perfect can we? Many of the commands are the same and, assuming you've used boom in the past, it uses your existing .boom file as its data source.

A bit of warning though... I just "finished" this and I'm still working out the kinks, not to mention adding better test coverage. That being said... make a backup of your .boom file if you choose to use goboom. I have no reason to believe any data loss is occurring, just better to be safe than sorry.


PostedJuly 31st, 2015#Go#IFTTT

The other day, I noticed that IFTTT has added a new channel called the IFTTT Maker Channel. The premise being that you can send a POST or GET request to IFTTT to trigger a recipe. This opens up IFTTT quite a lot if you want to do some really custom work without trying to shoehorn a combination of workflows into producing some desired result. A few days later I also noticed they released a Spotify Channel, something else I'd been hoping for.

For a while I'd wanted to create a dynamic playlist that grows as people recommend music from various locations around the web like r/music and r/listentothis. With the addition of those two channels, it becomes fairly easy.

That being said, I put together a small library named Go-IFTTT-Maker for posting to the IFTTT Maker Channel and threw it up on Github. All it does is provide an object that accepts the three arguments you can pass to the Maker Channel and a Send method that accepts your API key and the event you're posting to. That's it. Here's a simple code snippet.

I've already made a few applications from this library that I might throw up on Github soon. One for calling the IFTTT Maker Channel from the command line and another that transfers music recommendations to a Spotify playlist. The former is nice if you want to create some really custom recipes from your machine.

If you're at all interested in that Spotify playlist, it's also available here.

James Miller