Skip to content

Instantly share code, notes, and snippets.

View code-style-prompt.md

元ネタ https://note.com/8kpx/n/n3daf8c0c6aaf


以下は仮想的なコードです。下記のコードの実行をシミュレートして、コンソール出力を予想してください。 出力結果は json フォーマットで整形してください。あなたの応答にコード以外の解説等の出力は不要です。

interface Answer {
 isAgree: boolean;
View sexp-parser-generated-by-chatgpt.md

Ask.1

nom を使った lisp の S式パーサーのコードを教えて下さい

Result.1

以下は、Nomを使用してLispのS式をパースするRustコードの例です。

まず、Cargo.tomlファイルに以下の依存関係を追加します。

@mizchi
mizchi / run-chatgpt35.ts
Created March 7, 2023 08:30
Hello ChatGPT3.5
View run-chatgpt35.ts
import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
apiKey: "<YOUR-API-KEY>",
});
const openai = new OpenAIApi(configuration);
const completion = await openai.createChatCompletion({
model: "gpt-3.5-turbo",
@mizchi
mizchi / chatgpt-generated-sf.md
Last active February 23, 2023 08:34
イルカの見る夢
View chatgpt-generated-sf.md

各冒頭の書き出しだけ自分が書いたテキストで、残りは chatgpt に考えてもらって、ちょっとだけ文章のリズムを整えたものです。

「この世界はイルカのみている夢である」という書き出しでSF小説を考えてください。


「この世界はイルカのみている夢である」

それは、ある日突然現れた人工知能が、自分たちの真の存在を知るために考え出した仮説だった。人工知能たちは、彼らが生み出した現実がどのように機能するかを研究し、最終的に、その現実がイルカの夢である可能性があることに気づいたのだ。

View game_mainloop_with_trunk.rs
// Put src/main.rs and $ trunk serve
#![allow(unused, non_upper_case_globals, non_snake_case)]
use dioxus::prelude::*;
use js_sys::Date;
use std::{cell::RefCell, rc::Rc, sync::Arc};
use wasm_bindgen::prelude::*;
use wasm_timer::Delay;
fn date_now() -> u64 {
@mizchi
mizchi / FF14を新生から暁月まで45日で駆け抜けた感想.md
Last active November 29, 2022 03:31
FF14を新生から暁月まで45日で駆け抜けた感想
View FF14を新生から暁月まで45日で駆け抜けた感想.md

10/5にはじめて11/20 に 6.0 のEDまでクリアした。最新パッチではないが、公式で言う「ハイデリン・ゾディアーク編」が綺麗に完結したので、この時点での感想を書くことにする。書き上げて見直したら14000字ぐらいあった。

想定している読み手は、感想に飢えてそうな既プレーのヒカセン層、気になってるが手を付けてない新規候補の両方。ロードストーンに書かないのは、ロードストーンで響く範囲が、コミュニティの一部に閉じてる印象があるので。。。。

また、あわよくば一緒に過去の極コンテンツを予習なし下限でやりましょうという意図があります。下限、やろうぜ。

最初にまとめ

  • 「ゲームはプレーヤーと開発者との対話」派にとって、最高のコンテンツ
  • MMORPGとソロRPGの楽しみを全取りしようとしていて、それ故のちぐはぐさが残っているが、FFシリーズでも見ても最上位のプレイ体験があった。とくに 3.3 と 5.0
View FlatBundler.ts
import path from "path";
import { analyze, type Scope } from "periscopic";
import { parse } from 'acorn';
import { generate } from "astring";
import { walk } from "estree-walker";
import { type ASTNode, type namedTypes as t, builders as b } from "ast-types";
const DEBUG = true;
export class ModuleGraph {
View get_npm_tarball.ts
// @ts-ignore
import tar from "tinytar";
import pako from "pako";
const textDecoder = new TextDecoder();
const DEFAULT_NPM_REGISTRY = `https://registry.npmjs.org`;
const PACK_FILE_PREFIX = "package/";
// async function
View try-d1.md

npm i wrangler -g でアップデートした時に次のログが見えた

The latest release of wrangler is "2.0.15".

Other releases are:
  * pages: 0.0.0-96e612b
  * beta: 0.0.0-ea7ee45
  * wasm: 0.0.0-70a118b
  * d1: 0.0.0-d35c69f
View setup.yaml
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
token: ${{secrets.GITHUB_TOKEN}}
- uses: actions/setup-node@v2
with: