Skip to content

Instantly share code, notes, and snippets.

javascript:(function() {
let url = window.location.href;
let match = url.match(/arxiv\.org\/abs\/(\d+\.\d+)/);
if (match && match[1]) {
let paperId = match[1];
let ar5ivUrl = `https://ar5iv.labs.arxiv.org/html/${paperId}`;
window.location.href = ar5ivUrl;
} else {
alert("This doesn't appear to be an arXiv paper page. Please use this bookmarklet on an arXiv paper page (e.g., https://arxiv.org/abs/2402.09171)");
}
///| Raw JavaScript Fetch API wrapper
extern "js" fn js_fetch(url : String, init : @js.Value) -> @js.Promise =
#| (url, init) => {
#| console.log("fetching", url, init);
#| return fetch(url, init)
#| }
///| JavaScript Fetch API wrapper
/// Usage:
/// ```

Investigating bugs related to prisma + opennext + auth-js

This is an investigation log written with the assumption that it will be translated in order to report it as an issue on GitHub.

Basically, I am responsible for trying to use prisma's experimental query-compiler, but the interfaces of opennext, prisma, and @auth/adapter-prisma all did not mesh, and the only solution to avoid the problem was to directly patch @auth/adapter-prisma.

What happened with @auth/adapter-prisma is a typical example, and there are two issues: how prisma itself will design its interface in the future, and how opennext should handle cjs.

Code where the problem occurred

// src/app/dash/AuthButtons.tsx
"use client";
import { signIn, signOut } from "next-auth/react";
export function SignInButton() {
return (
<div>
<button
type="button"
@mizchi
mizchi / plan-text-win.md
Created May 2, 2025 07:59
プレーンテキストは常に勝つ

草稿。あとで書く

Markdown の表現力は十分である

Markdown は(リッチテキストに比べると)表現が貧弱だとよく言われれる。自分もそこは同意する。 しかし、それがデメリットではない。Markdown の貧弱さは、意思伝達上の明確なメリットであると考える。Markdown の枠組みの中でテキストを組み立てることが、書き手・読み手に低負荷なまま意思伝達を可能にする。

制約は力である

markdown は元々はメール文面の慣習的なテキスト装飾が元になって発展した記法だ。プレーンテキストでも読める、という点に最も大きな価値があり、プログラミングエディタによる装飾や、GitHub上で閲覧するときの HTML 変換は補助ツールでしかない。

import {
startTransition,
Suspense,
use,
useActionState,
useEffect,
} from "react";
import { render, screen, fireEvent, act } from "@testing-library/react";
import { describe, it, expect } from "vitest";
import Counter from "./Counter";
/* wrangler dev main.ts --remote */
import { parse } from "cache-control-parser";
async function handleSwrTime(
request: Request,
env: Env,
ctx: ExecutionContext
) {
// mock response
const createNewResponse = () => {
/**
* アクセシビリティ自動修正スクリプト
*
* 以下の問題を検出し修正します:
* 1. コントラスト比の問題
* 2. aria-hidden属性がない装飾的要素
* 3. アクセシブルな名前がないボタン
* 4. ビューポートのuser-scalable=noとmaximum-scale問題
* 5. タイトル要素の欠如
* 6. html要素のlang属性の問題
/**
with wrangler.json
"assets": {
"binding": "assets",
"directory": "public",
"run_worker_first": true
},
*/
import tsBlankSpace from "ts-blank-space";
export default {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>esm.sh+react+tailwind demo</title>
<script type="importmap">
{
"imports": {