Skip to content

Instantly share code, notes, and snippets.

View nivethan-me's full-sized avatar
🎯
Focusing on how to solve my problems using software

Nivethan nivethan-me

🎯
Focusing on how to solve my problems using software
View GitHub Profile
@nivethan-me
nivethan-me / README.md
Last active September 4, 2024 06:41
Add Cloudflare Custom Domain to Vercel

Add Cloudflare custom domain to Vercel

  1. Sign up and sign in to Cloudflare https://dash.cloudflare.com/sign-up.
  2. In your Cloudflare dashboard, select the Domain Registration > Register Domains tab.
  3. Search for your favorite domain and purchase it. In my case, I purchased the domain https://nivethan.me/ for my portfolio.
  4. Sign in to Vercel and go to your dashboard, where you can see all your projects in the Overview tab.
  5. Click on a project and on the top right, select Domains.
  6. Type your domain in the text box, e.g., nivethan.me, and click Add.
  7. Select the recommended option: Add www.nivethan.me and redirect nivethan.me to it.
  8. Vercel will show an invalid configuration under your domains and display the relevant A record IP under nivethan.me and a CNAME IP under www.nivethan.me. These need to be set up on Cloudflare to make it work.
@nivethan-me
nivethan-me / README.md
Last active July 13, 2024 06:05
Setup a Next.js 13 project with Eslint + Prettier with automatic tailwind class sorting
@williamyeny
williamyeny / wait-for-element.ts
Created December 14, 2022 00:02
Writen for a Chrome extension. It checks for a specific element on the page and calls a callback when it's found.
// Writen for a Chrome extension. It checks for a specific element on the page and calls a callback when it's found.
// Returns an element and all its child elements.
const getAllElements = (node: Node): Element[] => {
if (!(node instanceof Element)) {
return [];
}
const nodes = [node];
if (node.childNodes) {
nodes.push(...[...node.childNodes].flatMap(getAllElements));