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