Skip to content

Instantly share code, notes, and snippets.

View heguro's full-sized avatar

heguro

View GitHub Profile
@heguro
heguro / mastodon-image-attachment-description-with-gemini.user.js
Last active May 25, 2025 02:53
Mastodonで投稿に添付する画像にGeminiで説明を付ける機能を追加するUserScript (Tampermonkeyが入っている場合、右のRawボタン押下でインストール)
// ==UserScript==
// @name Mastodon: 投稿に添付する画像にGeminiで説明を付ける機能を追加
// @namespace https://github.com/heguro
// @version 0.1.20250525
// @description try to take over the world!
// @author heguro/あすらも
// @grant GM.xmlHttpRequest
// @connect generativelanguage.googleapis.com
// @match https://fedibird.com/*
// @match https://mstdn.jp/*
@heguro
heguro / vscode-ms-postgresql-extension-preview-license-terms-unofficial-ja.md
Created May 24, 2025 03:58
VSCode PostgreSQL拡張機能 プレビュー版の利用規約 (Claude Sonnet 4 による非公式参考日本語訳, 2025-05-24 時点)

MICROSOFT ソフトウェア ライセンス条項 MICROSOFT POSTGRESQL EXTENSION FOR VISUAL STUDIO

原文: https://marketplace.visualstudio.com/items/ms-ossdata.vscode-pgsql/license (アーカイブ)


米国に居住している場合(または主たる事業所が米国にある企業の場合)は、以下の「拘束力のある仲裁およびクラスアクション放棄」の項をお読みください。紛争の解決方法に影響します。


@heguro
heguro / cosmosdb-cli-ja.mjs
Last active November 17, 2024 09:13
Azure Cosmos DB の簡易 CLI (Node.js)
// Licensed with CC0-1.0
import { promises as fs } from "fs";
import { CosmosClient } from "@azure/cosmos";
// デフォルトSQL
const DEFAULT_SELECT_SQL = "SELECT TOP 100 * FROM c ORDER BY c._ts DESC";
// 同時挿入件数 (max 100)。これ以上の件数は分割する
const BULK_UPSERT_COUNT = 20;
@heguro
heguro / nosaray-copy-all-note-ids-bookmarklet.js
Last active March 30, 2023 10:37
nosaray-copy-all-ids-bookmarklet (unofficial, temporary)
javascript:(()=>{const e=document.createElement("button");Object.assign(e.style,{position:"fixed",top:"0",left:"0",width:"20rem",height:"2rem"}),e.innerText="<< click to copy all IDs! >>",e.onclick=()=>{const o=[],t=window.prompt,n=document.execCommand;window.prompt=(e,t)=>{o.push(t)},document.execCommand=void 0;const c=[...document.querySelectorAll("[aria-label='copy note id']")];for(const e of c)e.click();window.prompt=t,document.execCommand=n;const m=document.createElement("textarea");m.value=o.join("\n"),document.body.append(m),m.select(),document.execCommand("copy"),m.remove(),e.remove()},document.body.append(e)})();
@heguro
heguro / keybase.md
Created October 16, 2021 19:31
keybase.md

Keybase proof

I hereby claim:

  • I am heguro on github.
  • I am heguro (https://keybase.io/heguro) on keybase.
  • I have a public key whose fingerprint is 668A B571 590F 1A59 627E DDE0 7DBE 54C7 A806 997B

To claim this, I am signing this object:

@heguro
heguro / cf-workers-http-to-https-backblaze.js
Created October 9, 2021 13:24
cloudflare workers script; http to https redirect, with /file/<bucket-name>/ deletion for backblaze b2. https://scrapbox.io/heguro/Backblaze_B2_+_Cloudflare
addEventListener("fetch", (event) => {
event.respondWith(
handleRequest(event.request).catch(
(err) => new Response(err.stack, { status: 500 })
)
);
});
/**
* @param {Request} request
/* Windowsなら %appdata%\thedesk\custom.css に記述 */
/* フォントサイズ 11px に合わせて設定 */
/* 狭い画面でプロフィール表示したとき「もっと」が隠れて下に進めないのを回避する */
/* アプデである程度の狭さなら隠れないようになったのでコメントアウト */
/* #my-data-nav > a.btn {
width: 3rem;
} */
/* 長文自動折り畳みを薄く */