Skip to content

Instantly share code, notes, and snippets.

View ritmo-v0's full-sized avatar
☝️
君をハナセナイ🫴

Ritmo ritmo-v0

☝️
君をハナセナイ🫴
View GitHub Profile
@nivethan-me
nivethan-me / README.md
Last active May 21, 2025 13:24
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.
@creold
creold / textBlock.jsx
Created August 17, 2023 08:25
Converts selected point textFrames into a Block of Text. Adobe Illustrator script
//@target Illustrator
// script.name = textBlockLive.jsx;
// script.description = converts selected point textFrames into a Block of Text;
// script.required = one document with at least two selected Point Text frames;
// script.parent = carlos canto // 12/4/11; Update 03/15/205 added User Defined Units, cosmetics
// script.modification = sergey osokin // 08/12/23; keep text editable, sort texts by Y, cosmetics
// script.elegant = false;
function main() {
@aegrumet
aegrumet / decrypt-nextauth-jwe.go
Created December 4, 2022 01:24
Decrypt a NextAuth jwe from somewhere else
package main
import (
"crypto/sha256"
"fmt"
"io"
"github.com/lestrrat-go/jwx/v2/jwa"
"github.com/lestrrat-go/jwx/v2/jwe"
"golang.org/x/crypto/hkdf"
@shuding
shuding / swr-suspense-journey.md
Created September 14, 2021 12:18
The Journey of SWR and Suspense

The Journey of SWR and Suspense

We are trying to combine the idea of SWR ("stale-while-revalidate") and React Suspense together, and this write-up covers all our findings from this journey.

Background

When React Hooks launched, people started to rely on useEffect to initiate data fetching:

function User () {
@zlovatt
zlovatt / getFocusedComp.jsx
Last active September 20, 2022 03:55
Extendscript: Gets currently open comp from timeline, as opposed to selected comp in project panel
(function () {
/**
* Gets currently open comp from timeline, as opposed to
* selected comp in project panel
*
* @returns {CompItem | null} Active comp, or null if none
*/
function getFocusedComp() {
var activeItem = app.project.activeItem;
@wojtekmaj
wojtekmaj / .gitignore
Last active May 2, 2025 16:46
How to upgrade Yarn to Yarn Modern (v4 at the moment) seamlessly
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
@jcherven
jcherven / WindowsSystemFont-RestoreSegoeUI.reg
Created December 31, 2019 16:48
Restore Segoe UI as the Windows 10 system UI font (rolls back changes from companion script)
Windows Registry Editor Version 5.00
; This is a companion script for https://gist.github.com/jcherven/42b84294248674c29eb50cb711114315
; Rolls back changes made by the above registry patch script
; Don't edit this file; save and double click to run.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Segoe UI (TrueType)"="segoeui.ttf"
@chibicode
chibicode / README-Twemoji-React.md
Last active March 24, 2025 01:14
A dead simple React.js Twemoji component.

Twemoji + React

A dead simple React Twemoji component.

Requirements: twemoji

npm install --save twemoji
@ziluvatar
ziluvatar / token-generator.js
Last active April 8, 2025 08:12
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jsonwebtoken');
@liam-middlebrook
liam-middlebrook / GLDebugMessageCallback.c
Last active February 7, 2025 14:17
GL Debug Output Message Callback Guide
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or distribute
// this software, either in source code form or as a compiled binary, for any
// purpose, commercial or non-commercial, and by any means.
//
// In jurisdictions that recognize copyright laws, the author or authors of this
// software dedicate any and all copyright interest in the software to the
// public domain. We make this dedication for the benefit of the public at large
// and to the detriment of our heirs and successors. We intend this dedication