Skip to content

Instantly share code, notes, and snippets.

View panphora's full-sized avatar
🍊
building clay in software form: hyperclay.com

David Miranda panphora

🍊
building clay in software form: hyperclay.com
View GitHub Profile
<!doctype html><html lang="en" style="color-scheme: dark light;">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
Vanilla HTML + CSS (+ JS) "password strength" app
</title>
<style>
form
{ width: max-content
; padding: 1em
; margin: 1em

Git Hook: Filter Claude Co-Author Attribution

This global git hook automatically removes Claude Code's Co-Authored-By: line from all commit messages across all repositories.

Installation

  1. Configure git to use a global hooks directory:
mkdir -p ~/.git-hooks
const PasswordView = Backbone.View.extend({
events: {
'input input': 'updatePassword'
},
updatePassword(e) {
const pwd = e.target.value;
const reqs = [
['8+ characters', pwd.length >= 8],
['12+ characters', pwd.length >= 12],
const { useState } = React;
const PasswordStrength = () => {
const [password, setPassword] = useState('');
const requirements = [
{ label: '8+ characters', check: (pwd) => pwd.length >= 8 },
{ label: '12+ characters', check: (pwd) => pwd.length >= 12 },
{ label: 'Lowercase letter', check: (pwd) => /[a-z]/.test(pwd) },
{ label: 'Uppercase letter', check: (pwd) => /[A-Z]/.test(pwd) },
@panphora
panphora / html-email-guide.md
Created September 11, 2025 01:23
A guide for writing HTML emails

HTML Email Development Guide

Single-Column Layout Focus

This guide is optimized for single-column email layouts like the insight emails template in this repository. Single-column layouts are the most reliable, accessible, and mobile-friendly approach for email design.

Table of Contents

  1. Overview
  2. Essential Meta Tags
  3. Document Structure
  4. CSS Best Practices

Simple Markdown Blog for Cloudflare Pages

A minimal static blog generator that converts markdown files into a single HTML page. Perfect for hosting on Cloudflare Pages.

How It Works

This build system:

  1. Reads all .md files in your directory
  2. Converts them to HTML using the marked library
  3. Inserts them into your HTML template using JavaScript template literals
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Notepad</title>
<script src="https://hyperclay.com/js/hyperclay-starter-kit.js" type="module"></script>
</head>
<body>
<div edit-mode-contenteditable>My Notepad</div>

Local ES Modules Without a Server

Why Use This?

Sometimes you just want to write modular JavaScript without the overhead of:

  • Starting a development server
  • Setting up a build process
  • Dealing with CORS issues on file:// protocol
  • Installing Node.js or any tooling
@panphora
panphora / Identify Elements Causing Horizontal Overflow.js
Created December 27, 2024 03:41
Identify Elements Causing Horizontal Overflow
(() => {
// Remove any existing highlights
document.querySelectorAll('.overflow-highlight').forEach(el => {
el.style.outline = '';
el.classList.remove('overflow-highlight');
});
// Get viewport width
const viewportWidth = document.documentElement.clientWidth;
import React, { useState } from 'react';
const useEditable = (initialText) => {
const [text, setText] = useState(initialText);
const [isEditingDraft, setIsEditingDraft] = useState(false);
const [draftText, setDraftText] = useState(text);
const enableEditingDraft = () => {
setDraftText(text);
setIsEditingDraft(true);