Aaron Presley

My Favorite BCP-47 Validator

I know it’s a common problem: You’ve got what you think is a valid BCP-47 tag but you’re just. not. sure. If this is you, then you should visit my favorite BCP-47 validator by Christoph Schneegans. Finally, all of your BCP-47 related woes are washed away.

Understanding Zustand Middleware

I’ve been diving head-first into the zustand, which is a great library for managing global state in a React application. Their documentation have examples of middleware, but I was having a really hard time wrapping my head around what it was actually doing. I wanted two things out of my setup. I want: To have […]

Installing Python 2 via Homebrew Despite Deprecation

I recently borked my Python 2 installation on Mac OS Mojave. I couldn’t reinstall because brew removed python@2. Or did they?! I found this post that allows you to reinstall like so: After running that command I was able to reinstall python@2 via Homebrew.

Safari support for Intl.NumberFormat:formatToParts()

The fantastic Can I Use website has some great information on which browsers and versions support Intl.NumbeFormat:formatToParts(), however their data around Safari largely says “Support Unknown.” I needed to know specifics, so I did my own test.

Cocoapods Not Finding Modules

I let an XCode project sit unchanged for a while, and when I got back to it I was getting the following error…

Multiple Node Versions With Full ICU

I have a few different projects that all rely on a different version of node. In a perfect world, I’d be able to use the Node Version Manager. However, currently the nvm command breaks when passing the –with-intl=full-icu argument (see GitHub Issue here). What I have to do instead, is build multiple versions of node from source, and manually switch. […]

Mocking the Javascript Intl Object with Jest

I wrote a method to check whether or not the given environment (the browser or the node environment) has native Intl support. There’s a bit of a trick to this because there’s three possible states: Intl is not supported Intl is supported, but was only installed with system-icu (the default for node) Intl is supported, and was installed with full-icu support Here’s the method, […]

Determine if on iPhone X in React Native

With the release of the iPhone X, I’ve found myself needing to have special conditions in a few of my React Native styles. Below is what I’m using to do that check. That’s it! Easy as that.

Simple React Project Boilerplate

A lot of the current React Boilerplate projects feel so bloated to me, with a ton of extras that I don’t need. I’ve created this simple React Boilerplate that has the absolutely bare minimum that I need: webpack, stylus, and karma. No other bells or whistles. Enjoy! View Code

My Sourdough Recipe

A few years ago I was watching a documentary called Cooked. One episode was about bread; sourdough, specifically. I became utterly fascinated by the fact that sourdough has only 3 ingredients: water, flour, and salt. The below post is my on-going recipe that I keep updated as I learn more about sourdough and improve my […]

Disable Screen Sleep on Raspberry Pi

There are many different links recommending you update many different config files to disable the screen from sleeping on a Raspberry Pi, but this is the simplest solution I’ve come across: Now open the app Click Settings, then at the top choose Disable Screen Sleep from the dropdown. Now you’re done!

Including External Template Files in a Backbone App Without a Server

I have a simple Backbone app that is being compiled down using gulp and browserify. I wanted to be able to include my template file with a simple node require() method, but node doesn’t like importing anything but JS files. If I tried pulling in the template HTML with jQuery’s $.get() method, as is often recommended, I was getting a CORS error […]

Resize UIImage Largest Side in Swift

I’m knee deep in Swift these days, and am working a lot with the UIImage object. I couldn’t find a quick extension method that allowed me to resize an image based on the largest side, so I wrote one: You can use it like so: Good luck!

Search Query in URL Breaking WordPress Template

While creating a custom WordPress template, my site would crash when adding the search query string in the url. The url website.com/ worked fine, but once it became wordpress.com/?s=search+string it crashed without any kind of obvious errors. The problem was happening because I never specified the Post Page from within the Settings > Reading section of the Admin site. Once I did this […]

High Resolution Android Device Template

I’ve had a hell of a time finding a high resolution Android device on a blank background. Most of them have annoying glares or a dumb shadow that’s hard to cut around. Fear not, dear Googler – you can use mine. I also have an iOS one that I’ll upload when I get around to […]