Skip Navigation

Unknown named parameter $routes in RequestResponseArgs.php

After upgrading to PHP 8 on a server where I was running a Slimframework V3 application I started receiving this mysterious error.

Handle dynamic file uploads when testing a rails controller method

The premise is this: You’re testing a rails controller method that takes a CSV file upload. How do you make a CSV (or whatever file you want) that contains IDs that are unique on each test run?

Terminal Quick Tip - Validate XML Against XSD

If you have some XML in a file and you also have the corresponding XSD in a file, here’s how you validate the XML matches the XSD.

Terminal Quick Tip - Burn Subtitles into a video stream with ffmpeg

Say you’ve got a video file with subtitles in it. But streaming said video doesn’t let you display the subtitles. Burning the subtitles into the video stream of the file will fix this.

Run composer install from code

If you’ve written any PHP in the last 10 years, you’ve more than likely used Composer. It’s PHP’s de facto dependency manager. And sure, you could take the easy route and just run the shell command, but where’s the fun in that? It’s way cooler to actually “drive” Composer from your PHP code.

Validate a STUN binding request

In WebRTC passing the ice-ufrag and ice-pwd attributes to the client in an SDP answer will result in the client sending those values back as part of the STUN binding request.

Installing Tensorflow for Go in OSX

The documentation made this sound easy. Well, as with many things, it wasn’t.

A simple systemd keep-alive script

After spending a few hours trying to get systemd to just keep a simple binary running if it halts, here’s what I’ve learned.

Multi-line example output for godoc

Adding examples to godoc is pretty trivial but no one really talks about how multi-line output works. It’s also trivial but I thought I’d give an example.

Terminal Quick Tip - Include options when debugging with lldb

Took me a bit of googling to figure this out. I needed to include some options to a command I was debugging. To do that with lldb it’s a little unintuitive but you do this:

Setting up the pass password manager

After years of having to remember several passwords and decide which I would use when signing up for a new account. I’ve finally decided to make the switch to password manager. From now on I’ll be using pass. Let’s talk about how I set it up. (WARNING lot’s of terminal commands ahead)

Feature flags or how to put the same eggs in the same baskets

Feature flagging lets you develop new features in your application without making it visible to users until you’re ready. Feature flags are also useful in A/B testing where you want to limit the users you show a new feature to in order to bug test or gather information on how a particular feature will be recieved. I made a Go package to make it super easy to flag features in your go code, but let’s talk about how it works.

Default types for constants in Go

It was recently brought to my attention that I had an error in a previous post. The error centered around setting a constant value of 5 to an interface. Here’s what I was doing.

Namespacing functions in a PHP extension

Recently I was making a PHP extension for work and I was adding functionality to an extension that already existed. So much functionality in fact, I ended up renaming the extension. This caused a bit of a problem come launch time. I couldn’t just include my extension next to the existing extension. They had methods that shared the same name. I needed a namespace.

Get AndroidPay working with multiple OpenSSL versions

In a previous post we went over how to use the OpenSSL API in C to decrypt AndroidPay data. There was something I didn’t realize in my implementation. I was using version 1.1.0 over the OpenSSL API and there are a lot of folks still running versions earlier than that.

Adding new SCSS files to this Jekyll blog

Next time you need to add a new scss file to this blog don’t forget to add it to css/main.scss. That’s where all the sass import statements live and that should force the new scss file to get compiled along with all the other sass files.

OpenSSL and AndroidPay

This is my first deep dive into OpenSSL and boy oh boy is it complicated and not well documented. Unfortunately that means I can’t explain a ton of the reasoning behind the decisions I made in my code. It’s mostly like that because that’s what I found that works.

Added better option handling and project path determination.

Using the OptionParser library I was able to add better option handling. I don’t really like that you have to specify a flag infront of each option but I guess that is kind of a standard. This gave me the ability to add a new option that lets you specify where the blog post file should be written to. That means you don’t have to manually move the file into your Jekyll posts folder.

Jekyll Blog Post Commit Hook

I’m wrapping up work on a post commit hook that will create a Jekyll markdown file based off a git commit message. I’m not really sure if there is much utility in this app but it was a fun way to dive back into ruby code. You can find all the code here

Makefile naming is important/annoying

I just spent the better part of an hour trying to figure out why my makefile wasn’t working.

Letsencrypt and Dreamhost

There’s a great step by step guide for setting up letsencrypt certs on dreamhost here! This post will parrot most of the stuff that it says with a few highlighted points that tripped me up.

Grant Read Access to Everyone in S3

Just a quick note on how to do this as it was a little tough to find.

Get React working with Browserify and NPM without Gulp or Grunt

Why are there so many build tools in the front-end world? It seems needlessly complex. Anyway I have decided to take a simpler approach with my latest React project.

Manipulating Colors in Go

This took me a while to figure out so I figured I better document it.

Type conversion VS type assertion in go

Just learned an interesting subtlety about Go. There are two ways to “cast” values. I put cast in quotes because one isn’t really casting but it’s just the general term I always use for saying “change on type to another one”.

I'm dumb or at least naive about encryption

I just completed my first challenge in Go! It turned out better than I thought it would and I’m pretty proud of it. I had a working version or, at least I thought I did, a week or so before the end of the challenge. There were just two unit tests (provided by the challenge author) that were failing and it wasn’t clear to me why. Only after reading up on public key encryption did I realize that it’s entirely one way.

rbenv and gem binaries

Figured I’d give GitHub Pages a shot which means I need to set up Jekyll. That means I need to install Ruby, as the version install on my Mac is pretty out of date. After some quick googling it appears that managing ruby versions with RVM is out as the version manager and rbenv is in. That brought about some minor confusion.