Skip to content

Instantly share code, notes, and snippets.

View tylerforesthauser's full-sized avatar

Tyler Forest-Hauser tylerforesthauser

View GitHub Profile
@anthonynsimon
anthonynsimon / setup.sh
Last active April 18, 2025 12:03
setup.sh: secure an Ubuntu server for Kamal. More details: https://getdeploying.com/guides/secure-ubuntu-server
#!/usr/bin/env bash
# Applies common security measures for Ubuntu servers. Run it before doing the inital deploy with basecamp/kamal
#
# Afterwards, you'll only be able to SSH into the server as 'nonroot', eg. [email protected]
#
# So add this to your Kamal deploy.yml:
# ```
# ssh:
# user: nonroot
@f1shy-dev
f1shy-dev / best_SAE_trick.md
Last active April 24, 2025 04:55
sneakyf1shy's apple intelligence tutorial

the sneakyf1shy apple intelligence tutorial v2.0

Warning

This is patched as of iOS/iPadOS 18.1 DevBeta 5. If you want to follow this, stay on Beta 4.

This actually downloads the models, and is NOT just new SiriUI. Hence, this process is complex and probably not worth it.

⚠️ Prepare to be disappointed and annoyed, and have your time wasted! ⚠️

  • What does not work: Writing Tools, Memories, Reduce Interruptions, Image Eraser and other tools that are within official Apple Intelligence on supported devices.
@Shpigford
Shpigford / .cursorrules
Last active April 25, 2025 01:22
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
"use client";
import React, { useEffect, useId, useState } from "react";
import { motion, AnimatePresence, MotionConfig } from "framer-motion";
import { PlusIcon, XIcon } from "lucide-react";
import { createPortal } from "react-dom";
import { cn } from "@/lib/utils";
import { buttonVariants } from "../button";
const transition = {
@tinrab
tinrab / action.ts
Last active May 5, 2024 18:59
Calling server actions in client form components
'use server';
export const signUpAction = apiAction(
signUpFormSchema,
async (data): Promise<{ }> => {
// ...
},
);
// src/app/client.ts
import { z } from "zod";
import { api } from "./api/routes";
import {
UseMutationOptions,
UseMutationResult,
UseQueryOptions,
UseQueryResult,
useQuery,
} from "@tanstack/react-query";
@diegohaz
diegohaz / query.ts
Last active November 30, 2023 21:07
import {
queryByLabelText,
queryByRole,
queryByText,
} from "@testing-library/dom";
import type { ByRoleOptions, Matcher } from "@testing-library/dom";
const roles = [
"alert",
"alertdialog",
// Turn all HTML <a> elements into client side router links, no special framework-specific <Link> component necessary!
// Example using the Next.js App Router.
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';
function useLinkHandler() {
let router = useRouter();
useEffect(() => {
let onClick = e => {
@alexanderson1993
alexanderson1993 / AlertDialogProvider.tsx
Created April 2, 2023 19:07
A multi-purpose alert/confirm/prompt replacement built with shadcn/ui AlertDialog components.
"use client";
import * as React from "react";
import { Input } from "@/components/ui/Input";
import { Button } from "@/components/ui/Button";
import {
AlertDialog,
AlertDialogContent,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogDescription,
import CredentialsProvider from 'next-auth/providers/credentials'
import { NuxtAuthHandler } from '#auth'
export default NuxtAuthHandler({
// secret needed to run nuxt-auth in production mode (used to encrypt data)
secret: useRuntimeConfig().authSecret,
providers: [
CredentialsProvider.default({
name: 'Directus',