Skip to content

Instantly share code, notes, and snippets.

View 004Ongoro's full-sized avatar
💭
Available to code

George Ongoro 004Ongoro

💭
Available to code
View GitHub Profile
// QUESTION
/*
Given a string s containing letters and ? wildcards (that can match any letter), and a target
pattern string pattern, rearrange the entire string however you like. Return the maximum number
of non-overlapping copies of pattern that can appear in the rearranged result.
*/
// SOL'N
const maxPatternCopies = (s, p) => {

Modern Fluid Typography System

Traditional responsive web design relies on "stepping" font sizes at specific breakpoints (e.g., font-size: 16px on mobile, font-size: 20px on desktop). Fluid Typography removes these jagged jumps by allowing the font size to scale linearly between a minimum and maximum value based on the viewport width (vw). The Math Behind the Fluidity The core of this implementation is the CSS clamp() function. It takes three parameters:

  • Minimum Value: The smallest the font can get (e.g., mobile).
  • Preferred Value: A dynamic unit (usually vw) that scales with the screen.
  • Maximum Value: The upper limit (e.g., large desktops).