Skip to content

Instantly share code, notes, and snippets.

///|
fnalias @svg.node as svg_node
///|
fn[M] common_svg_node(
tag_name : String,
new_attrs : Array[@svg.Attribute[M]],
style~ : Array[String]?,
class~ : String?,
id~ : String?,
const OPENAI_API_KEY_PATH = "%_%=k";
const TEMP_PKCE_VERIFIER = "%_%=pk";
function base64UrlEncode(array: Uint8Array): string {
const base64 = btoa(String.fromCharCode(...array));
return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
}
type LoginState =
| {
/**
Discord Auth for Cloudflare Access
based on https://github.com/Erisa/discord-oidc-worker
# Create discord application
- Get client id and secret
- Set redirect URL to `https://<cloudflare-name>.cloudflareaccess.com/cdn-cgi/access/callback`
///|
test "String to Bytes conversion" {
fn find_index(url : Bytes) -> Int? {
url.find("://")
}
let url = "https://www.example.ocom"
let url_bytes : Bytes = "https://example.com"
inspect(url.find("://"), content="Some(5)")
inspect(find_index("https://example.com"), content="Some(5)")

andromeda のコードを読んで、Claude Code にあってる?って確認させたもの

https://github.com/tryandromeda/andromeda

Andromeda とは

Parser に oxc, Runtime に Nova をベースにした、JS処理系。

位置づけとしては Node/Deno/Bun のようなもの。

@mizchi
mizchi / mbts.ts
Created August 11, 2025 16:41
Moonbit(JS Backend) - TypeScript Template Generator
/**
* mbts - Moonbit JS Backend Project generator
* Install on deno and usages
* deno install -Afg mbts.ts
*
* # generate boilerplate
* $ mbts new mylib
* $ mbts new mylib --name mizchi/newpkg
* $ mbts new mylib --lib
* $ mbts new mylib --deno

gpt-oss:20b に「SF小説を書いて」という曖昧な指示を出したもの。 論理的試行やSFとして面白いかどうかはあまり判断していない。文体や技巧を評価している。

  • 生成
  • 読者としてレビューして、それを反映
  • 星雲賞の評価員として受賞に足るかをレビューして、それを反映

という過程を踏んだ

// serena から切り出したもの
export interface SystemPromptParams {
contextSystemPrompt: string;
modeSystemPrompts: string[];
}
export const systemPrompt = ({
contextSystemPrompt,
modeSystemPrompts,
$ mise ls | grep claude-code
npm:@anthropic-ai/claude-code 1.0.17
npm:@anthropic-ai/claude-code 1.0.18
npm:@anthropic-ai/claude-code 1.0.21
npm:@anthropic-ai/claude-code 1.0.22
npm:@anthropic-ai/claude-code 1.0.24
npm:@anthropic-ai/claude-code 1.0.25
npm:@anthropic-ai/claude-code 1.0.27
npm:@anthropic-ai/claude-code 1.0.29
npm:@anthropic-ai/claude-code 1.0.30

XS言語の新構文設計

WIP https://github.com/mizchi/x-lang-proto2

設計原則

  1. 最小限の構文: letキーワードは=があれば不要
  2. 順序独立: do式以外では定義の順序は関係ない
  3. 統一的なスコープ: let inwhereを統合した設計