参加者や運営のコンテキスわかってる人向けの雑な版。 真面目なのは後で書く、かも。気分次第
https://www.cyberagent.co.jp/careers/students/career_event/detail/id=31182
https://github.com/CyberAgentHack/web-speed-hackathon-2025
真面目な解説書いた
/** | |
* Usage | |
* deno run -A v0.ts https://google.com | |
*/ | |
import "core-js/proposals/explicit-resource-management.js"; | |
import puppeteer from "puppeteer"; | |
import { tool } from "ai"; | |
import { collectHighlight } from "./inject.ts"; | |
import { z } from "zod"; | |
// optional: show image on terminal |
参加者や運営のコンテキスわかってる人向けの雑な版。 真面目なのは後で書く、かも。気分次第
https://www.cyberagent.co.jp/careers/students/career_event/detail/id=31182
https://github.com/CyberAgentHack/web-speed-hackathon-2025
真面目な解説書いた
/** | |
* Puppeteerでデバッガーを使ってJavaScriptの関数の戻り値を変更するサンプル | |
* Debugger.setReturnValueを使って関数の戻り値を変更する | |
* 本来なら foo() は "foo" を返すが "foo-modified" に変更されている。 | |
*/ | |
/*実行ログ | |
[Debugger.scriptParsed] http://localhost:8778/main.js | |
[Debugger.paused] { | |
functionName: "foo", | |
reason: "other", |
This is translation of https://zenn.dev/mizchi/articles/introduce-moonbit from japanese
Recently, I came across a language called MoonBit, and the more I looked into it, the more I liked it, so I'd like to introduce it.
#!/usr/bin/env deno run -A | |
/** | |
* Lighthouse プラグインを直接実行する実装 | |
* https://github.com/GoogleChrome/lighthouse/blob/main/docs/plugins.md#custom-audits | |
*/ | |
import lighthouse from "npm:lighthouse"; | |
import { killAll, launch } from "npm:chrome-launcher"; | |
import chromeFinder from "npm:chrome-finder"; |
import fs from "fs"; | |
import { defineConfig } from "vite"; | |
export default defineConfig({ | |
plugins: [ | |
{ | |
name: "isolation", | |
configureServer(server) { | |
server.middlewares.use((_req, res, next) => { | |
res.setHeader("Cross-Origin-Opener-Policy", "same-origin"); | |
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp"); |
/* | |
# Usage | |
$ git add foo.ts | |
$ git commit -m "add foo.ts" | |
# push and wait ci | |
$ deno run -A git-push-with-ci.ts | |
Enumerating objects: 7, done. | |
Counting objects: 100% (7/7), done. |
/* @script */ | |
// LSP メッセージの型定義 | |
type JsonRpcMessage = { | |
jsonrpc: "2.0"; | |
id?: number; | |
method?: string; | |
params?: unknown; | |
result?: unknown; | |
error?: { |
/** | |
* $ deno run tools/read.ts https://example.com | |
* $ deno run tools/read.ts https://example.com --summary | |
*/ | |
import { JSDOM } from "npm:jsdom@26.0.0"; | |
import { Readability } from "npm:@mozilla/readability"; | |
import html2md from "npm:html-to-md"; | |
import { parseArgs } from "node:util"; | |
import { anthropic } from "@ai-sdk/anthropic"; | |
import { streamText } from "npm:ai"; |