In my free time, I love to write about engineering and startups.

I started writing articles when I was 12, writing educational programming content, after being inspired by other writers and creators on YouTube and communities like HackerNews and DEV. Two years later, I was one of the top authors on the DEV community, reached the front page of HackerNews several times, and had 200K+ readers.

Building Software to Fix Thousands of Errors on the NY Times

Last year I was working on a project for a history class and I noticed a recurring, common error in these transcribed articles: there would commonly be an extra space in the middle of words, which occurred, in many cases, three or four times per paragraph. Here's an example from the first paragraph of a pretty notable article, the first article in the release of the famous Pentagon Papers titled Vietnam Archive: Pentagon Study Traces 3 Decades of Growing U. S. Involvement: This error appeared over 300 times in just six transcribed articles I selected. Furthermore, the error likely occurs

Random Seed in JavaScript and Node.js

Random seed is a method of initializing random number generators using an initial seed value. Random generators with the same seed will output the same pseudo-random results. I found this method to be particularly useful when developing a game I'm working on, which has a random 'Daily Challenge'. In this case, random seed can be useful to select a random game using the current date as a seed. Seed random is one of a few features that is present in most major programming languages but is not available out-of-the-box in JavaScript. It can be incredibly useful in a wide array

An Algorithm to Swap Two Variables Synchronously, Without Creating a Temporary Variable

Let's say you want to swap the values of two integer variables, a, and b. Simply setting a equal to b and then b equal to a does not work, since a and b would just end up both equaling the initial value of b. So, typically, you'd create another variable - let's call it c - and set that variable to the value of a, and then do something like this. This is very simple, but the extra variable is not actually necessary. Note that some programming languages, for example Python, provide the ability to swap two variables in

How to Set Up Rate Limiting and Rate Slowing Down in Express.js

Rate limiting is the process of preventing repeated requests to a server in effort to remove spam requests. Typically, a limit is set, such as 200 requests to the server per minute, and any IP address that exceeds that limit will be blocked from making requests for a set period of time. Rate slowing down is the process of slowing down server responses to an IP that has been sending too many requests. For example, the slow down limit could be set to 200 requests per minute, and an extra 2.5 seconds more response time could be added for each

Programs to Compute Trig Functions in Python, JavaScript, & Perl (with Maclaurin Series)

Have you ever wondered how your computer calculates certain mathematical functions, like division, or trigonometric functions like sine or cosine? Well, for some of these mathematical functions, there exist useful formulas to calculate very accurate results pretty easily. I've written programs to implement these two computations in three major scripting languages: Python, JavaScript, and Perl. These programs do not include any built-in trig functions or other utilities except the use of the in-built π constant in some cases. All code is CC0 licensed. The approach I used creates a generalized function called computeSeries which takes in x as the number

How to Use the HTML5 Gamepad API (with complete examples)

The HTML5 Gamepad API is one of the more exciting HTML5 APIs in my opinion. The API allows browser games and sites to take input from real game controllers connected to the user's machine. Hundreds of game controllers are supported, both wireless and wired, including Xbox One controllers, PS4 controllers, and more. In this article, I'll provide a full explanation of the many features that the Gamepad API offers, with examples in JavaScript. Information on browser support, gamepad button codes, taking input from the gamepad sticks, and more is included. Before we begin, note that the gamepad API may not

How to Schedule Cronjobs in Python

Cronjobs are tasks that can be run periodically, such as every five minutes, or every day at midnight, or even every Friday at noon. Cronjobs have a number of different use cases, and are widely used in many notable codebases. Many hosting servers have existing ways to set up cronjobs, but if you don't have that capability, you may want to go for a different solution. I'll explain how you would go about creating cronjobs in Python, in which a Python function, program, or system command can be run periodically, whether that be every day, every few minutes, or even

How to Generate the Sierpinski Triangle in Vanilla JavaScript with HTML5 Canvas

The Sierpinski triangle is a famous mathematical figure which presents an interesting computer science problem: how to go about generating it. In this article I'll explain one method of generating the Sierpinski triangle recursively, with an implementation written in Vanilla JavaScript using HTML5 canvas. One initial thing to notice about the Sierpinski triangle is that every triangle is composed of smaller, identical triangles. Those triangles are also made up of even smaller, identical triangles, which are also made up of more triangles, and so on.

Performance of AI Algorithms in Playing Games — Empirical Evidence From Jupiter, My 2048 AI

