Skip to content

Instantly share code, notes, and snippets.

View mrmartineau's full-sized avatar
👋
Bah-weep-Graaaaagnah wheep ni ni bong

Zander Martineau mrmartineau

👋
Bah-weep-Graaaaagnah wheep ni ni bong
View GitHub Profile
@mrmartineau
mrmartineau / organise-downloads.md
Created October 24, 2026 20:32
Auto-organise your macOS Downloads folder by file type (Python + launchd)

Organise your macOS Downloads folder automatically

A small Python script that sorts loose files in ~/Downloads into folders by type (Images, Documents, Archives, and so on). A macOS launchd job runs it every day.

It uses only the Python standard library. No installs needed.

What it does

  • Moves each loose file into a folder named for its type.
  • Never touches existing folders.
@mrmartineau
mrmartineau / 1-setup.md
Last active September 18, 2026 03:06
Obsidian vault on a Raspberry Pi: obsidian-headless sync + FastMCP server for Claude (Tailscale Funnel, GitHub OAuth)

Obsidian notes (sync + MCP + Claude Code)

Two containers keep a live copy of the Obsidian vault on the Pi and let Claude read and write it:

  • obsidian-sync — the official obsidian-headless client (ob sync --continuous) in a community arm64 image. It joins Obsidian Sync as one more device, so the Pi's copy is always current, and anything Claude edits on the Pi shows up on the laptop and phone within seconds.
  • obsidian-mcp — a ~100-line FastMCP server (obsidian-mcp/server.py) with five tools (list_notes, read_note, search_notes, write_note, append_note) over that same folder. Login is GitHub OAuth, and only the GitHub user in MCP_ALLOWED_GITHUB_LOGIN gets through.

ZandersComponent

Usage

export { ZandersComponent } from './ZandersComponent'

<ZandersComponent>Some content</ZandersComponent>
@mrmartineau
mrmartineau / UserProvider.tsx
Created October 11, 2023 12:01
Supabase / Next 13 user prefs question
'use client';
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs';
import { ReactNode, createContext, useCallback, useContext } from 'react';
import { useRealtimeProfile } from '../hooks/useRealtime';
import { UserProfile } from '../types/db';
export type UseUpdateReturn = (action: UIStateAction) => void;
type UIState = UserProfile['settings'];
export type UIStateAction =
:root {
--padding-1: 0.25rem;
--padding-2: 0.5rem;
--padding-3: 0.75rem;
--padding-4: 0.75rem;
}
.button {
padding: var(--padding-1);
border: none;
[data-hotkey]:not(.selected)::after {
content: attr(data-hotkey);
color: var(--color-fg-muted);
background-color: var(--color-neutral-subtle);
margin-left: var(--primer-control-medium-gap, 4px);
border-radius: 2em;
font-family: monospace;
display: inline-block;
font-size: var(--primer-text-body-size-small, 12px);
font-weight: var(--base-text-weight-medium, 500);
BIG iOS URL SCHEME LIST
HAD TO MAKE A DROPBOX FILE BECAUSE THIS LIST WAS TOO LONG TO POST IN THE COMMENTS OR NOT MAKE THE WORKFLOW APP TAKE FOREVER TO READ IT.
☠JAILBREAK/SYSTEM APPS
--------------------------
activator://
itms-apps://
itms-services://
@mrmartineau
mrmartineau / HowToTest.md
Created March 28, 2020 23:16 — forked from tkrotoff/HowToTest.md
How I structure my tests

File structure

  • src/fooBar.js
  • src/fooBar.html
  • src/fooBar.scss
  • src/fooBar....
  • src/fooBar.test.js => npm run test
  • src/fooBar.test.e2e.js (if I have E2E tests - Puppeteer, Playwright...) => npm run test:e2e

Tests should not be separated from the source code (think autonomous modules).

@mrmartineau
mrmartineau / settings.json
Last active September 19, 2026 19:18
vscode settings.json
{
"[handlebars]": {
"editor.formatOnSave": false
},
"[markdown]": {
"editor.quickSuggestions": {
"comments": "off",
"other": "on",
"strings": "off"
}