Skip to content

Instantly share code, notes, and snippets.

View heguro's full-sized avatar

heguro

View GitHub Profile
(async () => {
const sleep = ms => new Promise(r => setTimeout(r, ms));
const orig = {
writeText: navigator.clipboard?.writeText,
write: navigator.clipboard?.write,
};
let pending = null;
if (navigator.clipboard) {
navigator.clipboard.writeText = t => { pending = t; return Promise.resolve(); };
navigator.clipboard.write = async items => {
javascript:(async()%3D%3E%7B%22use%20strict%22%3Bif(window.__sakuScoresDl%3F.running)%7Bconsole.warn(%22%5Bsaku-scores-dl%5D%20%5Cu3059%5Cu3067%5Cu306B%5Cu5B9F%5Cu884C%5Cu4E2D%5Cu3067%5Cu3059%22)%3Breturn%7Dconst%20d%3D%7Brunning%3A!0%2Ccancelled%3A!1%2Ccancel()%7Bthis.cancelled%3D!0%7D%7D%3Bwindow.__sakuScoresDl%3Dd%2Cdocument.getElementById(%22saku-scores-dl-progress%22)%3F.remove()%3Bconst%20a%3Ddocument.createElement(%22div%22)%3Ba.id%3D%22saku-scores-dl-progress%22%2Ca.style.cssText%3D%5B%22position%3Afixed%22%2C%22left%3A12px%22%2C%22right%3A12px%22%2C%22bottom%3A12px%22%2C%22z-index%3A2147483647%22%2C%22display%3Aflex%22%2C%22align-items%3Acenter%22%2C%22gap%3A12px%22%2C%22padding%3A12px%22%2C%22border-radius%3A8px%22%2C%22background%3Argba(0%2C0%2C0%2C.85)%22%2C%22color%3A%23fff%22%2C%22font%3A14px%2F1.4%20sans-serif%22%2C%22box-shadow%3A0%202px%2012px%20rgba(0%2C0%2C0%2C.35)%22%5D.join(%22%3B%22)%3Bconst%20u%3Ddocument.createElement(%22span%22)%3Bu.style.cssText%3D%22flex%3A1%3Bmin-width%3A0%22%3Bcon
@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 / claude-ask.mjs
Last active July 27, 2026 10:38
codex-ask wrapper for codex exec JSON output
#!/usr/bin/env node
import { spawn } from "node:child_process";
const usage = `Usage:
claude-ask [options] < prompt
Options:
--model <model> Model to pass to Claude Code. Default: sonnet.
Aliases include haiku, sonnet, opus and fable.
A full model ID is also accepted.
@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)",