Snippets

Find the Duplicate in a sequence of 1 to n with size n+1

,

This problem focuses on the series formula for getting the sum of the series of length n and then finding the duplicate by using that sum as refernce

Sep 12, 2024

document.createDocumentFragment for Batch DOM updates

, ,

The DocumentFragment is an interface that represents a temporary container for holding a group of DOM nodes. It acts like a mini-document but is not part of the actual DOM tree. This allows developers to construct and manipulate multiple nodes or elements in memory without immediately adding them to the visible DOM. The main performance advantage of using DocumentFragment is that it avoids triggering reflows and repaints during the construction phase. By batching multiple DOM operations and appending them all at once, you significantly reduce the overhead caused by repeated DOM mutations, which can be costly in terms of performance, especially with large or frequent updates.

Sep 11, 2024

Compound Components in React

, ,

Compound components in React offer a powerful design pattern for creating flexible and reusable UI elements, allowing multiple components to work together as a cohesive unit while maintaining a clean API - a simple example is a Tabs component that manages its own state and renders child Tab components based on user interaction, enabling encapsulation, flexibility, and readability in your React applications.

Sep 9, 2024

Simple Debounce Implementation in Javascript

,

This is a simple implementation of Debounce Function Wrapper that helps you debounce functions which are called multiple times in a short interval.

Sep 7, 2024

+

Check my latest Blog Post

Google Dorking: Unlocking Hidden Search Capabilities & Insights

Read Now
Oh My Gawwdd!!!!!!!

Wow you have been viewing my site since 20 seconds!

+
+