Profile photo of Travis HornTravis Horn

Below you'll find all 204 articles I've published.

Predicting Formula 1 Race Results with Machine Learning
Formula 1 is notoriously chaotic, but most races come down to a few key fundamentals. We can use those patterns to train a machine learning model and predict how the season unfolds. ## Prerequisites This expe…
Rolling Your Own Node.js Continuous Deployment on Linux
You don't need a bloated, expensive CI/CD platform to deploy your Node.js apps. You can roll your own "push-to-deploy" pipeline directly on your VPS. This method is lightweight, strictly adheres to the principl…
Finding Things Fast on the Command Line
I manage a multi-purpose Linux server. It hosts bare Git repositories, MariaDB databases, automated ETL scripts, and web applications. When a deployment fails, a database locks up, or a disk fills up, I need to…
Modular Configuration for Clean Upgrades
This guide helps you make sure your Debian server stays in a high integrity state by following the conf.d drop-in pattern. With this method of configuring your server, you will never see a `.dpkg-dist` or `.dpk…
Svelte Client-Side Rendering for Observable Plot Done Right
Previously, I wrote about rendering Observable Plot server-side with SvelteKit. Today, I'm tackling client-side rendering. While it might seem straightforward, getting the implementation right requires a bit of…
Keep Your Main Branch Stable with GitHub Flow
I've found that having a consistent version control workflow is crucial, no matter if I'm working solo or with other contributors. Lately I've been experimenting with a style of working on code called "GitHub F…
When to Use Flexbox Over CSS Grid
Both Flexbox and CSS Grid are powerful layout tools built into modern CSS. They are often discussed as if you must pick one or the other, but in practice they complement each other well. Understanding the stren…
Building Accessibility into Web Apps
Web apps have evolved beyond static documents, often relying on complex interfaces like dropdowns and modals built entirely with generic `<div>`s and JavaScript. These widgets may be visually functional, but th…
Switching to uv for Python Management
For years, I relied on the official installer from python.org to manage my Python versions. Recently, however, I uninstalled everything to start fresh with **uv**. Here is how (and why) I made the switch. ## I…
DuckDB Storage Showdown
We all know DuckDB is fast. It feels like magic when you're working with millions of rows, even on a laptop. But we often treat data storage as an afterthought, dumping data into CSVs because they're universal,…
Materialized Views for Less Downtime
If you manage reporting databases in PostgreSQL, you've probably worked with nightly rebuilding of summary tables. This might involve a script that completely drops a summary table and recreates it from scratch…
A Hands-on Exploration of SQLite for Production
If you've worked with SQLite before, you know how versatile a database system it can be. Its simplicity and serverless architecture make it the go-to choice for many applications including mobile apps and small…
High Performance Data Visualization in the Browser with DuckDB and Parquet
With massive data, frontend visualization often means you either crush the browser with giant JSON payloads or get stuck waiting on slow API endpoints every time a user changes a filter. However, the combinatio…
Syncing Across Tabs with BroadcastChannel
Here's a scenario: You have a dashboard open in two windows. In the first, you update a record, but when you switch to the second, nothing has changed. It breaks the illusion of a cohesive application. The user…
How I Used Spark Broadcast Joins to Speed Up Cross-Border Analysis
Efficiency is the name of the game when you've got massive data volumes that include cross-border and regional aggregations like those you might find in fintech. As part of a project to simulate the data chall…
Modeling a Multi-Currency Settlement Engine
When anyone makes a purchase, whether it's online or in a brick-and-mortar store, the cardholder's bank (the issuer) and the merchant's bank (acquirer) must rely on a system that bridges their data. Every trans…
Refactoring Complex SQL to Reduce Query Time by 99%
A query that works perfectly on a small development dataset can still bring the production database to a halt as data volumes scale. You must understand the database engine to write SQL that performs efficientl…
Building an Enrollment Prediction System with Machine Learning
Schools need accurate enrollment forecasting for stability and success. Forecasting informs decisions they face annually: staffing, resource allocation, and budget planning. When projections are accurate, schoo…
Zero Downtime: Setting up a 3-Node MariaDB Cluster
Most developers are used to spinning up a single instance of their database system and calling it a day. But what happens when you need true redundancy? How do you ensure that a hardware failure doesn't wipe ou…
Managing Geographic Zones with GeoJSON and MariaDB
One of the most common yet complex challenges in application development is the "zone lookup" problem. It's used in processes like managing school district boundaries, defining exclusive sales territories for a…
Why Apache is Returning 200 OK Instead of 304 Not Modified
I recently ran into a frustrating caching issue with Apache. I requested a page where the request headers included `If-Modified-Since` and the response headers included `Last-Modified`. Since the timestamps mat…
A SQL Window Function Case Study
Imagine you need to run a report showing every student enrolled during the academic year. The catch? The report specification requires one row per student. If a student transferred schools mid-year, the databa…
From Auto-Increments to UUID v7
When picking a primary key for a table in a database, sometimes there is an obvious choice. If you're creating a table of users, and users authenticate using their email address, you probably want the email add…
Data Types: Continuous, Discrete, and Related Categories
Recognizing data types is a foundational concept in statistics and data science because the type of data you have dictates the appropriate statistical methods, visualization, and analyses to use. This a quick g…
Quick Git Fixes
Git is a powerful tool, but it can also be a source of frustration when things go wrong. I've documented the process I use to quickly fix some common issues. Keep reading to explore some common Git problems and…
Converting TSV to CSV with DuckDB
DuckDB is an incredibly versatile, in-process database. Its powerful SQL engine and ability to read various file formats make it an excellent tool for data transformation tasks right from your command line. In …
Why Open-Source Principles Aren't Always Obvious in Art
I love the free and open-source software (FOSS) community. The idea that code can be freely shared, studied, modified, and redistributed for the benefit of all is so impactful. But sometimes when I talk to othe…
Data Analysis with Azure Machine Learning: Healthcare Data Demo
Data is the lifeblood driving innovation in many industries, including healthcare. Machine learning algorithms are being used to predict patient outcomes, optimize treatment plans, and more. Azure Machine Learn…
Real-Time Delivery ETA Prediction in Python
I've been playing around with how ML techniques can be applied to logistics and e-commerce. One of the ideas I had floating around my head was to build a model that can be trained on delivery data and then used…
Cursor Rules for SvelteKit Development
Cursor, the AI-first code editor, significantly speeds up my development workflow, especially when working with modern web frameworks. However, like many AI models, its training data lags slightly behind the la…
Simple Python Dependency Management
While powerful tools like virtualenv, pipenv, conda, and Poetry exist to provide extra advantages for dependency management, I've found a simple system that works for the small projects I've been working on. T…
Setting up a Project with ESLint and Prettier
ESLint is a tool for "linting" your code. It can analyze your code and warn you of potential errors. In order for it to work, you need to configure it with specific rules. Fortunately, the ESLint team provides …
Introducing libsql Migrate
libsql Migrate is a database migration and seed management tool for libsql with configurable options, written in JavaScript and available as an npm package. It is open source and available on GitHub: [travisho…
Creating a Development Database: Syncing Production Data for Efficient Development
As you develop software, having a development database that mirrors your production data is a game-changer. It allows you to work with realistic data without the risk of modifying or corrupting the actual produ…
Monitoring your Linux Server with Prometheus
Every system administrator would be wise to keep a close eye on the health and performance of their server infrastructure. Prometheus, an open-source monitoring and alerting toolkit, empowers system administrat…
Integrating SQL Data into your Next.js App
Building dynamic applications often involves connecting to a database to store and retrieve data. Next.js provides an excellent platform for creating server-side rendered and statically generated applications. …
Comprehensive Guide: Backing Up and Recovering Data in MariaDB
Ensuring the safety and integrity of data in your database management system should be one of the highest priorities. MariaDB, a powerful and widely used open-source relational database system, provides robust …
Getting Started with MariaDB
MariaDB is a great open-source relational database management system. This article will walk you through the process of installing and configuring MariaDB, creating database users, granting appropriate privileg…
Configuring HTTPS/TLS on nginx: A Complete Guide for Securing Web Traffic
Today, online security is paramount. Configuring HTTPS/TLS/SSL on your web server is crucial to protect sensitive data and establish trust with your users. By implementing a robust certificate management system…
Firewall Configuration with nftables
Firewalls are an essential part of network security, and nftables is a powerful tool for configuring them. In this article, we'll explore how to configure nftables. We'll cover everything from enabling the serv…
Reverse Proxying with nginx
Reverse proxying with nginx is a powerful way to manage and distribute web traffic. In this comprehensive guide, we'll walk you through the installation process and configuration of nginx as a reverse proxy ser…
Rolling Your Own Continuous Deployment with Node.js, Git, PM2, and Linux
Continuous deployment involves frequently integrating code changes into a shared repository. This allows for your production app to be updated with the latest code changes in a continuous release format easily.…
SvelteKit Magic: Server-Side Rendering for Observable Plot Explained
Using a web application framework like SvelteKit opens up possibilities to bring your data visualizations to life on the server side before sending them to the client. In this guide, we'll walk through some of …
How to Manage Node.js Processes with PM2
Node.js is a popular runtime environment for building scalable and high-performance applications. However, managing Node.js processes can be challenging, especially when you have multiple processes running on t…
Serving Next.js Apps on your Linux Server
In this tutorial, we will explore the process of serving Next.js apps on a Linux server. Next.js is a powerful framework for building server-side rendered React applications. By deploying Next.js apps on a Linu…
The Simple Guide to Installing Node.js using APT and NodeSource
Installing Node.js is a crucial step for developers looking to leverage its powerful features and vast ecosystem. In this comprehensive guide, we will walk you through the process of installing Node.js using AP…
Uploading and Saving Files with SvelteKit
Recently, while working on a project, I needed to add a feature to allow users to upload a file and save it on the server. I did quite a bit of searching for a working solution. However, many of the answers I f…
Step-by-Step Guide: Setting Up a Git Repository Hosting Server
If you're looking for a reliable and secure way to host your Git repositories, setting up your own server can be a great solution. In this step-by-step guide, we will walk you through the process of creating yo…
Streamline Your Linux Experience with Automatic Updates
Staying up-to-date with software updates and security patches is important for a secure computing experience. However, manually keeping track of updates and performing system reboots can be time-consuming and p…
Unlocking the Power of Public Key Authentication in OpenSSH: A Comprehensive Guide
Public key authentication is a fundamental aspect of secure and efficient communication in the realm of server administration. In today's interconnected world, where safeguarding sensitive data is paramount, Op…
Mastering Port Forwarding in VirtualBox: Unlocking Connectivity
VirtualBox is as a powerful tool to create and manage virtual machines. Using it, you may often encounter scenarios where you need to establish communication between the host and virtual machines, and this is w…
Introducing the Knex Adapter for Auth.js
I am excited to share with you my latest open-source project, an unofficial adapter for Auth.js/NextAuth.js that allows connectivity to any database service using Knex.js. > [Auth.js](https://authjs.dev/) is a…
Exploring the Power and Beauty of Common Lisp during the #12in23 Programming Challenge
This month marks the halfway point in the yearlong challenge. This time, I ventured into the realm of Common Lisp, the renowned Lisp dialect celebrated for its expressive capabilities and rich programming herit…
12 Months, 12 Languages: My Journey with the #12in23 Challenge - Mindshifting May with Prolog
Learning new programming languages is an important aspect of a software developer's journey. It helps you expand your knowledge, learn new techniques, and approach problems in unique ways. That's why, even in t…
Analytical April: Learning Python for Data Science
Python is a powerful programming language that has become increasingly popular over the years. It's a great language for beginners and experienced programmers alike. Its vast array of libraries and frameworks m…
SurrealDB: Your Ultimate Guide to Smooth Installation and Configuration
SurrealDB is a cutting-edge, next-generation serverless database that offers powerful features such as SQL-style query language, real-time queries, and advanced security permissions for multi-tenant access. Des…
Conquering the #12in23 Challenge: Tackling Mechanical March with Rust
My excitement about this month in the [#12in23 Challenge](https://exercism.org/challenges/12in23) can be summed up in one word: [Rust](https://rust-lang.org/). Did you know Rust holds the title of the most-love…
Functional February: Exploring Elixir for Exercism's #12in23 Challenge
For the month of February 2023, I continued [Exercism's #12in23 Challenge](https://exercism.org/challenges/12in23) by trying out [the Elixir programming language](https://elixir-lang.org/). If you're not famil…
Learn a New Programming Language Every Month with Exercism's #12in23 Challenge
Starting in January of 2023, I decided to take Exercism's #12in23 Challenge. Exercism is a site for learning programming languages and exercising your skills with them. In 2023, they launched the [#12in23 Chal…
SQL Group with Most Recent Record Each
Say you have a table with student test data. ```sql SELECT t.* FROM tests t ORDER BY t.student_id, t.taken_on ``` | student_id | score | taken_on | | ---------- | ----- | --------…
Building a Telegram Bot with Netlify
Want to build a bot on a messaging platform? You can use [Netlify](https://www.netlify.com/) and their [Functions](https://www.netlify.com/platform/core/functions/) feature to get up and running quickly and eas…
Haskell Development on Windows
If you run Windows and you're interested in Haskell but not sure how to get set up, check out this guide. The process isn't too hard, but it might be a little more intimidating than other, more popular language…
Vim on Arch
In the last few articles, we installed Arch Linux, xmonad window manager, Alacritty terminal emulator, and xmobar status bar all from scratch. Throughout the series, we've been using Nano to edit the many conf…
xmobar
In the last few articles, we've installed Arch Linux, the xmonad window manager, and Alacritty terminal emulator. The system is actually pretty usable at this point. However, a very common UI element for most d…
Alacritty terminal emulator
In the last couple articles we've already installed Arch Linux and xmonad window manager. Now, I think it's time to install a new terminal emulator. In the last article, we installed **xterm** when we installe…
The xmonad Window Manager on Arch Linux
In [the last article](https://travishorn.com/installing-arch-linux/), we installed a barebones installation of Arch Linux. The base of the operating system is there now. But if you want to have a more graphical…
Installing Arch Linux
Lately I've been experimenting with more customizable distributions of Linux. My only previous experience with Linux was Ubuntu. It's a nice distribution for new users. The installation is incredibly easy to fo…
Reverse-Proxying Node.js Apps on Windows with IIS
You can run Node.js apps on Windows with the added layer of a reverse-proxy with the built-in web service manager IIS. Together with a process manager like PM2, it's a viable strategy to run apps for production…
Some ways to align the last row in a flexbox grid
Using flexbox doesn't always produce the expected alignment, especially on the last row of a grid. When you use justify-content: space-between it will place a large gap in the last row unless there are a square…
Excel Formula to Scale Data from 0 to 1
Say we have a set of data in column A. | A | | --- | | 469 | | 396 | | 600 | | 177 | | 240 | | 155 | | 204 | | 454 | | 278 | | 233 | And we want to scale the data so that the lowest value equates to 0 and t…
Using JavaScript to Work with Spreadsheets, Part 5: Parsing XLSX Files
This is the fifth article in a series where we'll be learning to use the powerful logic of a programming language like JavaScript to manipulate spreadsheet data. In this article, we'll talk about how to read a…
Using JavaScript to Work with Spreadsheets, Part 4: Making the CLI More Robust
This is the fourth article in a series where we'll be learning to use the powerful logic of a programming language like JavaScript to manipulate spreadsheet data. In this article, we'll talk about how to add a…
Using JavaScript to Work with Spreadsheets, Part 3: Accepting Arguments & Reading Files
This is the third article in a series where we'll be learning to use the powerful logic of a programming language like JavaScript to manipulate spreadsheet data. In this article, we'll talk about how to make a…
Using JavaScript to Work with Spreadsheets, Part 2: Setting up the Workspace
This is the second article in a series where we'll be learning to use the powerful logic of a programming language like JavaScript to manipulate spreadsheet data. In this article, we'll talk about how to insta…
Using JavaScript to Work with Spreadsheets, Part 1: The Shape of the Data
This is the first article in a series where we'll be learning to use the powerful logic of a programming language like JavaScript to manipulate spreadsheet data. In this article, we'll talk about how the sourc…
Building a Sparkline Dashboard
Building on the last article, I'll show you how to use the SparkLine component we built to create a "dashboard" of data points that anyone can quickly understand with sparklines. In [the previous article](http…
Build a Sparkline Vue Component
Sparklines can be used to quickly visualize data variance. They are small and intuitive to understand. We'll be using Vue and D3 to build a small [sparkline](https://en.wikipedia.org/wiki/Sparkline) component …
Visualizing Google Sheets Data in D3
If you have data in Google Sheets, you can import and visualize it using D3. ### Creating the table Maybe you already have data in Google Sheets. If so, you may skip this section. For the sake of demonstratio…
Reacting to data changes in D3 using Vue
D3 provides a powerful interface for reacting to changes in data. When hooked up to Vue, you can create data visualizations that react to your UI or even remote data sources. Follow along and we'll build a cha…
Introducing csval, an open source CSV data validator
csval is a command-line tool and a JavaScript library that can check CSV files against a set of validation rules. Some of the rules you can check for include… - CSV file is actually valid itself and can be par…
Self-contained D3 Pie Chart Function
D3 is a great data visualization library. I often find myself coding the same types of charts over and over again. I decided that it would be wise to build each basic chart type I use into a single self-contain…
Self-contained D3 Bar Chart Function
D3 is a great data visualization library. I often find myself coding the same types of charts over and over again. I decided that it would be wise to build each basic chart type I use into a single self-contain…
Combine Multiple PowerShell Commands into One
There are some sequences of commands I use over and over again. I decided to make commands that will execute these sequences together. At first, I thought an [alias](https://learn.microsoft.com/en-us/powershel…
Build & Deploy Serverless Functions in 5 Minutes
The serverless method promises to take away the hassle of managing servers so you can focus on development. But what does it take to actually get started? While this article is not sponsored by Netlify, I'll b…
Delaying forEach() Iterations
I recently ran into the problem of having to loop over an array, but with a delay between iterations. This functionality isn't built in to JavaScript and I couldn't find any libraries that provided it out-of-th…
Creating a Photo Gallery with Vue & CSS Grid
An interactive gallery of photos is the perfect use-case for Vue and the CSS Grid Layout. This article describes every step along the way to building this photo gallery app. ![A screenshot of a fully designed…
Responsive grid in 2 minutes with CSS Grid Layout
Are you trying to build a grid of elements? If so, you've probably noticed one size doesn't fit every screen size. The modern solution is a responsive grid that changes based on the size of the screen viewing i…
Need part of a string? Just use slice()
In JavaScript, there are three prototype methods for getting part of a string. Which one should you use? The answer may depend on the context of your problem, but in the interest of keeping things simple, I say…
Removing parts of shapes in SVG
Recently, I needed to remove part of a shape in SVG for a project I was working on. Using clipping paths and masks are not as intuitive as I had first hoped. I figured it out and documented the process here. T…
Semantic versioning with Git tags
Why should we put thought into version numbering? What's the best system for versioning? How can we implement it? I recently starting thinking about these questions. After doing research, I came to a decision a…
API Server with JWT Authentication
In this article, I'll go over how to create an API server that signs and verifies JSON Web Tokens for authentication. Some of the technologies this server uses include [Koa](https://koajs.com/), [JWTs](https:/…
Getting Started with Vue Single File Components
If you're just starting out with Vue and you've followed along with the official guide, it begins by detailing how to use Vue in the easiest way possible: including the library directly using the `<script>` tag…
D3 Line Chart with Forecast
In this post, we'll build a function for predicting data using linear regression and the least-squares method. Then we'll plot the forecasted data on a line chart using JavaScript and D3 — Data Driven Documents…
Creating a responsive header image
Sometimes it's best to load and display different images for different screen sizes. For example, a very large header image that works for a large desktop screen may not be necessary or even look correct on a p…
Dealing with asynchronous functions in JavaScript
Writing non-blocking, asynchronous code is a staple of Node.js development and the broader JavaScript world. JavaScript itself uses an event loop which makes writing asynchronous functions more difficult by def…
Just for fun: The LOL ID
What type of unique identifier should you use for your next data-backed project? Incremental integers? UUIDs? A URL-friendly short ID? I present: the LOL ID. ```javascript "lxxxxxxxxl".replace(/x/g, () => (Mat…
The importance of standards and standards bodies in web development
In 1990 — the early days of the web — Tim Berners-Lee created a piece of software called WorldWideWeb. It was the first web browser. It allowed people to write information that could then be read by others over…
Rapid prototyping with CSS keyword colors
When quickly creating prototypes, color may play an important role. Especially for things like data visualization. However, choosing colors can be a time consuming processes. In the case of prototyping, one may…
Shorten functions with ES6 features
ES6 implements features which use a more expressive closure syntax and more intuitive expression interpolation that can shorten your functions. Consider this function. ```javascript function sayHello(name) { …
3 ways a front-end developer can reduce page load
Loading times are a big pain for users. You have to tackle the problem from many angles. Some tweaks can be made on the back-end; with hardware bottlenecks and GZIP compression playing big roles. There are how…
Introducing the Diabetes Food Database
I created a free progressive web app which helps people with diabetes find information on the food they eat. > Update: The web app is no longer available, but you can still read on to > discover how it was ori…
What if a project uses tabs and you use spaces?
There are two types of developers. Those who use tabs to indent code and those who use spaces. It seems like a minor difference that shouldn't matter at all. But start this conversation with any group of develo…
Using the Options Object JS Pattern
An "options object" is a programming pattern that you can use to pass any number of named arguments to a function. Rather than using an ordered list of arguments, you simply pass one argument, which is an objec…
Setting up ESLint on VS Code with JavaScript Standard Style
JavaScript Standard Style is an attempt to standardize the way developers write JavaScript. Following this style guide will ensure your code has a level of clarity that makes reading and maintaining your code e…
My first competition as a hackathon noob
I recently competed in Node Knockout. > A 48-hour hackathon featuring [Node.js](https://nodejs.org/en). It's an > online, virtual competition with contestants worldwide. I can't quite remember where I heard a…
Day-to-day source control
Developers need source control. As a project gets bigger, it becomes hard to maintain without a system for managing code changes. Source control management systems — like [Git](https://git-scm.com/) — are very…
Setting up Prettier on VS Code
Prettier is an opinionated code formatter. It is fundamentally different than a style linter. Prettier doesn't care how you write your JavaScript. It simply comes in after you're done and formats all your code …
My Title Boxing Club schedule scraper
I built a tool to scrape the latest schedule from Title's website and output CSV data ready for import into Google Calendar. Title Boxing Club is a fitness gym that holds trainer-led classes daily. On their we…
Netlify Lambda Functions from Scratch
When learning a new concept, I always like to try building things from as low a level as I can. Rather than using a pre-built template, I want to see if I can wire everything up using a only few bare-bones libr…
Adding Bootstrap to a Vue CLI Project
The Vue CLI is an awesome tool to kick-start your Vue projects. But by default — and rightly so — it comes with very little in the way of styling. Follow along and I'll show you how to add Bootstrap so you can …
Responsive Scrim
Overlaying text on an image, or even a solid color, can get tricky. The text can very easily become too difficult to read. Scrim is one technique used for applying text over any color or image. ## The problem,…
Some design tweaks for Project Gutenberg
I enjoy reading books from Project Gutenberg. If you haven't heard of this project, it's a repository containing tens of thousands of free eBooks. You can find some of the world's greatest literature on their s…
I started naming all my anonymous functions (and you should, too)
JavaScript allows anonymous functions. Wikibooks describes them as… > …a function that was declared without any named identifier to refer to it. As > such, an anonymous function is usually not accessible after…
Buttons with custom shapes
Did you know you can create hyperlinks on SVG shapes? The `<a>` tag is valid inside `<svg>`. Most links (`<a>`) elements on the web are rectangles. ```html <a href="#">I'm a link.</a> ``` ![The text "I'm a l…
Google-style gauge charts using D3
Google provides a free charting library to display live charts on your site. It works pretty well but has some disadvantages: - The library must be loaded from Google's servers - Loading can be slow at times -…
Visualizing SVG Elements
Scalable Vector Graphics, or SVG, is a language for creating vector graphics. Vector graphics are awesome because they have excellent browser support and can be used to show illustrations and data visualization…
Sunrise Block Clock
I came up with the idea for a digital clock where the background was divided into 1,440 blocks — one for each minute of the day. Initially all blocks are shaded, but as each minute passes, the block representin…
Data by Geographic Distance
Say you have a database that contains information about clients your company serves. Among the client information are two pieces of data: geographical location and number of orders. You could extend this examp…
Interactive Maps with Vue & Leaflet
This post will cover the basics of interactive maps using Vue.js and Leaflet. If you've never heard of Vue, it's a popular front-end framework for building user interfaces. If you've never heard of Leaflet, it…
Setting up ESLint on VS Code with Airbnb JavaScript Style Guide
Airbnb maintains a very popular JavaScript Style Guide that is used by many JavaScript developers worldwide. Following this style guide will ensure your code has a level of clarity that makes reading and mainta…
My Codevember 2017 Pens
Codevember is an annual pen-a-day challenge. Participants visit the Codevember site each day, look at the inspiration for the day, and create a "pen" on Codepen using that inspiration. I participated this year…
The <table>
Tables might just be the most versatile format for displaying structured data. They appear everywhere to display information in a way us humans can quickly understand. Tables in HTML are marked up using the fo…
Updating Dynamic Data in D3
D3 uses an enter, update, exit pattern for handling dynamic data. Developers new to D3 might first encounter it when needing to manipulate more than one element (e.g. a series of `<rect>`s or `<circle>`s). Sta…
Vue + SVG
I love using D3.js for data visualization. However, there are some smaller projects where I've found manipulating SVG elements in Vue.js is sufficient. This approach is very appealing when you're already using …
Create Animated Icons using CSS
One cool feature of CSS is the transition rules you can apply to elements. You can use transitions to animate icons when they are clicked. A burger menu icon is a common design element on the web. This icon co…
Customizing Bootstrap Styles, Step-by-Step
Bootstrap is an awesome toolkit for front-end development. One of it's biggest advantages is that when you start to build your app, instead of starting from scratch, you can start building your app using Bootst…
Update from Another Table in SQL
I'm always finding myself in the same position: I have a table with two or more columns. I need to fill in one of those columns based on another one. However, the data I need is in a separate table. Here is an…
Create a Bouncing Message Notification Icon from Scratch with SVG & CSS
Let's see how easy it is to create a simple icon with SVG and animate it with CSS. The end result will look similar to this. Just imagine it bouncing up and down. ![Stationary image of a notification icon. Whi…
Responsive Buttons with Bootstrap
Using Bootstrap, I found myself wanting to have a button that will change widths depending on the screen size. Here is what I believe to be the best solution. It works with Bootstrap 4 right out of the box. Th…
Redux by example: Combined reducer with action creators
After reading and following along with the official Redux Read Me, I had many code samples saved to Codepen. This is my attempt to condense the most important concepts I learned, along with code examples into a…
Vue Online Store with Shopping Cart
Today we'll be building the basic framework for an online store and shopping cart with Vue.js single file components. ### Setup Before you begin, you will need [Node.js](https://nodejs.org/en/) installed. Nod…
Building json2table: Turn JSON into an HTML table
Today we'll build a dependency-free function that accepts… - Data in a JSON array - An optional space-separated list of classes …then transforms the data and returns a string of HTML representing a table elem…
Recreate the Google Loading Animation using only CSS
Google uses many different loading animations. The one we'll be recreating today has four differently colored balls, bouncing in a horizontal line. First we'll need some `<div>`s to manipulate. ```html <div c…
Stacked Bar Chart with Chart.js
This is a simple example of using Chart.js to create a stacked bar chart (sometimes called a stacked column chart). > Chart.js provides simple yet flexible JavaScript charting for designers & developers. It a…
Add LocalStorage to your Vue app in 2 lines of code
Say you already have your Vue app up and running, but you want your users to be able to save their state between usage sessions. How can you achieve this? If using LocalStorage is an option, it is very easy! #…
Creating a system tray icon to display the current Ether-USD market price
I thought a fun side project would be creating a desktop app that runs in the system tray and displays the market price of ETH in USD when you hover over it. Follow along and I'll show you how I built this simp…
Getting Browser Width & Height
A while back, a user on Stack Overflow asked the question "How to get browser width using JavaScript code?" The accepted answer (from 2009) recommends using the `width()` method in jQuery, citing this article f…
Ordered Lists in HTML
One of my highest rated answers on Stack Overflow is in response to a very simple question. > Is it possible to specify a starting number for an ordered list? In this post, I'll do a deep dive into the standa…
Using Computed Getters & Setters in Vue
Vue.js supports getters and setters on computed variables. You can use these variables to provide 2-way data binding. Let's use this feature to write an app that converts a set of checkboxes (true/false selecte…
Form Validation with Vue.js
Client-side validation using JavaScript enhances user experience by giving feedback immediately to the user rather than having them complete a round-trip through the server. Before we begin, you must understan…
Passing Data Between Classes/Components in React
One of the first patterns that you will need to learn when working with React is passing data between classes. Let's look at how to do this by creating a simple "app" provides a text input and then displays the…
Composition + Immutability in JavaScript
RJ Zaworski wrote an excellent introduction to Composition in JavaScript. I highly recommend it and it is a prerequisite to this article. I'm taking RJ's article and extending it to use immutability. On top of…
Populate <select> via AJAX
I recently ran into a situation where I had a `<select>` input and I wanted to populate it with a list of options from an API endpoint. In fact, I had multiple `<select>`s on the same page and I wanted to do it…
Access the browser's query string as a JavaScript Object
I recently read a post on David Walsh's blog called Get Query String Parameters with JavaScript. He provides a simple function for getting parts of the URL query string. However, he mentions: > I'd love a more…
Why it is better to serve site assets from multiple domains
Traditionally, and with most modern web servers, it has been better to serve site assets from multiple domains, rather than from a single domain. But why is this the case? The answer is speed. This speed comes…
Integrating multiple stylesheets in a single site
The question is: "If you have 5 different stylesheets, how would you best integrate them into a site?" The answer will depend on how your site is laid out and how users use your site. Every linked stylesheet i…
The Basics of Modular JavaScript & npm Packages
One of the biggest jumps a new JavaScript developer can make is going from writing collections of spaghetti code to using a system of loosely coupled modules, where each module has a particular task and can be …
Building a Random-Within-Range Function
Let's walk through building a function in JavaScript that returns a random number within a given range. JavaScript provides an object called `Math` that contains objects and methods for working with mathematic…
JavaScript Slideshow with No Dependencies
There's no shortage of slideshow plugins and frameworks for JavaScript. But how simple would it be to code one using plain old JavaScript? Warning: This slideshow will be pretty bare-bones. I didn't spend any t…
Increase Concurrent Connections in Windows Server 2000
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
SQL Query for Counting Records per Day
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
SQL as Understood by SQLite
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Simple jQuery
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
JavaScript Reference: Objects
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
JavaScript Reference: Closures
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
"Shrinkwrapped" List with CSS
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Link Directly to Google's "I'm Feeling Lucky" Feature
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
xcopy Options for Backup
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Windows XP Malware Cleanup
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Unix Commands
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Troubleshoot Internet Connection Problems
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Windows XP Startup and Shutdown Notifications
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Removing Conficker/Downadup
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Make Single Spacing Default in Word 2007+
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Import Contacts into Outlook from an Email
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Greater Than & Less Than Formatting in Excel
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Enable File and Printer Sharing Across Subnets in Windows Server 2003
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Using MSSQL with Classic ASP
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
Boilerplate Classic ASP Page
This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my ow…
A small function to convert an array of ID strings into a dictionary of jQuery objects
I often use jQuery to modify the DOM. The simplest way to do this is to use jQuery's query selector and a modifier function. ```javascript $("#intro").css("background-color", "green"); ``` If you have to perf…
Should you name variables based on their content or their purpose?
Before I start, I should say that this is a question without a definite answer. You will not find one in this article. Instead, I'll explore the subject and pose some questions at the end. Imagine a scenario w…
Getting Started with R on Windows
This tutorial is meant to be a bare-minimum installation guide and mini "getting started" guide. If you will be using R extensively, there are other tools that you will probably want to install and use. I'll go…
Building upon JavaScript with TypeScript
TypeScript is just a superset of JavaScript. You can run classic JavaScript through the TypeScript compiler and it will come out just fine, just the way it already was. However, once you start using the feature…
Zero to TypeScript Developer using Visual Studio Code on Ubuntu
Let's start from scratch, or rather — with a running installation of Ubuntu. From there, I'll walk you through installing and setting up an environment to code with TypeScript. In a future post, I'll walk thoug…
Creating a front-end for working with your API proxy
This is part two of a two-part series on working with a third-party API with private keys. If you haven't already, you may want to read part one. Now that the proxy is running, we can create a front-end form f…
Creating a Node.js proxy to secure your third-party API key
Today I am creating a mailing list signup form that will post data to a sheet on Fieldbook. We could give our form the API key but this is a terrible idea as it gives anyone who visits the form the key to do an…
My preferred development environment
Every developer has their own preferred environment; from the hardware, to the operating system, IDE, and other tools. I'll go into detail about what I like to use. I can't live without at least two monitors o…
What considerations do I make while building a web application or site?
I will break this problem down into six categories: - User interface - Security - Performance - Search engine optimization (SEO) - Maintainability - Technology ### User interface I like to rely on third-part…
A recent technical challenge I experienced with PC hardware
I recently upgraded my home PC. I was trying to get new components to work together. I had a new motherboard and a new processor that were supposed to work together, but weren't. I researched on the internet a…
What excites me about coding?
I'm sure many developers will agree with my answer. I like that I can take a problem and come up with a solution just by giving instructions to the computer. With any problem, there can be an infinite amount …
What did I learn this week? Knex.js & Bookshelf.js
A while back, I found an awesome open-source project by h5bp called Front-end Job Interview Questions. The project is… > A list of helpful front-end related questions you can use to interview > potential candi…
Fireflies with canvas and requestAnimationFrame
I've added a new public pen to my CodePen account called [Fireflies](https://codepen.io/travishorn/pen/OVzeqg/). It's a simulation of fireflies (lighting bugs) floating and lighting up in the night. This animat…
npm Package Store
I recently read on [The Changelog](https://changelog.com/) a short post about a tool called **Go Package Store**. > An app that displays updates for the Go packages in your GOPATH. It has a simple interface t…
fake-identity
This is the latest project I've open-sourced. It is a JavaScript module that you can use in the browser or Node to generate fake identity objects. The source for all the personal data comes from publicly availa…
Using Grunt with Travis-CI
If you are using Grunt to run your tests and Travis-CI for your continuous integration, you will need to command Travis-CI to install the grunt-cli before running your test script(s). grunt-cli is meant to be a…
Using CSS Media Queries for Responsive Design
Responsive design means that your site is designed for all screen sizes. Imagine a site where all content is wrapped by a fixed width container: ```css .container { width: 960px; margin: 0 auto; } .column…
Browser standards implementation
Every browser renders pages and behaves differently. Even the ones that try to stick to standards implement them inconsistently. Make sure your site is usable for your target audience. If you are developing for…
Web accessibility
Consider users accessing your site from platforms other than the major browsers: mobile devices, screen-readers, and crawlers, for example. When you write with accessibility in mind, your code is written more …
NoSQL & MongoDB
The latest trend in database technology is away from relational tables. It seems that everybody is trying to find a way to fit a NoSQL database into their project… whether they need one or not. As with every pr…
HTTPS & SSL/TLS
Before we get started on today's blog post I'd like to clear up some terminology. When you connect to a web service using HTTPS (Hypertext Transfer Protocol Secure), your browser and server are using a protocol…
Welcome to the redesigned blog
You're reading my personal blog. I hope to keep this updated with interesting and useful posts on a regular basis. If you check out some of the other links on the site, you can see that I'm not a stranger to pu…
Preventing CSRF Attacks in ColdFusion 9
Update April 17, 2012: David Boyer has created a more feature-rich version of the simple scripts I've made here. He has actually replicated the CSRF features that come standard in CF10. Any time your servers a…
HTML5: New Features
The HTML5 specification is still in working draft, but as web development is currently shifting towards an "agile" process, browsers already implement many of these features, with more support coming everyday. …
jQuery.expire
The latest jQuery plugin I've developed is called **expire**. I intend it to be used as a simple way to set start and end times to pages. All that's required is a start time, and end time, and an action to perf…
Increasingly Higher Level "Hello World" with Node
This is a small experiment that I found a little neat and it may give some clarity to the layers of some Node stacks. I'm going to use Node to send "Hello world!" to the browser in increasingly higher level sta…
Web Fonts
There's always been a problem with fonts on the Internet. It's always been possible to send text, images, and videos, but until recently there's been no reliable way to send fonts to the browser. Sure, you can …
jQuery
jQuery is an extremely popular front-end library for web development due to its simplicity and power. According to builtwith.com, jQuery is used in over half of the top 10,000 websites on the Internet. The more…
Contributing Code on GitHub
If you've been looking to get into contributing your skills and ideas to the open-source community, this guide should be able to help you out. The first step is finding a project you want to contribute to on Gi…
parallaxBG
I wanted to try my hand at developing a packaged script that you could include on a page with no dependencies (such as jQuery). Today, I'm presenting parallaxBG: a small piece of JavaScript that will appear to …
Version Control
The advent of electronic data brought new challenges to the way we keep revisions of information. Keeping track of what happens to a piece of data becomes very important in a digital setting where many addition…
Backbone.js
It becomes apparent that as you start building more and more client-side JavaScript functionality to an application, the code can quickly become a hard-to-maintain mess. You will start to notice yourself trying…
Node.js
From Nodejs.org: > Node.js is a platform built on [Chrome's JavaScript runtime](https://v8.dev/) > for easily building fast, scalable network applications. Node.js uses an > event-driven, non-blocking I/O mode…
Programming Fonts
One of the greatest things a programmer can do to make development better is pick a decent font to work with. The default on many IDEs is usually boring, ugly, and/or not even a consideration when the IDE was r…
960 Grid System
One amazingly helpful design tool I've used recently is the grid system. Specifically on this site, I'm using the 960 Grid System. Essentially, it allows a designer to organize a page into 12 or 16 columns. The…