Code Snippets
These are a collection of code snippets I've used in the past and saved. Some are Serverless Functions, which include set up instructions. Others are anything from random CSS snippets to Node.js scripts.
Card rotating on hover
Creates a two sided card which rotates on hover.
Copy to clipboard
Copies a string to the clipboard. Only works as a result of user action
CRUD API Route
For use with Next.js.
Get images
Fetches all images from within an element and puts them into an array.
hashBrowser
Creates a hash for a value using the SHA-256 algorithm. Returns a promise.
HashNode
Creates a hash for a value using the SHA-256 algorithm. Returns a promise.
Json to csv
Converts an array of objects to a comma-separated values
Menu on image hover
Displays a menu overlay when the user hovers over the image.
Mouse cursor gradient
A hover effect where the gradient follows the mouse cursor.
Parse cookie
Parses an HTTP Cookie header string, returning an object of all cookie name-value pairs.
Revue
Get all subscribers.
Revue
Subscribe to a newsletter.
Spotify
Show what you're listening to.
Sticky Nav
Create a fixed navbar.
Tailwind CSS Snippets
🌟 Unleash web magic with Tailwind CSS, a lightning-fast framework! 💪 Dazzling snippets.
Navigator
Checks if the client is online or offline.
Use SSR
Checks if the code is running on the browser or the server.
UUID genertor
Generates a UUID in a browser.