Redux is React's version of global variables?

portals through the component hierarchy

I’ve been digging into a React/Redux project at work recently. The React parts were easy to pickup, but the Redux part was a bit mysterious at first. What is this folder of exported strings called “actionTypes”? What are all these “reducers” and why do they not seem to do anything? What is mapStateToProps and mapDispatchToProps doing at the bottom of all these components? Two things helped me understand: [Read More]

Python dependency resolution

gone wrong

Today pipenv install broke on the project I was working on. It worked yesterday and the day before that, but today it failed. At first, I thought my Python or pipenv installation was broken. The project’s integration tests ran in a Docker container, so I docker run -it <image> bash’d into a container and tried pipenv install. The result was the same—“dependencies could not be resolved”. This was a surprise…how could a Dockerized application suddenly stop working? [Read More]

Spotify doesn't have a playlist importer

so I made my own

The podcast “Uhh Yeah Dude” has interesting musical intros and outros, I wanted to have all these songs in a Spotify playlist. A fan of the show had maintained such a playlist until 2016, but more recent picks were missing. What to do? Getting and transforming the data The first step was scraping the UYD website to build a list of episodes–not too difficult! The code for this is kind of boring, but it’s on GitHub if you’re interested. [Read More]

Writing Dockerfiles

Trial and error--but faster!

Why use Docker? At my last job, I developed on Windows and deployed on Linux. There were multiple production VMs running different operating systems with different versions. This made deployment annoying and tedious as certain apps would work on some machines but not others. Additionally, there was a large application that would not install on fresh machines. Docker fixes a lot of these issues. To deploy a dockerized application, just copy it to the machine and run something like docker-compose up. [Read More]

Converting scanned images into a single PDF

the government doesn't make it easy to submit forms

I had to submit a form to a government agency today and they demanded PDF format. The document had to be signed by hand, so I couldn’t just fill the form and resubmit. I had to print the form, fill it out, sign, and then re-scan each page. Now what? I’ve got a directory of images, how do I convert them to PDF? Adobe’s dark pattern Adobe Reader looks like it has a built-in tool for converting different formats to PDF. [Read More]

Takashi NYC

Yakiniku FTW

Three days in New York City and the highlight was definitely Takashi, a Japanese restaurant specializing in beef. “Our menu is beef, all beef and nothing but beef!” Meat is served raw and cut into bite-sized chunks; each table has a personal grill, so meat can be cooked to your favourite degree of doneness. The greatest advantage of this style of restaurant is that meat always tastes hot and fresh—much nicer than eating the last bite of a lukewarm steak! [Read More]

Hello world

If I make it easy enough, maybe I'll actually write?

I’ve finally had time to setup a blog. Past attempts were foiled by perfectionism, so this time I focused on making writing and publishing as painless as possible. This blog is a static site generated by Hugo, it uses the Beautiful Hugo theme. Whenever a new commit is pushed to the repo, Netlify automatically rebuilds and redeploys the site. Forestry.io serves as a nice front-end for writing new posts (changes are committed behind the scenes). [Read More]