Travel, Code, and Engineering

Tag: coding


React Dependency Arrays and Derived State

Dependency arrays are a very important part of React Hooks. They allow you to indicate what your effects, callbacks, and memos depend on so they can be recalculated only when necessary. For...


Basic HTML Accessibility Checklist

Use exactly one <h1> tag. Use <h2> tags for other major headings. For headings that support content under your <h2> tags, use <h3> tags. For headings that support content under your <h3> tags, use...


Lazy Loading Images with ES5

Browsers typically load all of the images on the page as soon as possible. This is called eager loading. Sometimes, it's best if we wait to load images until we need them. This is called lazy...


How to Run Vue in a Rails App

I recently saw an amazing way to integrate Vue into a Rails project, and I wanted to share it here! It's a super easy method that makes it dead-simple to pass data from Rails views into Vue...


Formatting Inputs with Cleave.js in a Vue/Typescript/Rails Project

Cleave.js is a super cool JavaScript library that lets you force the formatting of an input. It works for credit card numbers, dates, and several other kinds of formatted text. If you haven't heard...