Skip to content

Instantly share code, notes, and snippets.

View msichterman's full-sized avatar
🚨
I’m hiring! Email me for info [email protected] 🔥

Matt Sichterman msichterman

🚨
I’m hiring! Email me for info [email protected] 🔥
View GitHub Profile
# SETUP #
DOMAIN=example.com
PROJECT_REPO="[email protected]:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@steven-tey
steven-tey / youtube-channel.tsx
Last active July 9, 2024 03:41
YoutubeChannel RSC
import { BlurImage, YouTube } from "@dub/ui";
import { nFormatter } from "@dub/utils";
import { Eye, UserCheck, Video } from "lucide-react";
import { Suspense } from "react";
export function YoutubeChannel({ id }: { id: string }) {
return (
<Suspense fallback={<div className="not-prose grid gap-4"></div>}>
<YoutubeChannelRSC id={id} />
</Suspense>
@coryhouse
coryhouse / extensions.json
Created April 10, 2023 16:11
Put this file in .vscode to recommend extensions
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"GitHub.vscode-pull-request-github",
"ms-playwright.playwright",
"pflannery.vscode-versionlens",
"ZixuanChen.vitest-explorer"
]
@perkinsjr
perkinsjr / middleware.ts
Last active August 7, 2024 11:04
Using Clerk with Upstash for Middleware rate limiting and API Protection
import { getAuth, withClerkMiddleware } from "@clerk/nextjs/server";
import { NextResponse, NextFetchEvent } from "next/server";
import type { NextRequest } from "next/server";
import { Ratelimit } from "@upstash/ratelimit";
import { Redis } from "@upstash/redis";
// Add public paths for Clerk to handle.
const publicPaths = ["/", "/sign-in*", "/sign-up*", "/api/blocked"];
// set your rate limit.
name: PlanetScale Migration
on:
pull_request:
types: [opened, synchronize]
paths:
- packages/shared/adapters/prisma/schema.prisma
env:
PLANETSCALE_ORG: flightcontrol
PLANETSCALE_DB: fc-production
export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {