Programming

The End of an Era: Migrating from WordPress to Gatsby

This post was featured on the official Gatsby blog ! On September 24th, 2015, I made the first post on this blog, which was a custom self…

Using Content Editable Elements in JavaScript (React)

Any element can be made editable with the addition of the attribute. This attribute is used all over the web, such as in Google Sheets. I…

Understanding Bits, Bytes, Bases, and Writing a Hex Dump in JavaScript (Node)

I was recently tasked with creating a simple command line program that would take an input of a file of unknown contents and print a hex…

Build a CRUD App in React with Hooks

In the latest release of React, a new concept was introduced - Hooks . Hooks are being added to React as an alternative to classes. If you…

Promise.all with Async/Await

Let's say I have an API call that returns all the users from a database and takes some amount of time to complete. Now there's another call…

Getting Started with React - An Overview and Walkthrough

I've been hearing about React since I first started learning JavaScript, but I'll admit I took one look at it and it scared me. I saw what…

How to Promisify an Ajax Call

Let's say you have an AJAX call, and some other function that depends on the AJAX call loading before it runs. Here's the AJAX function. And…

The Simplest PHP Router

I wanted to create the absolute most basic routing code in PHP, so here it is. We will direct ALL traffic to and route to the new files…

Rewrite Query String to Path with htaccess

Let's say I have this URL: And I want this URL: I can do so with the following : I can even still GET the URL query. Alternatively, you…

Overview of SQL Commands and PDO Operations

Structured Query Language, or SQL , is a widely used language the allows users to query and manage data in a database. Databases such as…

How to Upload Files to a Server with Plain JavaScript and PHP

Writing the code to upload images to a server from scratch seems like a very daunting task. I'm going to make a very simple upload form to…

Create a Simple CRUD Database App: Connecting to MySQL with PHP] (Part 2: Update, Delete)

In the first part of this tutorial series , I taught you how to connect to a MySQL database with PHP using the modern PDO method. We…

ES6 Syntax and Feature Overview

ECMAScript 2015, also known as ES6, introduced many changes to JavaScript. Here is an overview of some of the most common features and…

How to Paginate an Array in JavaScript

I wanted to take an array of URLs in JavaScript and be able to paginate to the correct one by clicking on the previous and next buttons…

Basic Refactoring: Don't Repeat Yourself

Refactoring is the process of editing code to improve efficiency and readability without changing the output. I made a little example to…

Object Oriented Pattern: JavaScript Constructor Functions, ES6 Classes, and PHP Classes

I wrote an article on Understanding Prototypes and Inheritance in JavaScript for DigitalOcean, in which I explained how to use constructor…

Unit Testing in JavaScript with Mocha

Test-driven development (TDD) is an approach to development that consists of writing tests, followed by production code, and refactoring as…

How to Use the JavaScript Fetch API to Get JSON Data

In How to Use JSON Data with PHP or JavaScript , I discussed how to use to get data from a JSON feed. The Fetch API is a newer built-in…

How to Create a Memory Game (ala Super Mario 3) with Plain JavaScript

I was presented with a coding exercise to make a memory game using any language. I decided such a task really doesn't require any libraries…

How to Use Local Storage with JavaScript

I like making tutorials where you build a small application completely from scratch with plain JavaScript. A to-do list is a common app idea…

How to Connect to an API with JavaScript

A big part of working with JavaScript is knowing how to connect to APIs. As a fledgling developer, you may have been told at some point to…

Basic Authentication for an Express Node App (htpasswd)

I was struggling to find a simple way to add username and password authentication to a Node.js app running on an Express server, like…

Real World Examples of Map, Filter and Reduce in JavaScript

I don't know about you, but it doesn't help me very much to peruse through endless examples of and to try to figure out how to use a…

How to Install and Use Node.js and npm (Mac, Windows, Linux)

In order to use almost any development tools based in JavaScript, you'll need to know how to use npm and Node.js. Gulp , Grunt , and…

Create a Simple CRUD Database App: Connecting to MySQL with PHP (Part 1: Create, Read)

In this tutorial, we're going to learn how to make the beginnings of a very simple database app, using PHP and MySQL. It will be half of a…

Smooth Scroll to ID with jQuery

Here's a quick snippet of jQuery code I use often when I need to smoothly scroll to an ID. Just change the to whatever speed (in…

How to Use jQuery, a JavaScript Library

Introduction HTML, CSS, and JavaScript are the three fundamental languages of the web. We structure our websites with HTML, style them with…

How to Use JSON Data with PHP or JavaScript

JSON is used to transmit data between a server and a browser. Here is a basic example of what might be in a string. As you can see, it's…