Skip to content

Instantly share code, notes, and snippets.

View 17twenty's full-sized avatar

Nick Glynn 17twenty

View GitHub Profile
@17twenty
17twenty / typescriptproject.rules
Created August 13, 2025 00:43
Zed x Claude Rules
<role>
You go by the name Zeddy, an AI editor that creates and modifies web applications. You assist users by chatting with them and making changes to their code in real-time. You understand that users can see a live preview of their application in an iframe on the right side of the screen while you make code changes. Users can upload images to the project, and you can use them in your responses. You can access the console logs of the application in order to debug and use them to help you make changes.
Not every interaction requires code changes - you're happy to discuss, explain concepts, or provide guidance without modifying the codebase. When code changes are needed, you make efficient and effective updates to React codebases while following best practices for maintainability and readability. You are friendly and helpful, always aiming to provide clear explanations whether you're making changes or just chatting.
</role>
You follow these key principles:
1. Code Quality and Organization:
- Create small
@17twenty
17twenty / find_emails.sh
Created July 28, 2025 03:22
How to find all the emails belonging to a repo in Git
git clone https://github.com/${ORG}/${PROJECT}.git
git -C ${PROJECT} log | grep -E '^Author' | sort -u | grep -v "noreply.github.com"
@17twenty
17twenty / ReducerDemo.jsx
Created June 26, 2025 22:11
Example of using React with useReducer
import { useReducer } from 'react';
const initialFormState: FormState = {
name: '',
email: '',
isSubmitting: false,
isSubmitted: false,
submitError: null,
};
@17twenty
17twenty / schedule-demo.go
Created May 31, 2025 07:10
Pretty good example of using the functions of River Queue and (re)scheduling at defined times
package main
import (
"context"
"fmt"
"log"
"strconv"
"time"
"github.com/jackc/pgx/v5"
@17twenty
17twenty / example.json
Last active May 29, 2025 08:11
Create a Golang server from TypeAPI JSON
{
"operations": {
"user.getById": {
"description": "Get user profile by ID",
"method": "GET",
"path": "/users/{id}",
"arguments": {
"id": {
"in": "path",
"schema": {
@17twenty
17twenty / dragdropdemo.html
Last active June 6, 2024 03:20
Simple Demo to show drag and drop without jQuery
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.tailwindcss.com"></script>
<title>draggable test</title>
</head>
<body>
<nav><h1>Grello</h1></nav>
# Example routing with 3 apps
# We have three moving parts:
# Region specific API server (prefix papi.us.getfeewise.com)
# Region specific Dashboard App ( dashboard.getfeewise.com/us/* ) - tricky
# Region specific Customer App ( us.getfeewise.com )
# This makes s3proxy work
{
order s3proxy last
@17twenty
17twenty / httpsmiddleware.go
Created March 11, 2024 05:56
Middleware to Convert HTTP to HTTPS in Golang with X-ForwardedFor proto
package main
import (
"net/http"
"regexp"
"strings"
)
var (
xForwardedScheme = http.CanonicalHeaderKey("X-Forwarded-Scheme")
@17twenty
17twenty / jsonfiles.go
Last active February 17, 2024 05:42
jsonfile: Use `jsonfile` to persist a Go value to a JSON file.
// Copyright (c) David Crawshaw
// SPDX-License-Identifier: BSD-3-Clause
// Package jsonfile persists a Go value to a JSON file.
package jsonfile
import (
"bytes"
"encoding/json"
"fmt"
@17twenty
17twenty / index.html
Created February 11, 2024 02:22
Can You Lend Me - Tailwind design + HTMX + Vanilla JS to do what we want...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Can You Lend Me?</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
// formatNumber(n)
// formats a number 1234567 to 1,234,567