Aleksandr Hovhannisyan

Dev tutorials, thoughts on software development, and the occasional essay.
https://www.aleksandrhovhannisyan.com/feed.xml (RSS)
visit blog
Performant Game Loops in JavaScript
29 Dec 2024 | original ↗

A look at some best practices for creating performant game animations in JavaScript.

Creating Perfect Font Fallbacks in CSS
12 Dec 2024 | original ↗

Learn how to use three CSS properties to override font metrics and minimize layout shifts during font load.

Preventing Layout Shifts in Status Text with CSS Grid
11 Dec 2024 | original ↗

Use this trick with CSS Grid to prevent layout shifts when swapping text in status indicators.

I Moved to Cloudflare
11 Dec 2024 | original ↗

After some recent incidents involving Netlify and Vercel, I decided to play it safe and move my website and another side project to Cloudflare.

The Perfect Theme Switch Component
27 Nov 2024 | original ↗

Learn how to implement a progressively enhanced theme switch component using HTML, CSS, and JavaScript.

Creating an Accessible Image Carousel
13 Nov 2024 | original ↗

Learn how to build an accessible image carousel that supports multiple input modes and is progressively enhanced with CSS scroll snap and JavaScript.

Listening for Key Sequences in JavaScript
20 Oct 2024 | original ↗

Learn how to implement a simple algorithm that listens for a specific sequence of keystrokes in JavaScript, with an optional delay between keys.

Awaiting Multiple Promises with Promise.all
8 Oct 2024 | original ↗

Learn how to use JavaScript's Promise.all method to await multiple async operations, as well as how to write a custom implementation of Promise.all.

Optimizing Images with the 11ty Image Plugin
3 Sept 2024 | original ↗

While imagery can enrich your content, it can also slow down your site if it's not used responsibly. Learn how to use the official 11ty image plugin to create optimized and responsive images.

Eleventy Images Just Got Better
3 Sept 2024 | original ↗

Eleventy 3.0 adds a new API to optimize images anywhere on your site, without shortcodes.

144 Shades of Gray
23 Aug 2024 | original ↗

The one where I create my first generative artwork and still refuse to use any color on my site.

How to Format on Save with ESlint
22 Aug 2024 | original ↗

Set up ESLint to format on save in two popular code editors: VS Code and neovim.

Don't Mind the Leetcode Grind
20 Aug 2024 | original ↗

Leetcode is a polarizing topic in the software industry. But what is it, and how much time should you invest into it?

Add Comments to a Dev Blog with Netlify Functions and the GitHub API
15 Aug 2024 | original ↗

Comment systems can be a pain to set up, but they don't have to be. Learn how to use the GitHub Issues API to create a custom comment system powered by Netlify functions.

An Introduction to Unicode
15 Aug 2024 | original ↗

In this deep dive, you'll learn about the Unicode character set and how it's encoded and decoded with UTF.

Virtual Templates in Eleventy
1 Jun 2024 | original ↗

In Eleventy 3.0, virtual templates enable plugin authors to publish and share dynamic templates.

The 62.5% Font Size Trick
22 May 2024 | original ↗

Once you get used to thinking in rems for font sizing, you'll find that it's easy to express familiar powers of two. But for other values, you may find it helpful to use the 62.5% font size trick.

Hearing Silence
2 Apr 2024 | original ↗

Subtitles can capture essential dialogue and sounds, but what about the quiet parts?

Is JavaScript Pass by Reference?
20 Mar 2024 | original ↗

Developers are often taught that JavaScript passes objects by reference. In reality, JavaScript is a pass-by-value language.

How to Download and Optimize Google Fonts
3 Mar 2024 | original ↗

Self-hosting fonts can improve your site's performance and eliminate unwanted third-party tracking. Learn how to download, subset, and optimize any Google Font for your projects.

My First DIY Laptop Upgrade
24 Feb 2024 | original ↗

A post-mortem of my first attempt at upgrading a laptop.