I recently worked on an open source project called Jupiter, an online AI written in JavaScript to beat the popular online game 2048. In this article, I'll be analyzing the performance and speed of Jupiter's algorithm with empirical data, and note potential improvements made to the algorithm and its JavaScript implementation on the web. I ran 50 trial games with the AI at 200 simulations per move in about 34 minutes (avg. 40.8s/trial), storing data after every move.

I Built Jupiter – A Machine Learning Based 2048 AI that Runs on the Web

Today I'm proud to release my online 2048 AI, Jupiter. Jupiter uses a machine learning method called the Monte Carlo Tree Search (MCTS) algorithm. I've released an article detailing the algorithm and implementation used in Jupiter: Using the Monte Carlo Tree Search (MCTS) Algorithm in an AI to Beat 2048 (and other games). Jupiter (formerly known as Jacob) started as a small AI project in January 2018. I got the idea of using Monte Carlo simulations and search trees as a method to play 2048 from this StackOverflow answer.

Using the Monte Carlo Tree Search Algorithm in an AI to Beat 2048 (and other games)

I recently worked on an open source project called Jupiter, an online AI to beat the popular online game 2048. In writing this AI, I decided to use a machine learning method called the Monte Carlo Tree Search (MCTS) algorithm. Monte Carlo algorithms like the one used in Jupiter have been used in several notable AIs, including DeepMind's AlphaGo, which famously beat the Go world champion in May 2017. In this article, I'll explain: How and why the Monte Carlo method works; When and where Monte Carlo algorithms can be useful; How I used the Monte Carlo method in an

How to Parse XML in Python

I recently spent a few hours refactoring some of the backend code on this site at In changing the backend, I wanted to make sure the refactored code worked the same way as my old code. To do this, I wrote a unit test in Python that sent a request to every URL on my site running the old backend code and the corresponding URL with my local server running the new code, to make sure they worked exactly the same. As with many other sites, has a sitemap at which lists all of the URLs on

Build and Deploy a Discord Bot with Node and Discord.js in 5 minutes

Discord bots can be useful in doing a variety of things like playing music in a voice chat, or sending automated announcements when a Youtuber releases a new video. I'm active on several Discord servers myself and have always wanted to build my own Discord bot. After building, deploying, and using my own bot for over a month now, I've written this article as a starting point in building a basic bot and moving from there. We'll be building a bot that does something pretty simple: solves math equations. Users will be able to send a message on any channel

How to Create a Beautiful Custom Scrollbar for Your Site in Plain CSS

Custom scrollbars on the web can make a site or design stand out. They can help in portraying key design aspects of a site, whether that be a specific color or a particular style. For example, the scrollbar at's web app portrays a very minimalist style. CSS-Tricks' scrollbar shows their signature orange and pink look. In this post, we'll be building a minimalist custom scrollbar, similar to that on the web app.

AP Test Submission Problems Show Lack of Developer Adoption of .HEIC File Type

Due to lockdown and quarantine in numerous countries, this year's AP tests were moved to an online platform created by College Board, the creator of the AP program and other tests such as the SAT. In most online AP tests this year, students were given 1-2 questions on the exam web app, and were given the option to submit either a photo of their work, a supported text file (ex: .txt, .docx), or copy and paste written text.

IIFE's in JavaScript Explained in 3 Minutes

Global variables can cause serious problems and bugs in large-scale projects and web apps. IIFE's solve this problem by wrapping code in an immediately invoked function, so that no global variables are created, but the code still runs without having to be directly called. For smaller sites and scripts, I would personally simply recommend actively trying to use IIFE's whenever possible, and limiting global code. I personally do use global variables in some basic sites for brevity, but it's important to have a clear understanding of what your code's global scope looks like and what sorts of unexpected problems could

Create a Reading Scroll Progress Bar for Your Blog in JavaScript and CSS

I just recently added a fun little feature on my website at a progress bar when reading blog posts. The bar would show how far users have progressed in reading a post, from 0% at the beginning to when a user finishes reading at 100%. This little feature has become particularly popular among other blogs and Wordpress themes in recent years. For example, the popular tech publication TechCrunch uses a circular scroll progress bar, and many other sites have a similar feature. In fact, if you're reading this on (and you're on desktop), then you may be able to see this feature on the top of your screen!

CSS Variables Explained in 2 Minutes with an Interactive Demo

CSS variables have been around for quite some time now, but are nevertheless extremely useful. The value of a variable can be just about anything, from pixel values to colors to linear-gradients. You can use a variable almost anywhere by wrapping it in a var function.

JavaScript `use strict` Explained in 2 Minutes

