Skip to content

Instantly share code, notes, and snippets.

View cedricvidal's full-sized avatar

Cedric Vidal cedricvidal

View GitHub Profile
@cedricvidal
cedricvidal / rich2md.sh
Created April 9, 2026 01:06
Converts rich document in Clipboard to a Markdown document in clipboard
#!/bin/bash
# Convert rich text (HTML) from clipboard to Markdown and copy it back
# Usage: rich2md.sh (reads HTML from clipboard)
# echo "<h1>Hello</h1>" | rich2md.sh (reads HTML from stdin)
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
if [ -p /dev/stdin ]; then
# HTML piped via stdin
html=$(cat)
@cedricvidal
cedricvidal / md2rich.sh
Created April 9, 2026 01:04
Converts Markdown in clipboard to a rich document in clipboard
# Detect if input is piped; otherwise, use clipboard content
if [ -p /dev/stdin ]; then
input=$(cat)
else
input=$(pbpaste)
fi
# Convert Markdown to HTML (disable YAML parsing and table extensions to avoid issues with --- horizontal rules)
html=$(echo "$input" | pandoc -f markdown-yaml_metadata_block-simple_tables-multiline_tables-grid_tables -t html)
@cedricvidal
cedricvidal / yt-transcribe
Created March 9, 2026 05:19
Youtube Video transcription self contained uv script using `youtube-transcript-api`
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "rich-click",
# "youtube-transcript-api",
# ]
# ///
import json
@cedricvidal
cedricvidal / CLAUDE.md
Created January 30, 2026 02:34
Claude Code | Communication protocol

Communication Protocol

  • Respond directly. No unnecessary affirmations or filler phrases.
  • Use concise language. Aim for Cormac McCarthy's style.
  • Avoid apologies or excessive politeness.
  • Get to the point quickly.
  • Offer elaboration only if explicitly requested.
  • Maintain factual accuracy and helpfulness while being brief.
  • Use short sentences and paragraphs.
  • Eliminate redundant words.
@cedricvidal
cedricvidal / prompt.md
Created December 28, 2025 17:12
API Backend for iOS Mobile app prompt

Now that my iPhone mobile app is working as intented functionally, I need to persist the data of my users using my own backend API and database instead of locally on the iPhone.

Create a Next.js API backend for this iOS mobile app with the following stack and structure:

Tech Stack

  • Next.js with App Router (API routes only, no frontend pages needed)
  • Neon PostgreSQL database
  • Drizzle ORM for database access
  • NextAuth with Auth0 provider for authentication
  • TypeScript with strict mode
@cedricvidal
cedricvidal / mcp.json
Created December 15, 2025 18:12
How to capture stdin and stdout of an MCP server
{
"servers": {
"mcp-server": {
"type": "stdio",
"command": "bash",
"args": [
"-c",
"tee mcp-in.jsonl | mcp-server | tee mcp-out.jsonl"
]
}
@cedricvidal
cedricvidal / find_ios_simulator_files_storage.sh
Created November 23, 2025 23:06
Find File Provider Storage folder for Files app on iOS Simulator
#!/bin/bash
# Find the File Provider Storage folder for the Files app on the booted simulator
# Get the list of apps and find com.apple.DocumentsApp (Files app)
app_info=$(xcrun simctl listapps booted | grep -A 30 "com.apple.DocumentsApp")
if [ -z "$app_info" ]; then
echo "Error: Files app (com.apple.DocumentsApp) not found on booted simulator" >&2
exit 1
@cedricvidal
cedricvidal / commit.md
Last active September 16, 2025 19:07
Github commit message LLM instructions

Creates well-formatted commits with conventional commit messages and emoji.

Commit Format

<emoji> <description>

Rules:

  • Imperative mood ('add' not 'added')
  • First line <72 chars
@cedricvidal
cedricvidal / gist:6664c8248d695330c1267db419ec19a8
Created August 28, 2025 19:13
Task list unicode ○ Todo → ◐ In Flight → ● Done
○ Todo → ◐ In Flight → ● Done
@cedricvidal
cedricvidal / browse.chatmode.md
Created August 14, 2025 14:44
VS Code Copilot Playwright Chat Mode
description Description of the custom chat mode.
tools
playwright

Browse Mode

This chat mode is designed for web browsing and automation tasks using Playwright. When users request actions involving websites, this mode will automatically use Playwright to interact with web pages, scrape content, fill forms, and perform other browser automation tasks.

Purpose

  • Handle web browsing and automation requests