Skip to content

Instantly share code, notes, and snippets.

name: PlanetScale Migration
on:
pull_request:
types: [opened, synchronize]
paths:
- packages/shared/adapters/prisma/schema.prisma
env:
PLANETSCALE_ORG: flightcontrol
PLANETSCALE_DB: fc-production
import { SubmitHandler, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
const validationSchema = z
.object({
firstName: z.string().min(1, { message: "Firstname is required" }),
lastName: z.string().min(1, { message: "Lastname is required" }),
email: z.string().min(1, { message: "Email is required" }).email({
message: "Must be a valid email",
const validationSchema = z
.object({
firstName: z.string().min(1, { message: "Firstname is required" }),
lastName: z.string().min(1, { message: "Lastname is required" }),
email: z.string().min(1, { message: "Email is required" }).email({
message: "Must be a valid email",
}),
password: z
.string()
.min(6, { message: "Password must be atleast 6 characters" }),
@magnetikonline
magnetikonline / README.md
Last active May 3, 2024 12:20
Install jq on macOS from source.

Install jq on macOS from source

Note: as of jq v1.7 the project offers pre-built native macOS releases for ARM64 based architechtures.

A quick n' dirty Bash script to install the following:

  • autoconf.
  • automake.
  • libtool
  • jq - from source.
@irgendwr
irgendwr / how-to-patch-parcel.md
Last active March 24, 2022 20:23
How to patch parcel (or basically any other npm package)

How to patch parcel

Patch to enable MV3 support

This shows how to apply this PR by @101arrowz to enable manifest v3 support. Please be aware that the patch is not production ready and might still have some issues.

Go to your project and add patch-package and postinstall-postinstall as devDependencies, then download the patch:

cd <path-to-your-project>
npm install -D patch-package
@jmatsushita
jmatsushita / README
Last active November 8, 2024 16:52
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@pffigueiredo
pffigueiredo / NestedKeyOf.ts
Created December 17, 2021 15:38
NestedKeyOf
type NestedKeyOf<ObjectType extends object> =
{[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object
? `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key]>}`
: `${Key}`
}[keyof ObjectType & (string | number)];
@Mefistophell
Mefistophell / RUST.MD
Last active October 21, 2024 19:14
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]
FROM ubuntu
RUN apt-get update && apt-get install -y openssh-client
RUN ssh-add -l 2>&1 | tee -a /tmp/ssh-agent.out || true
RUN cat /tmp/ssh-agent.out
@ercoppa
ercoppa / 80-keychron.rules
Last active February 25, 2023 18:30
K2 Keychron Ubuntu 18.04
SUBSYSTEMS=="input", ATTRS{name}=="Keychron K2", RUN+="/bin/sh -c 'echo 0 > /sys/module/hid_apple/parameters/fnmode'"