Skip to content

Instantly share code, notes, and snippets.

@mizchi
mizchi / remix-code-reading-memo.md
Last active September 16, 2024 11:26
Remix 本体のコードを読んだメモ

Code Reading のメモ

7dece0e 時点

目標

  • vite dev 起動時のシーケンスを確認
  • react-router になるとはどういうことか

setup

@mizchi
mizchi / vitest.workspace.ts
Created September 4, 2024 08:21
Run unit tests and browser-tests in one config
import { defineWorkspace } from "vitest/config";
export default defineWorkspace([
{
extends: "vite.config.ts",
test: {
name: "unit",
environment: "node",
include: ["src/**/*.test.ts"],
},
@mizchi
mizchi / あなたのパフォーマンスを倍にする Frontend Ops はいかがですか.md
Last active September 19, 2024 02:30
あなたのパフォーマンスを倍にする Frontend Ops の傭兵はいかがですか

あなたのプロジェクトに Frontend Ops を。

2024/09/12: 好評につき、直近のタスクが埋まっています。現時点で受け付けしたものは、最低でも10月後半以降の開始となります。

[経営者の方へ] ウェブサイトが遅くなっていませんか?機能追加が遅くなっていませんか?

私 @mizchi は Node.js とフロントエンドのエキスパートです。もし私を知らなければ、御社のフロントエンド担当に mizchi とは誰か聞いてみてください。それが一番早いと思います。

Frontend Ops の専門家として御社のプロダクトの改善にご協力します。

import { type PlatformProxy } from "wrangler";
import { type AppLoadContext } from "@remix-run/cloudflare";
// pg
/// https://www.prisma.io/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare#postgresql-traditional
import { PrismaClient } from "@prisma/client";
import { PrismaPg as PrismaPgWorker } from "@prisma/adapter-pg-worker";
import { Pool } from "@prisma/pg-worker";
type Cloudflare = Omit<PlatformProxy<Env>, "dispose">;
/*
USAGE: deno run -A git-aware-cp.ts [srcs...] dest
EXAMPLE: deno run -A git-aware-cp.ts *.ts lib.ts examples /tmp/out
backupper (main)🔥 🦕
$ tree ./examples
./examples
├── ignored-dir
@mizchi
mizchi / wasm-cloud-platform.md
Created August 14, 2024 16:26
Trying out spin and wasmCloud as wasm platforms

It is English version of https://zenn.dev/mizchi/articles/wasm-platform (Japanese)

With wasi-http, wasm can now set up a web server standalone without relying on the host language.

Among recent developments, spin and wasmcloud are wasm hosting services. We'll try out these two while comparing them.


spin

@mizchi
mizchi / moonbit-component-model-jco.md
Created August 10, 2024 07:08
Moonbit Supports Component Model: Calling from jco+TypeScript
// original https://github.com/vercel/next.js/blob/canary/scripts/trace-to-tree.mjs
// for deno script
import fs from 'node:fs'
import eventStream from 'npm:event-stream'
import pc from 'npm:picocolors'
const { bold, blue, cyan, green, magenta, red, yellow } = pc;
const file = fs.createReadStream(Deno.args[0])
const sum = (...args) => args.reduce((a, b) => a + b, 0)

6/26 の YouTube Live の台本


フロントエンドとJavaScriptの歴史を雑に話す会

  • 話し手
    • mizchi
      • フロントエンド/JavaScript歴10年。マークアップは苦手
  • 動画コンテンツで発信したい / 一人じゃ喋れなくて聞き手を探していた
import AnthropicAI from 'npm:@anthropic-ai/sdk@0.24.0';
const client = new AnthropicAI({
apiKey: Deno.env.get('ANTHROPIC_API_KEY')!,
});
const write = (text: string) => {
Deno.stdout.write(new TextEncoder().encode(text));
}
const stream = client.messages.stream({