code

Jekyll-plugin-include. Jekyll vial logo CC-BY Jekyll https://github.com/jekyll/brand/

Jekyll – use includes directly from plugins

Jekyll is a popular static site generator that I’m using to develop the new Decipher SciFi site. It’s pretty sweet.

But!

Normally, Jekyll’s include tag can only search for files in the site’s single configured includes directory (and that of the theme plugin, if it using one). That means that if a plugin wants to provide you with a template/fragment via includes, the best it can do is ask you to copy it into your own repo manually. That sucks.

So I wrote jekyll-plugin-include: a gem-based Jekyll liquid tag plugin which allows includes directly from plugins’ _include directories, with optional ability to override with files present in site includes_dir (if they exist).

https://github.com/decipher-media/jekyll-plugin-include

This plugin then makes it easy to use includes that ship with a plugin directly from a plugin. And if a modified version of the file is provided in the site’s own includes directory, it can intelligently use that one instead!

And for plugin developers, this provides a way to ship and use includes without leaning on the user to manage the unmodified files themselves.

ლ(╹◡╹ლ)

Bash rclone autocomplete logo

Rclone remote path auto-completion on Linux (Google Drive)

I started playing with rclone in the interest of easily editing files from Google Drive with Vim. As it turns out, you can’t edit native Google Docs files in this manner, so that was a wash!

But a side benefit of this misadventure is this bash autocomplete script which I wrote to auto-complete remote paths for rclone with a Google Drive target. It probably works for others too, I haven’t tested them. 🙂

This implementation is in pure bash all except for the call to rclone itself to check against known remote targets. I appreciated An introduction to bash completion to get me started on the concepts, and the rest of what anyone needs is all in the bash manpage under complete.

Here in this post is the initial version I’m using. If you’re going to use it, check the current version of the file on my Github in case anything changes.

 

 

tmdb TMDB cli utility logo backdrop

Query TMDB for movie and tv info on the commandline

You know TMDB (The Movie DataBase)? It’s like IMDB, but without being awful.

tl;dr: I made a cli TMDB query tool in Ruby and here it is with documentation: https://github.com/decipher-media/tmdbget


As part of our podcast website migration from WordPress to Jekyll, I’m coding in a bunch of functionality that I’ve wanted for a while. The first one: a cli utility to fetch movie metadata into (semi-)structured data.

So here it is

https://github.com/decipher-media/tmdbget

Grab some API keys form TMDB and it’s easy-peasy to get some movie and tv metadata:

To get something like:

Check the help output for full and up-to-date functionality details, including a flag for interactive mode for when you’re less than confident that you’ll get the right answer. 🤓

 

 

gif to mp4

Convert GIF to MP4 for Instagram with FFmpeg

I made a script to account for Instagram’s idiosynchracies when converting a GIF to MP4 using FFmpeg. Here it is:

https://github.com/cspeterson/dotfiles/blob/master/.bin/instagif

And now the details…

Doing a conversion of GIF to MP4 with ffmpeg seems like it should be simple enough:

But it isn’t! This can be insufficient in a couple of ways..

Problem 1: Video too short

instagram "video too short" notification

Solution: Use a filter to loop the input enough times to meet the 3s minimum time requirement

Problem 2: Wrong color encoding

Instagram blank video preview

Given a color encoding that it doesn’t understand, Instagram just kinda poops out

Solution: By default, my ffmpeg used yuv444p, which Instagram wasn’t happy with. I haven’t done an exhaustive survey of the color encoding that Instagram will accept, but here is one: yuv420p.

In addition, the conversion requires the file’s height to be divisible by 2, so we need yet another filter:

Automation

Now since so many GIFs that I wish to post to Instagram are actually shorter than 3s, I automated everything above and here is the script. To see if I made any changes since posting this, check the version I’m currently using in my dotfiles.

Usage

To convert yup.gif to yup.mp4

To convert yup.gif into yup.insta.mp4

To create an insta.mp4 directly from a remote GIF

Happy giffing! 😀

My Puppet skeleton profile

This might come in handy for someone using Puppet with the “roles and profiles” design pattern. Having this profile sitting idly by to provide the boilerplate for a new profile has let us be lazy in a good way.

 

I made a thing: Memeseeks! (Rick & Morty memes and gifs) [UPDATED]

<edit> A couple of days after this release, the people behind Frinkiac released their own site that does the same thing as Memeseeks, but with a nicer UI. (︶︹︺)

I’m a bit sad that I completed a thing and then saw it made obsolete two days later, but at least I probably learned a few things along the way. So I’ve retired Memeseeks, though I hope to modularize all of its functionality and release the code at some point.</edit>

Just in time for the new season of Rick & Morty (as well as our own episode on the matter), we just released this thing we’ve been working on:

The Memeseeks Box

Meeseeks Christopher and Colbert

The Memeseeks Box

It’s a Rick & Morty memer and giffer (pronounced like the peanut butter ?). We’ve been saying at Decipher Scifi that we were working on a few things behind the scenes, and this was one of them. I’m glad to finally have it out there. 🙂

So meme away, and I hope you like it, and make sure you’re subscribed to the podcast for our Rick & Morty episode in a few days!

<edit from the future> here is our Rick and Morty episode!</future>

I may post some codey things about it here in the future.