30 seconds of code Coding articles to level up your development skills https://www.30secondsofcode.org en-us https://www.30secondsofcode.org/assets/logo.png 30 seconds of code https://www.30secondsofcode.org 1440 A better alternative to force pushing https://www.30secondsofcode.org/git/s/force-push-better-alternative Forced pushes in shared branches are dangerous, but did you know there's a safer alternative? Wed, 28 Jan 2026 00:00:00 GMT List all Git aliases https://www.30secondsofcode.org/git/s/list-aliases Did you set up a lot of Git aliases and forgot what they are? List them all with this command. Wed, 07 Jan 2026 00:00:00 GMT Customize Git using aliases for common operations https://www.30secondsofcode.org/git/s/aliases Increase your productivity and reduce your cognitive load by creating aliases for many common git operations. Sat, 20 Dec 2025 00:00:00 GMT Explicit code is always better https://www.30secondsofcode.org/articles/s/explicit-code-is-always-better A thesis on why magic abstractions are harmful to codebases and teams. Tue, 04 Nov 2025 00:00:00 GMT What I learned from vibe coding a small web project with GitHub Copilot and GPT-5 mini https://www.30secondsofcode.org/articles/s/learnings-from-vibe-coding-a-small-web-project A short summary of your story up to 140 characters long. Fri, 24 Oct 2025 00:00:00 GMT Best Time to Buy and Sell Stock JavaScript Solution https://www.30secondsofcode.org/js/s/best-time-to-buy-and-sell-stock Have you tried solving "Best Time to Buy and Sell Stock" on LeetCode? Let's take a couple of approaches to tackle it in JavaScript. Thu, 16 Oct 2025 00:00:00 GMT How your tech stack is causing your refactoring problems https://www.30secondsofcode.org/articles/s/tech-stack-refactoring-problems Infinite flexibility in your tech stack can lead to refactoring headaches and technical debt. Here's how to avoid the trap. Wed, 08 Oct 2025 00:00:00 GMT A first look at the Speculation Rules API https://www.30secondsofcode.org/html/s/speculation-rules-api-first-look The new Speculation Rules API aims to deliver across the board performance optimizations with little developer effort. Let's see how! Mon, 29 Sep 2025 00:00:00 GMT The virtues of pair programming https://www.30secondsofcode.org/articles/s/virtues-of-pair-programming Pair programming can be valuable for junior and senior developers alike, fostering collaboration and knowledge sharing. Sat, 20 Sep 2025 00:00:00 GMT How to secure your JavaScript code from vulnerable dependencies https://www.30secondsofcode.org/js/s/how-to-secure-your-js-code-from-vulnerable-dependencies Keep your code, data, and users safe by following these simple tips to secure your JavaScript projects from vulnerable dependencies. Sun, 14 Sep 2025 00:00:00 GMT How do I fix incorrect line endings in a git repository? https://www.30secondsofcode.org/git/s/fix-incorrect-line-endings Have you ever encountered an issue with incorrect line endings in your git repository? Let's fix it! Mon, 08 Sep 2025 00:00:00 GMT The art of writing great code https://www.30secondsofcode.org/js/s/writing-great-code Writing great code is more than writing code that works, requiring discipline and a focus on testability, maintainability, and readability. Tue, 02 Sep 2025 00:00:00 GMT Meditation and the art of debugging https://www.30secondsofcode.org/articles/s/art-of-debugging-meditation What's the connection between meditation and debugging? Let's find out. Thu, 28 Aug 2025 00:00:00 GMT Solving Sudoku with wave function collapse in JavaScript https://www.30secondsofcode.org/js/s/sudoku-solver-wave-function-collapse Explore how to solve Sudoku puzzles in JavaScript using the wave function collapse algorithm, a constraint-propagation technique. Mon, 25 Aug 2025 00:00:00 GMT No code is inherently evil https://www.30secondsofcode.org/articles/s/no-code-is-inherently-evil No code tools? No code at all? No code you write? Prepare for a triple entendre that cuts deep into the world of software development. Thu, 21 Aug 2025 00:00:00 GMT The frontend trap https://www.30secondsofcode.org/articles/s/the-frontend-trap How staying on the frontend can limit your career growth and a hot take on how to escape it. Tue, 19 Aug 2025 00:00:00 GMT How does JavaScript's structuredClone() differ from other cloning methods? https://www.30secondsofcode.org/js/s/deep-clone-structured-clone Learn how to deep clone objects in JavaScript using structuredClone, and how it compares to other cloning methods. Thu, 14 Aug 2025 00:00:00 GMT How can I find the minimum height tree in an undirected tree in JavaScript? https://www.30secondsofcode.org/js/s/undirected-tree-degree-min-height-tree Using the degree of nodes, we can employ a very efficient algorithmic trick to find the minimum height tree in an undirected tree in JavaScript. Thu, 07 Aug 2025 00:00:00 GMT How can I find the diameter of an undirected tree in JavaScript? https://www.30secondsofcode.org/js/s/undirected-tree-diameter Using a two-pass DFS approach, we can efficiently find the diameter of an undirected tree in JavaScript. Thu, 31 Jul 2025 00:00:00 GMT How can I apply bipartite coloring to an undirected tree in JavaScript? https://www.30secondsofcode.org/js/s/undirected-tree-bipartite-coloring Learn how to apply bipartite coloring to an undirected tree in JavaScript, ensuring that no two adjacent nodes share the same color. Thu, 24 Jul 2025 00:00:00 GMT How can I traverse an undirected tree using DFS or BFS in JavaScript? https://www.30secondsofcode.org/js/s/undirected-tree-dfs-bfs Learn how to traverse an undirected tree using Depth-First Search (DFS) or Breadth-First Search (BFS) in JavaScript. Thu, 17 Jul 2025 00:00:00 GMT How can I build an undirected tree from an array of edges in JavaScript? https://www.30secondsofcode.org/js/s/undirected-tree-from-edges Learn how to build an undirected tree from an array of edges in JavaScript, with various approaches for storing node relationships. Thu, 10 Jul 2025 00:00:00 GMT Convert between binary and decimal numbers in JavaScript https://www.30secondsofcode.org/js/s/binary-number-conversion Binary numbers are a fundamental part of computer science. Learn how to convert between binary and decimal numbers in JavaScript. Mon, 07 Jul 2025 00:00:00 GMT How 30 seconds of code is deployed https://www.30secondsofcode.org/articles/s/how-30-seconds-of-code-is-deployed A historical run-through of how 30 seconds of code was deployed then and now. Thu, 03 Jul 2025 00:00:00 GMT Exploring indexes and cardinality with JavaScript https://www.30secondsofcode.org/js/s/indexed-object-collections Using indexes can speed up querying object collections significantly, but it seems like a black box for many. Let's dive in! Sat, 28 Jun 2025 00:00:00 GMT How can I find the longest palindromic substring in a JavaScript string? https://www.30secondsofcode.org/js/s/longest-palindrome While a brute-force longest palindrome finder is simple, it is not efficient. Let's explore a more efficient solution. Mon, 23 Jun 2025 00:00:00 GMT Using binary search to find the index to insert a number in a sorted JavaScript array https://www.30secondsofcode.org/js/s/binary-search-insert-index-sorted-number-array Combining techniques presented in the past, we can solve a more complex problem with stellar performance. Thu, 19 Jun 2025 00:00:00 GMT Digitize a number in JavaScript https://www.30secondsofcode.org/js/s/digitize-number Learn how to convert any number to an array of digits, as well as how to sum the digits and compute the digital root efficiently. Sun, 15 Jun 2025 00:00:00 GMT Design systems rarely survive contact with the real world https://www.30secondsofcode.org/articles/s/design-systems-reality Design systems are often seen as the holy grail of design and development, but there are a few issues that can arise in the real world. Sat, 14 Jun 2025 00:00:00 GMT Implementing a Sudoku validator in JavaScript https://www.30secondsofcode.org/js/s/sudoku-validator Sudoku is a logic-based combinatorial number-placement puzzle. This article discusses how to implement a Sudoku validator in JavaScript. Wed, 11 Jun 2025 00:00:00 GMT Markdown Cheatsheet https://www.30secondsofcode.org/articles/s/markdown-cheatsheet Markdown is the most popular markup language for writing documentation. Here is a cheatsheet with the most common syntax. Sun, 08 Jun 2025 00:00:00 GMT Vocal fails are better than silent fails https://www.30secondsofcode.org/js/s/vocal-fails-silencing-errors Learn why vocal errors are better than silent ones, how to handle them effectively, and improve debugging and collaboration in JavaScript. Wed, 04 Jun 2025 00:00:00 GMT Creating a Matrix data structure in JavaScript https://www.30secondsofcode.org/js/s/matrix-data-structure After working with 2D arrays for a while, I decided to create a convenient wrapper for operations. Here's the gist of it. Sun, 01 Jun 2025 00:00:00 GMT ESLint & Prettier configuration https://www.30secondsofcode.org/js/s/eslint-prettier-configuration Instead of reconfiguring ESLint and Prettier every time, I use this configuration to get started quickly. Wed, 28 May 2025 00:00:00 GMT Creating tabbed content without JavaScript https://www.30secondsofcode.org/css/s/details-tabbed-content Leverage modern HTML and CSS capabilities to create a tabbed content component without JavaScript. Mon, 26 May 2025 00:00:00 GMT Creating accordion-style content without JavaScript https://www.30secondsofcode.org/html/s/details-accordion Did you know you don't need JavaScript to create accordion-style content? Here's how to do it with the details element. Thu, 22 May 2025 00:00:00 GMT Are text-align and align-items the same when it comes to text alignment in CSS? https://www.30secondsofcode.org/css/s/text-centering-line-block In the age of flexbox and grid, text alignment may seem simpler than ever, but there are a few things you should be aware of. Mon, 19 May 2025 00:00:00 GMT Using the inset CSS property https://www.30secondsofcode.org/css/s/inset The inset shorthand property makes element positioning in CSS easier. Learn how to use it effectively in your projects. Thu, 15 May 2025 00:00:00 GMT Logical and physical CSS properties equivalents https://www.30secondsofcode.org/css/s/logical-physical-properties-map New to CSS logical properties? This article provides a handy map of logical properties to their physical counterparts. Mon, 12 May 2025 00:00:00 GMT You Shouldn't Always Modularize Your Code https://www.30secondsofcode.org/articles/s/code-modularization Have you ever stopped to wonder if modularization is right for your use case? What if I told you it might not be? Sat, 10 May 2025 00:00:00 GMT JavaScript Operator Cheatsheet https://www.30secondsofcode.org/js/s/operator-cheatsheet Quick reference for JavaScript operators. Wed, 07 May 2025 00:00:00 GMT Progressive enhancement with Web Components https://www.30secondsofcode.org/js/s/progressive-enhancement-web-components Dive into Web Components with me and learn how I used them to create modular interactive components to progressively enhance my website. Sat, 03 May 2025 00:00:00 GMT Implementing fuzzy matching in JavaScript https://www.30secondsofcode.org/js/s/n-gram-fuzzy-matching Having built a search engine with TF-IDF and inverted indexes, we will now implement fuzzy matching to make searching error-tolerant. Tue, 29 Apr 2025 00:00:00 GMT Formatting relative time in JavaScript https://www.30secondsofcode.org/js/s/relative-time-formatting Did you know JavaScript has a built-in way to format relative time? It's called Intl.RelativeTimeFormat and it's awesome! Thu, 24 Apr 2025 00:00:00 GMT Detect the user's OS in the browser with JavaScript https://www.30secondsofcode.org/js/s/browser-os-detection Learn how to easily detect the user's operating system in the browser using JavaScript. Sat, 19 Apr 2025 00:00:00 GMT Implementing partial search matching in JavaScript https://www.30secondsofcode.org/js/s/partial-search-matching Building on top of the TF-IDF and inverted index implementation, we will implement partial search matching to make searching more robust. Mon, 14 Apr 2025 00:00:00 GMT Implementing search in JavaScript, using TF-IDF and an inverted index https://www.30secondsofcode.org/js/s/tf-idf-inverted-index Building on top of the Porter stemmer, we'll explore how to use TF-IDF and an inverted index to implement a search algorithm in JavaScript. Wed, 09 Apr 2025 00:00:00 GMT Implementing the Porter stemming algorithm in JavaScript https://www.30secondsofcode.org/js/s/porter-stemming-algorithm Learn how to implement the Porter stemming algorithm in JavaScript, a simple algorithm for stripping English words of common suffixes. Sun, 06 Apr 2025 00:00:00 GMT Implementing signals and reactivity with vanilla JavaScript https://www.30secondsofcode.org/js/s/event-driven-vanilla-js-signals Let's demystify signals and reactivity, one of the most popular patterns in modern JavaScript, using event-driven programming! Wed, 02 Apr 2025 00:00:00 GMT Using Test-Driven Development to refactor a JavaScript project https://www.30secondsofcode.org/js/s/tdd-codebase-refactoring In the last installment of the series, we'll refactor our codebase to reduce bundle size and complexity, while making it more maintainable. Fri, 28 Mar 2025 00:00:00 GMT