Skip to content

Instantly share code, notes, and snippets.

View dantman's full-sized avatar

Daniel Friesen dantman

View GitHub Profile
@dantman
dantman / nvm-manage.sh
Created April 20, 2025 20:48
A Bash script that automatically manages Node.js versions with NVM, keeping specified versions updated and removing unused ones.
#!/bin/bash
# Authored by: Kagi Assistant
# https://kagi.com/assistant/6995ca12-6df0-4f88-9d91-848e993a2870
# Source NVM to make it available to the script
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Check if NVM is available
if ! command -v nvm &> /dev/null; then
@dantman
dantman / WorkspaceSetup.prompt.md
Created May 30, 2025 17:44
Daniel's preferred workspace setup as a prompt
mode
agent

We are in the folder for a new project. Your job is to set up the workspace according to my usual preferences. Here are the requirements:

Add the following scripts to package.json

{
	"scripts": {
@dantman
dantman / copilot-instructions.md
Created June 4, 2025 14:05
Prompt to automate Drizzle migration process

An AI agent should attempt to run cli commands on behalf of the user when they are needed.

Before running any command as a terminal command, the AI agent should check if there is a relevant MCP (Machine Command Protocol) command available in the project. If there is, it should use that instead of running a terminal command directly.

Check type safety using the npm run typecheck task instead of tsc directly.

Drizzle

The database schema can be found in schema.ts. For timestamp and date column types use { mode: "date" } to give the column the Date type.

{
"name": "typefabric-management-app",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "typefabric-management-app",
"version": "0.1.0",
"dependencies": {
@dantman
dantman / README.md
Last active July 21, 2025 00:10
Reusable "definedForm" boilerplate

📝 React + Zod + React Hook Form Boilerplate

A reusable pattern for building type-safe, validated forms in React using:

  • react-hook-form: For ergonomic form state management.
  • zod: For schema-based validation and type inference.
  • TypeScript: For full type safety throughout your forms.

Features

  • defineForm(schema): Generates a custom hook for your form, automatically wiring up Zod validation and type inference.