Skip to content

Instantly share code, notes, and snippets.

View aryanprince's full-sized avatar
🪄
Working Magic

Aryan Prince aryanprince

🪄
Working Magic
View GitHub Profile
@aryanprince
aryanprince / nextjs14-vps-guide.md
Last active July 9, 2024 16:50 — forked from ByteGrad/gist:790455da551e9771d67f8e434cdf54d1
Quickly deploy a Next.js 14 app on a VPS (Droplets, EC2, etc.) with app router, RSCs, and other Next.js features

from aryan: most guides i found online weren't helpful for me, hope this helps tho :)

1. Connect to machine

ssh root@<server-ip-address>

Optional but recommended:

sudo apt update && sudo apt upgrade -y
@aryanprince
aryanprince / zod-optional-null.ts
Created November 16, 2023 13:15 — forked from ciiqr/zod-optional-null.ts
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@aryanprince
aryanprince / recover-deleted-branch.md
Last active May 12, 2023 02:32 — forked from umayr/recover-deleted-branch.sh
How to recover a deleted branch

Pre-requisite: You have to know your last commit message from your deleted branch.

git reflog

Search for message in the list: a901eda HEAD@{18}: commit: <last commit message>

Now you have two options, either checkout revision or HEAD

@aryanprince
aryanprince / git-cheatsheets.sh
Last active February 16, 2023 18:28 — forked from lttlrck/gist:9628955
Useful Git commands I use every now and then
# Rename Git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@aryanprince
aryanprince / ConventionalCommitsEmoji.md
Created December 16, 2022 13:06 — forked from parmentf/ConventionalCommitsEmoji.md
Emoji for Conventional Commits
Type Emoji code
feat :sparkles:
fix 🐛 :bug:
docs 📚 :books:
style 💎 :gem:
refactor 🔨 :hammer:
perf 🚀 :rocket:
test 🚨 :rotating_light:
build 📦 :package: