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.
YouTube
Get channel statistics.
Update MDX Meta
Change last updated time.
Stripe
Accept a payment.
Sticky Nav
Create a fixed navbar.
Spotify
Show what you're listening to.
Spotify
List your top tracks.
Slack
Create a slash command.
SendGrid
Send an email to a user.
Search
React Context hook for search values.
Revue
Subscribe to a newsletter.
Revue
Get all subscribers.
Python Decorator with Parameters
Add parameters to Python decorator
MDX Table of Contents
For use with Next.js.
Mailgun
Send an email to a user.
Mailchimp
Subscribe to a newsletter.
Loading Progress
React Hook for nprogress.
Gumroad
Retrieve all sales for a user.
Gumroad
Get all sales of a product in dollars.
Gradient Border
Create a gradient border with CSS.
Google Sheets
Create an entry in a sheet.
Google Analytics
Page views over a given range.
Firebase
Read data from Realtime Database.
Fetch Proxy
Enhance fetch with proxy function in Next.js SSR mode
useEmailQueryParam()
Parse an email from a URL.
CRUD API Route
For use with Next.js.
Check elements existence in two arrays
Check whether elements in one array exist in another array
Buttondown
Subscribe to a newsletter.
Buttondown
Get all subscribers.