Marko Denic

Marko Denic

@markodenic.com

Software Engineer. Public mentor. Making the web faster. Blogging at https://markodenic.com.

1.3K followers117 following542 posts

301 Redirects in .htaccess: Copy-Paste Examples Every 301 redirect you'll need in .htaccess: single pages, folders, whole domains, HTTP to HTTPS, www to non-www, trailing slashes and regex patterns, plus testing them and doing it right in WordPress.

markodenic.com301 Redirects in .htaccess: Copy-Paste ExamplesEvery 301 redirect you'll need in .htaccess: single pages, folders, whole domains, HTTP to HTTPS, www to non-www, trailing slashes and regex patterns, plus testing them and doing it right in WordPress.

window.opener and target=”_blank”: The Tabnabbing Risk Explained What window.opener is, how reverse tabnabbing attacks used target="_blank" links, why rel="noopener" fixes it, what browsers do by default today, and how popups like OAuth logins should communicate instead.

markodenic.comwindow.opener and target=”_blank”: The Tabnabbing Risk ExplainedWhat window.opener is, how reverse tabnabbing attacks used target="_blank" links, why rel="noopener" fixes it, what browsers do by default today, and how popups like OAuth logins should communicate instead.

npm uninstall: How to Remove (and Update) npm Packages How to uninstall npm packages: local, dev and global packages, several at once, everything in node_modules, finding unused dependencies, plus how to update all packages and the yarn and pnpm equivalents.

markodenic.comnpm uninstall: How to Remove (and Update) npm PackagesHow to uninstall npm packages: local, dev and global packages, several at once, everything in node_modules, finding unused dependencies, plus how to update all packages and the yarn and pnpm equivalents.

Headless WordPress: What It Is, Pros and Cons, and How to Start Headless WordPress explained: using WordPress as a content API with a Next.js, Astro or Nuxt front end. How the REST API and WPGraphQL work, the real pros and cons, and when it's worth it.

markodenic.comHeadless WordPress: What It Is, Pros and Cons, and How to StartHeadless WordPress explained: using WordPress as a content API with a Next.js, Astro or Nuxt front end. How the REST API and WPGraphQL work, the real pros and cons, and when it's worth it.

Truncate Text in CSS: text-overflow: ellipsis and line-clamp Truncate text with an ellipsis in CSS: one line with text-overflow: ellipsis, several lines with line-clamp, and fixes for when the ellipsis doesn't show in flexbox, grid and tables.

markodenic.comTruncate Text in CSS: text-overflow: ellipsis and line-clampTruncate text with an ellipsis in CSS: one line with text-overflow: ellipsis, several lines with line-clamp, and fixes for when the ellipsis doesn't show in flexbox, grid and tables.

Auto-growing textareas used to need JS that checks scrollHeight on every keystroke. Now it's 3 lines of CSS: textarea { field-sizing: content; min-height: 3lh; max-height: 10lh; } It grows as you type and starts scrolling after 10 lines.

CSS Class Selector: Single, Multiple and Combined Classes How CSS class selectors work: adding multiple classes to an element, .a.b vs .a .b vs .a, .b, class vs id, naming rules, specificity, and adding or removing classes with JavaScript.

markodenic.comCSS Class Selector: Single, Multiple and Combined ClassesHow CSS class selectors work: adding multiple classes to an element, .a.b vs .a .b vs .a, .b, class vs id, naming rules, specificity, and adding or removing classes with JavaScript.

JavaScript Reserved Words: The Complete List of Keywords The full list of JavaScript reserved words and keywords, the extra ones reserved in strict mode and modules, words that are only special in context, and the errors you get when you use them as names.

markodenic.comJavaScript Reserved Words: The Complete List of KeywordsThe full list of JavaScript reserved words and keywords, the extra ones reserved in strict mode and modules, words that are only special in context, and the errors you get when you use them as names.

Hide Scrollbar in CSS (and Style a Custom Scrollbar) Hide the scrollbar with CSS while keeping scrolling, hide it completely, hide only the horizontal one, prevent layout shift with scrollbar-gutter, and style a custom scrollbar in every browser.

markodenic.comHide Scrollbar in CSS (and Style a Custom Scrollbar)Hide the scrollbar with CSS while keeping scrolling, hide it completely, hide only the horizontal one, prevent layout shift with scrollbar-gutter, and style a custom scrollbar in every browser.

BEM in CSS: Block, Element, Modifier Naming Explained BEM (Block, Element, Modifier) explained with a real example: the naming rules, how to handle nested elements and modifiers, BEM with Sass, common mistakes, and BEM vs Tailwind and CSS Modules.