(Don't Fear) Mutation
10 Feb 2024 | original ↗

The irrational fear of mutation in programming can sometimes do more harm than good.

11ty: The Good, the Bad, and the... Possum?
16 Jan 2024 | original ↗

An in-depth review of 11ty, an extensible static site generator written in Node that supports a variety of template languages.

2023 in Review
13 Jan 2024 | original ↗

Reflecting on an unusually eventful year in my life.

Naturalized
25 Aug 2023 | original ↗

After nearly two decades of living in the United States, I'm proud to say that I'm now officially a U.S. citizen.

Implementing a Finite State Machine in C++
14 Aug 2023 | original ↗

Finite state machines (FSMs) are a useful tool for representing stateful entities in code. In this tutorial, we'll learn how to implement the finite state design pattern in C++.

Interactive HTML Code Demos in Eleventy
30 Jul 2023 | original ↗

With eleventy-plugin-code-demo, you can easily add interactive HTML, CSS, and JavaScript code demos to your Eleventy site using Markdown.

Class Fields vs. Methods in JavaScript
16 Jul 2023 | original ↗

In JavaScript, class fields allow you to define properties on a class instance outside the constructor. In the case of function properties, it's important to understand how fields differ from methods and their potential tradeoffs.

Use Rems for Font Size to Respect User Preferences
14 Jun 2023 | original ↗

Rems are the most accessible CSS unit for font size, allowing text to scale responsively when users change their preferred font size settings.

Detecting Nested Components in React with the Context API
5 Feb 2023 | original ↗

Normally, React's Context API is used to avoid prop drilling. But you can also use it to detect if a component is a child of a particular component.

An Interactive Guide to JavaScript Events
4 Feb 2023 | original ↗

Learn how event capturing, targeting, and bubbling work in JavaScript; how to prevent an event's default behavior; how to stop event propagation; and more.

Creating a Fluid Type Scale with CSS Clamp
30 Jan 2023 | original ↗

Understand the math behind fluid typography and learn how to programmatically generate a fluid type scale with CSS clamp and Sass.

An Introduction to HTTP Cookies
1 Dec 2022 | original ↗

Learn why HTTP cookies are needed, how they're used, where they're stored, and how they impact security and privacy.

Modular Arithmetic and the Diffie-Hellman Algorithm
1 Dec 2022 | original ↗

Using the properties of congruence modulo, Alice and Bob can generate a shared private key and communicate publicly, while Eve will struggle to decipher their messages.

A Font-Face Faux Pas
26 Nov 2022 | original ↗

When using the font-face local() function to load fonts installed on a user's system, double-check that sure you're requesting the right font family.

Writing Better Documentation
5 Nov 2022 | original ↗

Documentation is one of those things that you don't appreciate until you have to live without it.

SVG Tutorial: How to Code SVG Icons by Hand
28 Oct 2022 | original ↗

Follow along with the examples in this in-depth guide to learn how to draw SVG icons and simple shapes by hand.

Modern Techniques for Writing Better CSS
28 Oct 2022 | original ↗

Write cleaner CSS using modern strategies like :is and :where, logical properties and values, clamp, gap, and aspect-ratio.

Serializing HTML Form Data with JavaScript
22 Oct 2022 | original ↗

Learn how to use JavaScript's FormData, URLSearchParams, and URL constructors to serialize an HTML form's data into a well-formatted and encoded URL.

The Cost of Tech Debt
27 Sept 2022 | original ↗

The longer you leave tech debt unresolved, the more problems it will create for your team, until one day it becomes unbearable.

Set a Width and Height on Images to Reduce Layout Shifts
26 Sept 2022 | original ↗

When you set a width and height on image tags, browsers are able to reserve the correct amount of space ahead of time to minimize layout shifts as the images are downloaded.

11ty Serverless and Object Permalinks: Hybrid Rendering
5 Sept 2022 | original ↗

Learn how to reuse a single source template in 11ty Serverless to generate both a static and server-rendered page.

Password Composition Rules Are Counter­productive
1 Sept 2022 | original ↗

Registration systems often require that passwords contain certain characters. But this is counterproductive and encourages bad habits that can weaken users' passwords.

HTML Input Validation with JavaScript
11 Aug 2022 | original ↗

Validate user input in real time with the checkValidity, reportValidity, and setCustomValidity methods.

Limiting Memory Usage in WSL2
7 Aug 2022 | original ↗

By default, WSL 2 may reserve a significant chunk of your host RAM. Thankfully, we can limit its memory usage with a .wslconfig file.

Binary for Beginners: The ABCs of 0s and 1s
23 Jul 2022 | original ↗

The binary number system underlies everything in computation and software. But what's the deal with all those 0s and 1s?

CRLF vs. LF: Normalizing Line Endings in Git
23 Jul 2022 | original ↗

Line endings can differ from one OS to another. Learn the history behind CRLF and LF line endings and how to enforce line endings in Git.

Add Build Info to an 11ty Site
21 Jul 2022 | original ↗

Expose useful information about your Eleventy build to all of your templates using global data.

Represent State with HTML Attributes, Not Class Names
17 Jul 2022 | original ↗

You might not need another CSS class. Use HTML attributes for state and style those states with the CSS attribute selector.

Tech Twitter Burnout
10 Jul 2022 | original ↗

Tech Twitter can be a great way to network with other developers and learn new things. But it can also be unhealthy.

Dynamically Importing Components with React.lazy
10 Jun 2022 | original ↗

With React.lazy, you can dynamically import components at run time to reduce the size of your JavaScript bundles.

Make Atomic Git Commits
8 Jun 2022 | original ↗

It can be tempting to lump unrelated code changes into a single commit, but this makes it difficult to debug and time travel in Git. Prefer to write atomic commits that have a single responsibility.

A typeof Typo
4 Jun 2022 | original ↗

When a pair of quotes makes a world of difference.

A Set of Useful 11ty Filters
15 May 2022 | original ↗

Extend Eleventy's built-in filters with custom logic for these common use cases.

Overzealous Destructuring
17 Apr 2022 | original ↗

Excessive destructuring in JavaScript can make your code harder to read, trickier to debug, and more error prone.

How to Add a Copy-to-Clipboard Button to Jekyll
26 Mar 2022 | original ↗

Add a copy-to-clipboard button to your Jekyll blog with a simple include and a few lines of JavaScript.

Managing Keyboard Focus for Load-More Buttons
24 Mar 2022 | original ↗

Load-more buttons are more accessible than infinite scrolling, but they also steal keyboard focus when new content loads in. We can fix this problem by manually focusing the first newly inserted result.

Passing Object Arguments to Liquid Shortcodes in 11ty
17 Mar 2022 | original ↗

Currently, 11ty doesn't allow you to pass object arguments to shortcodes in Liquid. As a temporary workaround, you can assemble and parse a JSON string to pass along to the shortcode as an argument.

Changing the Locale in Chrome with Dev Tools
9 Mar 2022 | original ↗

Learn how to use Chrome developer tools to simulate loading a page in a different locale.

Gated Content, Broken Locks
5 Mar 2022 | original ↗

Some sites gate their content by hiding it with CSS. Whether you open the site incognito or normally, the full content appears to be beyond reach. But it's not—anyone can swing open the gate.

Custom Markdown Components in 11ty
3 Feb 2022 | original ↗

Ever wanted to nest Markdown in HTML? In 11ty, you can easily do this with paired shortcodes and a custom Markdown library parser.

Dynamic Tag Name Props in React (with TypeScript)
2 Jan 2022 | original ↗

Sometimes, a React component needs to allow users to render a custom tag. Here's how you can pass dynamic tag names as props.

Why I Don't Like Tailwind CSS
18 Dec 2021 | original ↗

On paper, Tailwind CSS sounds like a great idea. In reality, it suffers from the same problems that it tries to solve.

NFTs Are a Problem
18 Dec 2021 | original ↗

NFTs are artificially scarce, make it easier to commit fraud, undermine the intellectual property rights of content creators, and encourage consumptive mining practices.

Optimizing Images with WebP and Lazy Loading
14 Dec 2021 | original ↗

Learn how to optimize images for the web using the WebP image format and lazy loading with JavaScript.

Creating a Vertical Rhythm with CSS Grid
15 Nov 2021 | original ↗

Margins are commonly used to space paragraphs in an article, but CSS Grid offers a more intuitive alternative that defines the spacing at the layout level.

Configuring Web Fonts in 11ty with Global Data
14 Nov 2021 | original ↗

Use global data in 11ty to create a single configuration for fonts that you can reference in your templates and CSS.

Outer Wilds: Stop and Smell the Pine Trees
24 Oct 2021 | original ↗

On the surface, Outer Wilds is a space exploration game. But peel back the layers, and it's a captivating and philosophical story about life and our universe.

Add Comments to Jekyll with the GitHub Issues API
20 Oct 2021 | original ↗

Add comments to your Jekyll blog with the GitHub issues API and lazily load them for improved performance.

Managing Complex State in React with useReducer
10 Oct 2021 | original ↗

React's useState hook works well for managing simple state. But once your component starts to grow, useReducer may be a better fit for managing state.

Don't Use a Fixed Line Height
17 Aug 2021 | original ↗

In typography, the ideal line height for text depends on a variety of factors, including font size, line length, and font family.

Hard Links and Soft Links
14 Aug 2021 | original ↗

Links allow Unix file systems to keep track of files in one of two ways: soft (symbolic) links and hard links. One sticks around for good, while the other rots.

Learn to Code Without Wasting Time & Money
14 Aug 2021 | original ↗

A discussion of the things that beginner programmers tend to get wrong, as well as concrete suggestions for what they should be doing instead.

Operating System Scheduling Algorithms
14 Aug 2021 | original ↗

Only one process can run at a time on a single CPU. Scheduling algorithms are what allow these processes to take turns running.

Automate Netlify Redirects in 11ty
8 Aug 2021 | original ↗

Tired of listing all of your Netlify redirects by hand? Generate them programmatically with a bit of 11ty templating magic!

Goodbye, GitHub Pages—Hello, Netlify
31 Jul 2021 | original ↗

GitHub Pages is a good option for hosting simple sites for free, but Netlify offers plenty of more advanced features.

Cleaner Type Predicates with Derived Types
18 Jul 2021 | original ↗

In TypeScript, type predicates allow you to narrow down an abstract type to a more concrete type with a simple assertion. Together with derived types, they can greatly reduce repetition in your code.

Semantic HTML: Building a More Accessible Web
10 Jul 2021 | original ↗

Accessibility is a hot topic, but it's not always executed correctly. Learn how to use semantic HTML to create an accessible user experience on the web.

The Method of Least Squares
28 Jun 2021 | original ↗

With least squares regression, you can find the closest solution to a system of equations that doesn't have a unique solution.

Least Squares Fitting: How to Fit a Curve to Data
28 Jun 2021 | original ↗

A deep dive on how to perform straight-line and polynomial least squares fitting, both by hand and programmatically.

Creating Aspect Ratios in CSS
12 Jun 2021 | original ↗

Learn how to give any element an aspect ratio in CSS, using the modern aspect-ratio property or a trick with percentage padding.

React, Iframes, and a Back-Navigation Bug
22 May 2021 | original ↗

If an iframe re-renders in React, it can interfere with back navigation in your browser. The solution? Force the iframe to unmount with a unique key.

Why Developers Should Write
7 Apr 2021 | original ↗

Writing is likely one of the last skills you associate with software development. But it plays a key role in everything that we do and can help you build a more successful career.

Why You No Longer Enjoy Reading
21 Feb 2021 | original ↗

Reading books isn't something that everyone enjoys. But if you used to like reading but can no longer get past the first chapter of a new book, there may be a few reasons why.

Rest in Peace, Flash
31 Dec 2020 | original ↗

If it were up to me, things wouldn't end this way. We had some great times together, but now it's time to say goodbye.

Subtle Accessibility Failures (And How to Fix Them)
28 Nov 2020 | original ↗

You got a perfect score on an accessibility audit. But is your site actually accessible, or have you overlooked more subtle failures?

Be Careful with Async Functions that Return Booleans
25 Nov 2020 | original ↗

Suppose an async function returns a boolean. What happens if you check the return value without awaiting it?

6 Ways to Undo Changes in Git
11 Oct 2020 | original ↗

When things go wrong, don't panic. Here are a few ways you can undo changes in git and clean up your commit history.

Getting Started with Jekyll and GitHub Pages
2 Oct 2020 | original ↗

Jekyll is a static site generator that makes it easy for you to create a website. Learn how to get started with Jekyll and GitHub Pages.

Does Web Performance Matter? It Depends.
30 Sept 2020 | original ↗

Some big brands have a slow page load speed, but they still rank well on Google. So does web performance even matter?

Hesitation Is Defeat
17 Sept 2020 | original ↗

After a one-year hiatius from Sekiro, I returned to face the final boss—and, through painful persistence, triumphed.

JavaScript Promises: Practical Use Cases and Examples
12 Sept 2020 | original ↗

Promises are a powerful tool for writing asynchronous code in JavaScript. Here are a few interesting use cases.

How to Test Localhost on Mobile (with ngrok)
12 Jul 2020 | original ↗

Learn how to easily test localhost on mobile using ngrok, without deploying a single line of code.

How to Get More Traffic with SEO
4 Apr 2020 | original ↗

SEO is the art of making strategic improvements to a site in order to rank higher in search results and gain more traffic. Learn how to use tried-and-true SEO strategies to drive more visitors to your site.

Invulnerability Frames in Unity
25 Mar 2020 | original ↗

Invulnerability frames are a popular mechanic in many retro and modern games. In Unity, you can implement i-frames using coroutines.

Using WebP Images in Jekyll
5 Jan 2020 | original ↗

Improve your page load speed in Jekyll using the WebP image format and a custom include.

Implementing a Trie in Python
18 Aug 2019 | original ↗

Prefix trees (also known as tries) allow you to efficiently search for a string in a dictionary of known words using just a prefix. Learn how to implement a trie in Python.

↑ These items are from RSS. Visit the blog itself at https://www.aleksandrhovhannisyan.com/feed.xml to find everything else and to appreciate author's digital home.