Skip to content

Instantly share code, notes, and snippets.

View HarleySalas's full-sized avatar
🎯
Focusing

Harley Salas HarleySalas

🎯
Focusing
View GitHub Profile
@HarleySalas
HarleySalas / cache.ts
Created December 15, 2024 16:30
Combine React's cache with Next's unstable_cache, with a simpler API
import { cache as reactCache } from 'react'
import { unstable_cache as nextCache } from 'next/cache'
type CacheOptions = {
revalidate?: number | false
tags?: string[] | ((...args: any[]) => string[])
}
/**
* Combines React's cache (for deduping requests) with Next.js unstable_cache (for persistent caching).
@HarleySalas
HarleySalas / migrate.sh
Created June 7, 2024 10:18 — forked from Geczy/readme.md
Migrate Coolify to a new server
#!/bin/bash
# This script will backup your Coolify instance and move everything to a new server. Docker volumes, Coolify database, and ssh keys
# 1. Script must run on the source server
# 2. Have all the containers running that you want to migrate
# Configuration - Modify as needed
sshKeyPath="$HOME/.ssh/your_private_key" # Key to destination server
destinationHost="server.example.com"