Snippetly
HomeBrowseCreate
© 2025 Snippetly. All rights reserved.

Browse Snippets

34 snippets
Create
Sort by:

Debounce Function

Prevents a function from firing too frequently by waiting for a pause before calling it. Commonly used to optimize input...

utilitiesperformance
JavaScript
0
Jul 17
View snippet →

useCopyToClipboard Hook

A React custom hook that copies text to the clipboard and sets a state to provide user feedback. Useful for buttons that...

reacthooksclipboard
TypeScript
0
Jul 17
View snippet →

Memoize Function

Caches results of expensive function calls to improve performance when the same input is provided repeatedly. Example: m...

performanceutilities
JavaScript
0
Jul 17
View snippet →

Sleep / Delay Promise

A lightweight utility function for adding delays in async JavaScript/TypeScript code. Commonly used for testing and retr...

utilitiesasync
JavaScript
0
Jul 17
View snippet →

Fade In Animation

Smooth fade-in animation using CSS keyframes. Perfect for loading states, modal entrances, or any element that needs to...

cssanimationsui
CSS
0
Jul 16
View snippet →

Binary Search Algorithm

Efficient O(log n) search algorithm for sorted arrays. Returns the index of the target element or -1 if not found.

algorithmssearchperformance
JavaScript
0
Jul 16
View snippet →

UUID v4 Generator

Generates a random UUID v4 string. Useful for creating unique identifiers in frontend applications without external depe...

utilitiesuuidrandom
JavaScript
0
Jul 16
View snippet →

useIntersectionObserver Hook

React hook that tracks when an element enters or leaves the viewport. Perfect for lazy loading, infinite scroll, or trig...

reacthooksintersection-observer
TypeScript
0
Jul 16
View snippet →

Quicksort Algorithm

Efficient O(n log n) sorting algorithm using divide-and-conquer. Sorts array in-place with good average performance.

algorithmssortingpython
Python
0
Jul 16
View snippet →

Pulse Animation

Subtle pulsing animation for buttons, notifications, or status indicators. Creates a breathing effect that draws attenti...

cssanimationsui
CSS
0
Jul 16
View snippet →

Retry with Exponential Backoff

Retries a function with exponential backoff. Useful for API calls, database operations, or any operation that might fail...

utilitiesasyncerror-handling
JavaScript
0
Jul 16
View snippet →

LRU Cache Implementation

Least Recently Used cache with O(1) get and put operations. Automatically evicts oldest items when capacity is exceeded.

data-structurescachealgorithms
Python
0
Jul 16
View snippet →

Shake Animation

Attention-grabbing shake animation for error states, invalid inputs, or notifications. Creates a side-to-side wobble eff...

cssanimationserror-handling
CSS
0
Jul 16
View snippet →

Deep Clone Object

Creates a deep copy of an object, handling nested objects, arrays, and circular references. More robust than JSON.parse/...

utilitiesobjectsdeep-copy
JavaScript
0
Jul 16
View snippet →

Slide In Animation

Smooth slide-in animation from different directions. Perfect for sidebars, modals, or any element that needs to enter fr...

cssanimationsui
CSS
0
Jul 16
View snippet →

Number Formatter

Formats numbers with proper thousand separators and decimal places. Handles currencies, percentages, and large numbers.

utilitiesformattingnumbers
JavaScript
0
Jul 16
View snippet →

Trie (Prefix Tree)

Efficient prefix tree for string operations. Great for autocomplete, spell checkers, or any prefix-based search function...

data-structurestriesearch
Python
0
Jul 16
View snippet →

Bounce Animation

Playful bounce animation for buttons, icons, or interactive elements. Creates a spring-like effect that feels responsive...

cssanimationsui
CSS
0
Jul 16
View snippet →

Rate Limiter

Token bucket rate limiter to control API usage or prevent spam. Allows bursts but maintains average rate over time.

utilitiesrate-limitingperformance
JavaScript
0
Jul 16
View snippet →

Dijkstra Shortest Path

Finds shortest path between nodes in a weighted graph. Essential for routing, navigation, and network optimization probl...

algorithmsgraphshortest-path
Python
0
Jul 16
View snippet →

Typewriter Text Animation

Simulates typing effect for text. Perfect for hero sections, loading messages, or any text that needs to appear letter b...

cssanimationstext
CSS
0
Jul 16
View snippet →

Event Emitter Pattern

Lightweight event system for decoupled communication between components. Useful for custom events and pub-sub patterns.

patternseventspub-sub
JavaScript
0
Jul 16
View snippet →

Fibonacci Sequence Generator

Memory-efficient generator for Fibonacci numbers. Produces infinite sequence without storing all values in memory.

algorithmsgeneratorsmath
Python
0
Jul 16
View snippet →

Glow Effect Animation

Ethereal glow animation for buttons, cards, or special elements. Creates a pulsing light effect that adds premium feel.

cssanimationseffects
CSS
0
Jul 16
View snippet →
Page 1 of 2Next