# Snippetly — Code Snippet Library > Snippetly is a platform for saving, organizing, and sharing code snippets. The public Code Snippet Library provides free, production-ready snippets across popular languages and frameworks. ## Library Index - [Code Snippet Library](/library): Browse all 40+ free code snippets organized by language and category. ## JavaScript Snippets - [Debounce Function](/library/debounce-function): Delay function execution until after a specified time. Useful for search inputs and resize events. - [Throttle Function](/library/throttle-function): Limit function execution to once per interval. Useful for scroll handlers and rate limiting. - [Deep Clone Object](/library/deep-clone): Create a deep copy of nested objects and arrays without reference issues. - [Array Chunk](/library/array-chunk): Split large arrays into smaller chunks for pagination or batch processing. - [Get Unique Array Values](/library/unique-array): Remove duplicate values from arrays using the Set data structure. - [Sleep Function](/library/sleep-function): Pause async execution using Promise and setTimeout. - [Format Number](/library/format-number): Format numbers with commas and locale-aware decimals using Intl.NumberFormat. - [Local Storage Helper](/library/local-storage-helper): Type-safe localStorage wrapper with JSON serialization and error handling. ## React Snippets - [useLocalStorage Hook](/library/use-local-storage): Sync React state with localStorage automatically. - [useFetch Hook](/library/use-fetch): Data fetching hook with loading and error states. - [useDebounce Hook](/library/use-debounce): Debounce a rapidly changing value inside a React component. - [useOnClickOutside Hook](/library/use-click-outside): Detect clicks outside a referenced DOM element. - [useWindowSize Hook](/library/use-window-size): Track browser window dimensions reactively. - [useKeyPress Hook](/library/use-key-press): Listen for specific keyboard key presses. - [usePrevious Hook](/library/use-previous): Access the previous value of any React state or prop. ## TypeScript Snippets - [Generic Result Type](/library/result-type): Type-safe error handling with Ok/Err without throwing exceptions. - [DeepPartial Utility Type](/library/deep-partial): Make all nested properties optional in TypeScript. - [Discriminated Union](/library/discriminated-union): Type-safe state modelling with discriminated union types. - [Type Guard Function](/library/type-guard): Runtime type checking with TypeScript type predicates. - [Readonly Deep Utility](/library/readonly-deep): Recursively freeze an object to prevent mutations. - [Enum-like Const Object](/library/const-enum): Enum alternative using const objects with as const assertion. ## CSS Snippets - [CSS Custom Properties Theme](/library/css-variables-theme): Light and dark mode theme with CSS custom properties. - [Responsive Typography Scale](/library/fluid-typography): Fluid font sizes using CSS clamp() across breakpoints. - [CSS Grid Auto Layout](/library/css-grid-auto): Auto-fit responsive grid without media queries. - [Smooth Scroll Animation](/library/smooth-scroll): Scroll-driven fade-in animations with IntersectionObserver and CSS. - [CSS Loading Spinner](/library/css-spinner): Pure CSS animated loading spinner. - [Glassmorphism Card](/library/glassmorphism): Frosted glass card effect using backdrop-filter. ## Node.js Snippets - [Async File Read/Write](/library/async-file-operations): Promise-based file operations with Node.js fs/promises. - [HTTP Request Helper](/library/http-request-helper): Lightweight fetch wrapper with timeout and error handling. - [Environment Variable Validator](/library/env-validator): Validate required environment variables at startup. - [Rate Limiter](/library/rate-limiter): In-memory token bucket rate limiter for APIs. - [Logger Utility](/library/logger): Structured logger with log levels and timestamps. - [Retry with Backoff](/library/retry-backoff): Retry failed async operations with exponential backoff. - [Express Error Handler](/library/express-error-handler): Centralised error handling middleware for Express.js. ## Python Snippets - [Read and Write Files Safely](/library/python-read-write-file): Safe Python file I/O using context managers and pathlib. - [List Comprehensions](/library/python-list-comprehension): Concise list, dict, and set comprehensions with filtering. - [Python Decorators](/library/python-decorators): Timer and retry decorators using functools.wraps. - [Dataclasses](/library/python-dataclasses): Type-annotated data models with @dataclass and field defaults. - [Context Managers](/library/python-context-manager): Class-based and generator-based context managers. ## Tailwind CSS Snippets - [Responsive Navbar](/library/tailwind-responsive-navbar): Mobile-first navigation bar with hamburger menu using Alpine.js. - [Card Component](/library/tailwind-card-component): Image card with badge and group hover effects. - [Gradient Hero Section](/library/tailwind-gradient-hero): Landing page hero with gradient background and CTA buttons. - [Pricing Table](/library/tailwind-pricing-table): Three-tier pricing table with highlighted popular plan. - [Form Inputs](/library/tailwind-form-input): Text input, select, textarea, and error state components. ## Utility Snippets - [Validate Email](/library/validate-email): Email validation with regex, MX record check pattern, and error messages. - [Currency Formatter](/library/currency-formatter): Format monetary values with locale and currency symbol. - [Slugify String](/library/slugify): Convert strings to URL-safe slugs. - [Parse Query String](/library/parse-query-string): Parse and stringify URL query parameters. - [Generate UUID](/library/generate-uuid): Generate RFC-4122 compliant UUIDs without dependencies. - [Truncate Text](/library/truncate-text): Truncate strings by character count or word count with ellipsis. ## About Snippetly Snippetly is a tool for developers to save, organize, and share code snippets with their teams. The public library is a free resource — all snippets are production-ready and copy-paste friendly. - Website: https://snippetly.xyz - Library: https://snippetly.xyz/library - Contact: Available via the website