In general, normal JavaScript allows for code that is badly written and includes bad syntax. But, use strict solves this problem. Introduced in ES5, the use strict directive provides a way to tell the interpreter to turn badly written JavaScript into errors.

I Built Daily Developer Jokes and the First Ever DEV Bot

Today I am proud to release my latest project — a website and the first ever DEV bot (as far as I know), called Daily Developer Jokes. The Daily Developer Jokes bot will post programmer humor and jokes every day at 8:00 AM (EST).

Hello World in LOLCODE: A Very Peculiar Programming Language

LOLCODE is an esoteric programming language, a type of programming language which is defined by the Esolang Wiki as follows: an esoteric programming language is a computer programming language designed to experiment with weird ideas, to be hard to program in, or as a joke, rather than for practical use.

3 Modern CSS Features in 2 Minutes

1. Clip Paths: Clip paths allow you to clip elements into a shape, represented in CSS with the polygon, circle, or ellipse functions. Clip paths are written with the clip-path property for clipping element content, or the background-clip property for clipping element backgrounds.

2019 Developer Rewind / Year in Review: The End of a Decade 🎉, the End of an Era?

The developer world is changing quickly. New tech is quickly rendering old languages and frameworks useless, and the hype for new stuff such as WebAssembly, AI, and cryptocurrency is growing quickly. More developers are emerging faster than ever, and this decade could mark the end of an era in programming and the start of a new one.

5 Strange Yet Funny Things That Only Happen in JavaScript

JavaScript is a weird language. It's an object-oriented language, but for many years it never had classes. It was built for the browser, but now it can also run on a server and work with the filesystem. Over the years I've seen some pretty peculiar and equally pretty funny things, that will only work with JavaScript. Here are 5 of them.

Windows vs MacOS vs Linux: My Story (and share yours too!)

I have used all three operating systems in my lifetime. When I used Windows it felt too bloated and I missed Bash, my Linux experience was really positive but too many apps didn't support the platform, and so I am sticking with MacOS for now. Every developer's needs are different depending on what they are using their machine for. What OS are you using and why?

Building the Flipping Card Animation in Plain CSS

The flipping card animation can not only provide functionality and ease of use to any webpage, but can also make your site feel more refined, user-friendly, most importantly, modern and trustable. The animation is a perfect example of bringing real-world movement and functions to the web, improving usability through that.

A Quick Script to Find Any Broken Links on Your Site 🎯

It seems like almost every other click on the internet ends up in an "Error 404: Page Not Found" page. "Whoops, the page you're looking for does not exist," "Sorry, the requested URL was not found on this server," "Oops, something went wrong. Page not found." Every internet user has seen pages like these.

Celebrating the Internet at 50 Years: A Brief History of How We Got Here

On October 29, 1959, 50 years ago, Charley Kline, a student at UCLA, sent the first ever message over ARPANET, the predecessor of the Internet. Kline sent the first message to Bill Duval of Stanford University and intended to send the message "login". But the system crashed after he typed the letter "o", and thus the first ever message sent over the Internet was, "lo". Humble beginnings, right?

4 Great YouTubers Devs Should Check Out

I will start off by saying that I am a self-taught developer. When I started programming, the internet was the primary place I went to learn. Online tools like W3Schools and Stack Overflow were my go-to sites for quick references and syntax for the various languages and frameworks I was using.

What I Learned from a 20-year-old Book on Web Design

At my school (yes, I am a teenager), there's a school library, which I go to often. One particular day I decided to see if they had any books on web design and development. I've been building websites for a while, but, just for fun, I wanted to see what my school's library had to offer.

Deep Thinking: Machine Learning and Our Future

Deep Thinking is a book written by Garry Kasparov about chess and machine learning. Kasparov, who is a former chess world champion, is famous not only for his achievements in chess, but for being the first world champion to lose to a computer in May 1997.

Possibly the Most Useful CSS Trick

Imagine you are building a simple search form, where a user types their search into an input box, and then clicks the search button to search. Here's some sample HTML for the search form

A Few Really Useful Resources for Web Designers

I've been building websites for a few years now, and there are some online tools that I come back to time and time again whenever I start a new project, for fonts, colors, free photos, and more. These tools are invaluable to me when designing websites, so I've compiled a list of them below. I hope you find them as useful as I have over the years.

A Few Updates, and the New Site!

It's been a while since I've last written on this blog, but I'm back. Since I last wrote, quite a lot has happened. And I'm excited to write about it. First and foremost, I'd like admit something. Something that's been on my mind since I started coding, and since I started putting projects up on [my GitHub]( almost 2 years ago.