Photo by Stephen Phillips — Hostreviews.co.uk on Unsplash

I’m working on upgrading an outdated WooCommerce site, and I was struggling to figure out which versions of PHP and Wordpress each version of WooCommerce would be compatible with.

I went through WooCommerce’s release history on GitHub, which allowed me to find the latest patch version of each minor version…


Photo by Goran Ivos on Unsplash

August 01, 2020

TL;DR

You will need FZF, git, and a linux/unix-based operating system to follow along. The same workflow is probably possible on Windows, but I don’t know how to do it.

Here is the command, I recommend setting up an alias for it:

git branch | fzf | xargs…


Photo by Matt Seymour on Unsplash

July 27, 2020

TL;DR

Use this hook:

// This hook provides a ref which is perpetually up to date but will
// not trigger any renders. This is useful for resolving circular
// references in dependency arrays.
export default function useNoRenderRef(currentValue) {
const ref = useRef(currentValue);
ref.current = currentValue; return ref…


Photo by Tekton on Unsplash

Faraday is a very powerful tool, and you can make it even more powerful.

TL;DR

Check out the repo to see the files we create in this blog post.

Welcome

Faraday is a Ruby web request library. Ruby’s standard library includes tools such as Net::HTTP to make requests, but using them can…


Photo by Sarah Kilian on Unsplash

TL;DR

Run bundle update mini_racer

The Issue I Experienced

I’ve been dealing with issues on my Mac for a while, so yesterday I decided to give in and wipe it. I upgraded to MacOS Catalina, then wiped my partition and did a fresh install.

In a few hours, I had almost everything running. Today, I…


Photo by Edvard Alexander Rølvaag on Unsplash

If you forget to specify a custom uploader, CarrierWave will generate a class for you, which inherits from CarrierWave::Uploader::Base. This can cause issues, which you might not catch at first.

Unintended Consequences

The first issue (and the one that caused me the most grief) is that CarrierWave will upload to the uploads…


Photo by Romson Preechawit on Unsplash

Axios is a great library, but unhandled promise rejections can be a problem. How do we get rid of them?

TL;DR

Use this interceptor:

axios.interceptors.response.use(
response => response,
error => {
throw error
}
)

The Backstory

I was looking at my error reports on Honeybadger today, and I came across this:


Photo by Kaleidico on Unsplash

Gatsby’s notes theme is a great way to get a “notes” section up and running quickly on a Gatsby site. It doesn’t come with a layout that includes a nice page header though, which is what we’ll be fixing over the next few minutes.

Setup

You will need Node.js installed to…


Photo by Jalen O’Neal from Pexels

A little background

In a Rails app I have been working on for a while, there is something like this in the layout:

<!DOCTYPE html>
<html lang="en">
<head>
<%= yield :react_styles if content_for?(:react_styles) %>
</head>
<body>
<%= render 'layouts/header' %>
<%= yield %>
<%= render 'layouts/footer' %>
</body>
</html>

Sometimes I notice that…


I recently needed to render a flash message elsewhere in a React app. As far as I could tell, I had three choices:

  1. Use Redux and a connected component to render the flash message.
  2. Use Context, which is easier than ever to use thanks to the awesome useContext hook.
  3. Use…

Brandon Conway

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store