Skip to content

Instantly share code, notes, and snippets.

View heguro's full-sized avatar

heguro

View GitHub Profile
@heguro
heguro / ブラウザごとのJPEG読み込み挙動の違い.md
Created July 4, 2026 05:14
ブラウザごとのJPEG読み込み挙動の違い (20260704 macOS 26.5.1, fable5記)

ブラウザごとのJPEG読み込み挙動の違い(今回の実測 + 既知情報の整理)

実測結果(stage1デコードプローブ: createImageBitmap → canvas → getImageData、OpenCV不使用)

IMG_4620の各バリアント(同一写真、ICCプロファイル3種)を3エンジンで測定した結果です。

入力のICCプロファイル Edge/Chromium WebKit (Safari系) Firefox
Display P3 (iOS Safariアップロード / HEIC) sRGBへ正しく変換(PILのICC→sRGB変換とほぼ一致、差 mean 0.021/max 1) 同じくPIL-sRGB風だがEdgeとはバイト非同一(±2 LSB) ICC完全無視=cv2.imreadとバイト一致
Apple Wide Color Sharing Profile (macOS写真.app「互換性優先」書き出し) ほぼ生値(変換がほぼかからない: 対cv2 mean 0.21-0.23/max 1。PIL-sRGBとは mean 2.1-2.4/max 9-10も離れる) ほぼ生値(±1-2) 生値=cv2一致
@heguro
heguro / codex-ask.mjs
Last active July 5, 2026 13:24
codex-ask wrapper for codex exec JSON output
#!/usr/bin/env node
import { spawn } from "node:child_process";
const usage = `Usage:
codex-ask [options] < prompt
Options:
--model <model> Model to pass to codex exec. Default: gpt-5.4.
Pass the model name, e.g.:
gpt-5.5 (roughly Opus-class)
@heguro
heguro / 膨張リチウムイオンバッテリーの処分法_包括的統合レポート.md
Last active May 25, 2026 06:05
膨張リチウムイオンバッテリーの処分法 包括的統合レポート(2026/5時点)。Xで「膨張したバッテリーは塩水で放電するといい」という投稿を見て疑い調査したもの。GPT-5.5 ProとClaude Opus 4.7のDeep Researchを中心に複数回調べ、Claude Opus 4.6でまとめた

膨張リチウムイオンバッテリーの処分法 — 包括的統合レポート

本レポートは、公開されている公的機関文書・業界団体資料・メーカー公開情報・査読論文等を照合し、膨張リチウムイオンバッテリーの「塩水放電処分法」の是非と正しい処分手順を包括的に整理したものである。


総括結論(TL;DR)

本レポートの確認時点:2026年5月。法制度・メーカー回収・自治体運用は変わりうるため、最新情報は各機関の公式サイトを参照のこと。

@heguro
heguro / how-to-extract-chatgpt-deep-research-citation-urls-quick-reference.md
Last active May 24, 2026 14:38
How to Extract ChatGPT Deep Research Citation URLs from React Props with chrome-devtools MCP (written by GPT-5.4 with chrome-devtools-mcp@1.0.1)

Quick Reference: Extract ChatGPT Deep Research Citation URLs with chrome-devtools

Goal

Extract the real citation URLs from a ChatGPT deep research page by reading React props, then map them back to exported markdown cite blocks.

Core Idea

  • Do not treat visible citation numbers and exported markdown cite blocks as the same thing.
  • Use any rendered citation badge as the entry point.
@heguro
heguro / 補足訂正ノート_LiBバッテリー膨張時処分_Geminiレポート併読用.md
Last active May 25, 2026 06:17
Gemini 3.5 Flash Deep Researchが生成したレポートへの補足訂正としてClaude Opus 4.7に書いてもらったもの

補足・訂正ノート — 「リチウムイオンバッテリー膨張時における塩水放電法および土中埋設の技術的妥当性と安全リスク評価」(Gemini 3.5 Flash Deep Research)について

  • 作成日: 2026-05-24
  • 対象: Gemini 3.5 Flash Deep Research レポート (生成した会話)(同題、参照元33件+その他参照8件)
  • 目的: 全参照元を一次資料(PDF・公式サイト・査読論文)まで遡って確認した結果、原典の記述と乖離する箇所・原典が直接反駁する箇所が複数見つかったため、レポートと併読する読者向けに事実関係を補正する
  • 間違えてGeminiが出したと思われる会社名を伏せました

Investigation: When was microsoft/typescript-go#1389 fixed?

(written by opus 4.6)

Issue

microsoft/typescript-go#1389"lsp(vscode): panic when formatting a file with multi-byte characters and trailing 2+ newlines"

A panic occurred when using textDocument/formatting via the LSP on a file containing multi-byte characters (e.g. , 🐈, Japanese characters) and ending with 2+ newlines:

Set-StrictMode -Version 3.0
Add-Type -AssemblyName System.Windows.Forms
Add-Type -TypeDefinition @'
using System;
using System.Runtime.InteropServices;
public static class Win32 {
public static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
public static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
public const uint SWP_NOSIZE = 0x0001;
@heguro
heguro / opencode.jsonc
Created September 20, 2025 23:25
OpenCode 既存Providerのカスタムモデル指定例
// ~/.config/opencode/opencode.jsonc またはプロジェクトフォルダ直下の opencode.jsonc に記載
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openrouter": {
"models": {
// https://opencode.ai/docs/providers/#openrouter
"x-ai/grok-4-fast:free": {
// ↓ https://github.com/sst/models.dev/pull/213/files がマージされたら指定不要
"name": "Grok 4 Fast (free)",
@heguro
heguro / claude-code-jsonl-to-md.mjs
Created July 30, 2025 11:40
claude codeの会話履歴から無くてもいい部分を除いてMarkdown出力
/* eslint-disable no-undef */
/* eslint-disable tsdoc/syntax */
import { execSync } from "child_process";
import fs from "fs";
import { stringify } from "javascript-stringify";
// import path from "path";
// Read/Grepツールのidを記録するためのセット
const skipToolResultIds = new Set();