From: Cameron Otsuka Date: Fri, 4 Sep 2026 00:20:48 +0000 (-0700) Subject: add mph 2026-36, remove right-sizing script X-Git-Url: https://git.otsuka.systems/?a=commitdiff_plain;h=7284b2ff59736743da5b9f73ba02994be29042ce;p=cotsuka.github.io add mph 2026-36, remove right-sizing script --- diff --git a/content/podcasts/mine-print-hash-2026-36.mdx b/content/podcasts/mine-print-hash-2026-36.mdx new file mode 100644 index 0000000..4780007 --- /dev/null +++ b/content/podcasts/mine-print-hash-2026-36.mdx @@ -0,0 +1,28 @@ +--- +type: video +title: "Quantitative Credit Guidance: G20 Says Growth is the Only Way Out" +date: 2026-09-03 +modified: 2026-09-03 +publication: + name: Mine Print Hash + issue: 2026 + volume: 36 +tags: + - macro +posse: + 𝕏: https://x.com/MinePrintHash/status/2095666868392747451 + YouTube: https://www.youtube.com/watch?v=mjQ6r0C7A4U + Substack: https://www.mineprinthash.com/p/quantitative-credit-guidance-g20 + LinkedIn: https://www.linkedin.com/posts/cotsuka_the-g20s-asheville-message-was-blunt-growth-share-7501432836768288768-f7uW/ +--- + +import YouTube from '@components/youtube.astro'; + +The G20's Asheville message was blunt: growth is the only way out. + +The emerging playbook points Matt Dines toward "Quantitative Credit Guidance" instead of quantitative easing: private-sector lending, reindustrialization, and a broader sovereign debt restructuring agenda. + + diff --git a/package.json b/package.json index 9fd374e..d95b869 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "prepare": "simple-git-hooks" }, "simple-git-hooks": { - "pre-commit": "bun scripts/rightsize-images.mjs --staged && bun x --bun lint-staged && bun run check" + "pre-commit": "bun x --bun lint-staged" }, "lint-staged": { "*.{ts,tsx,astro,js,mjs,cjs}": [ diff --git a/scripts/rightsize-images.mjs b/scripts/rightsize-images.mjs deleted file mode 100644 index 2aa4d17..0000000 --- a/scripts/rightsize-images.mjs +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Right-sizes source images before they enter the repository. - * - * Any raster image wider than MAX_WIDTH is downscaled in place to MAX_WIDTH. - * This caps Astro's generated variant count at our breakpoints (2x of the - * 640px content column) so oversized originals never enter the srcset. - * - * Usage: - * bun scripts/rightsize-images.mjs Scan all of content/ + src/assets/ - * bun scripts/rightsize-images.mjs --staged Process only staged images (used by - * the pre-commit hook); resized files - * are re-staged automatically. - * - * Scope: content/ and src/assets/ (the images Astro processes). Files in - * public/ are served verbatim, so resizing them here would change what ships; - * handle those manually if needed. - * - * Quality: PNG stays lossless. JPEG/WebP are re-encoded at high quality — - * the only intended loss beyond resampling is negligible recompression. - */ -import { readdirSync, renameSync, statSync } from 'node:fs'; -import { join } from 'node:path'; -import { execFile } from 'node:child_process'; -import { promisify } from 'node:util'; -import sharp from 'sharp'; - -const execFileAsync = promisify(execFile); - -const MAX_WIDTH = 1280; -const DIRECTORIES = ['content', 'src/assets']; -const EXTENSIONS = /\.(png|jpe?g|webp)$/i; - -const ENCODE_OPTIONS = { - jpeg: { quality: 95, mozjpeg: true }, - webp: { quality: 92 }, - png: {}, // lossless -}; - -const stagedMode = process.argv.includes('--staged'); - -async function stagedImages() { - const { stdout } = await execFileAsync('git', [ - 'diff', - '--cached', - '--name-only', - '--diff-filter=ACMR', - ]); - return stdout - .split('\n') - .map((line) => line.trim()) - .filter( - (file) => - file && - EXTENSIONS.test(file) && - DIRECTORIES.some((dir) => file.startsWith(`${dir}/`)), - ); -} - -function* scanAll() { - for (const dir of DIRECTORIES) { - let entries; - try { - entries = readdirSync(dir); - } catch { - continue; // directory does not exist yet - } - for (const entry of entries) { - const path = join(dir, entry); - if (statSync(path).isDirectory()) yield* scanDir(path); - else if (EXTENSIONS.test(entry)) yield path; - } - } -} - -function* scanDir(dir) { - for (const entry of readdirSync(dir)) { - const path = join(dir, entry); - if (statSync(path).isDirectory()) yield* scanDir(path); - else if (EXTENSIONS.test(entry)) yield path; - } -} - -const files = stagedMode ? await stagedImages() : [...scanAll()]; - -let scanned = 0; -const resized = []; - -for (const file of files) { - scanned++; - const { width, format } = await sharp(file).metadata(); - - if (!width || width <= MAX_WIDTH || !(format in ENCODE_OPTIONS)) continue; - - const tmp = `${file}.rightsize.tmp`; - await sharp(file) - .resize({ width: MAX_WIDTH }) - .toFormat(format, ENCODE_OPTIONS[format]) - .toFile(tmp); - renameSync(tmp, file); - - resized.push(file); - console.log(`resized ${file} -> ${MAX_WIDTH}px wide`); -} - -if (stagedMode && resized.length > 0) { - await execFileAsync('git', ['add', '--', ...resized]); -} - -console.log( - resized.length === 0 - ? `rightsize: all ${scanned} images within ${MAX_WIDTH}px` - : `rightsize: resized ${resized.length} of ${scanned} images`, -);