markodenic.comBEM in CSS: Block, Element, Modifier Naming ExplainedBEM (Block, Element, Modifier) explained with a real example: the naming rules, how to handle nested elements and modifiers, BEM with Sass, common mistakes, and BEM vs Tailwind and CSS Modules.

URLSearchParams: Read and Update URL Query Parameters in JavaScript How to use URLSearchParams in JavaScript: get, set, append and delete query parameters, read the current URL, update it without reloading, build fetch URLs, and avoid the common gotchas.

markodenic.comURLSearchParams: Read and Update URL Query Parameters in JavaScriptHow to use URLSearchParams in JavaScript: get, set, append and delete query parameters, read the current URL, update it without reloading, build fetch URLs, and avoid the common gotchas.

Is HTML a Programming Language? (And What About CSS?) Is HTML a programming language? No, it's a markup language. Here's what that means, how HTML, CSS and JavaScript differ, why CSS is a closer call, and why the label doesn't matter for your career.

markodenic.comIs HTML a Programming Language? (And What About CSS?)Is HTML a programming language? No, it's a markup language. Here's what that means, how HTML, CSS and JavaScript differ, why CSS is a closer call, and why the label doesn't matter for your career.

How to Send Code Blocks in Discord (With Syntax Highlighting) Send code in Discord the right way: inline code, multi-line code blocks, syntax highlighting for JavaScript, Python, CSS and more, colored text with diff, and what to do with code that's too long.

markodenic.comHow to Send Code Blocks in Discord (With Syntax Highlighting)Send code in Discord the right way: inline code, multi-line code blocks, syntax highlighting for JavaScript, Python, CSS and more, colored text with diff, and what to do with code that's too long.

CSS ::before and ::after Pseudo-Elements (With Examples) How CSS ::before and ::after work: the content property, the difference between them, and practical examples like icons, custom bullets, overlays, tooltips and decorative shapes.

markodenic.comCSS ::before and ::after Pseudo-Elements (With Examples)How CSS ::before and ::after work: the content property, the difference between them, and practical examples like icons, custom bullets, overlays, tooltips and decorative shapes.

Your AI feature isn't slow. It just waits for the last word before showing the first. Stream it instead: 1. Read response.body 2. Pipe it through TextDecoderStream 3. Append each chunk as it arrives 15 lines. No library. Every modern browser. Full code: markodenic.tech/stream-ai-a...

requestAnimationFrame Explained (With Examples) How requestAnimationFrame works in JavaScript: the animation loop, delta time for smooth motion on any screen, cancelAnimationFrame, throttling scroll handlers, and when to use CSS instead.

markodenic.comrequestAnimationFrame Explained (With Examples)How requestAnimationFrame works in JavaScript: the animation loop, delta time for smooth motion on any screen, cancelAnimationFrame, throttling scroll handlers, and when to use CSS instead.

How to Open a Link in a New Tab (HTML target=”_blank”) Open a link in a new tab with target="_blank": the HTML, rel="noopener noreferrer" and why it matters, JavaScript window.open(), accessibility, and when you shouldn't do it.

markodenic.comHow to Open a Link in a New Tab (HTML target=”_blank”)Open a link in a new tab with target="_blank": the HTML, rel="noopener noreferrer" and why it matters, JavaScript window.open(), accessibility, and when you shouldn't do it.

Fix “Cannot use import statement outside a module” in JavaScript Why you get "SyntaxError: Cannot use import statement outside a module" and how to fix it in the browser, Node.js, TypeScript and Jest, with the exact change for each case.

markodenic.comFix “Cannot use import statement outside a module” in JavaScriptWhy you get "SyntaxError: Cannot use import statement outside a module" and how to fix it in the browser, Node.js, TypeScript and Jest, with the exact change for each case.

AI agents are guessing their way through your site. Fix it with 3 HTML attributes: 1. toolname 2. tooldescription 3. toolautosubmit Chrome turns your form into a tool agents call directly. Other browsers ignore it.

CSS Grid: grid-template-columns, fr and repeat() Explained Learn CSS Grid with live examples: grid-template-columns, the fr unit, repeat(), minmax(), auto-fill vs auto-fit, grid-template-areas and responsive grids without media queries.

markodenic.comCSS Grid: grid-template-columns, fr and repeat() ExplainedLearn CSS Grid with live examples: grid-template-columns, the fr unit, repeat(), minmax(), auto-fill vs auto-fit, grid-template-areas and responsive grids without media queries.