摘要: import 'dotenv/config'; import OpenAI from 'openai'; const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY, baseURL: process.env.OPENAI_API_B 阅读全文
posted @ 2024-10-27 23:14 卓能文 阅读(4) 评论(0) 推荐(0) 编辑
摘要: nuitka # test.py def add(x: int, y: int) -> int: return x + y print(add(2, 3)) nuitka test.py --onefile --clang --static-libpython=yes # justfile buil 阅读全文
posted @ 2024-10-27 10:57 卓能文 阅读(9) 评论(0) 推荐(0) 编辑
摘要: package main import ( "flag" "fmt" "github.com/carlmjohnson/versioninfo" ) func main() { fmt.Println("ShortInfo:", versioninfo.Short()) versioninfo.Ad 阅读全文
posted @ 2024-10-19 11:42 卓能文 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 原始地址:https://github.com/alarbada/htmx-stream window.htmx.defineExtension("stream", { onEvent: (name, evt) => { if (name "htmx:beforeRequest") { let el 阅读全文
posted @ 2024-10-16 18:38 卓能文 阅读(6) 评论(0) 推荐(0) 编辑
摘要: pnpm i @tailwindcss/vite@next omi tailwindcss@next vite package.json: { "type": "module", "dependencies": { "@tailwindcss/vite": "4.0.0-alpha.24", "om 阅读全文
posted @ 2024-09-14 19:28 卓能文 阅读(5) 评论(0) 推荐(0) 编辑
摘要: import css from "./index.scss?inline"; 阅读全文
posted @ 2024-09-14 15:38 卓能文 阅读(4) 评论(0) 推荐(0) 编辑
摘要: @tag("my-element") class MyElement extends Component { get value() { return this.editor ? this.editor.getValue() : ""; } set value(val: string) { this 阅读全文
posted @ 2024-09-04 20:51 卓能文 阅读(6) 评论(0) 推荐(0) 编辑
摘要: omi是腾讯开源的一款web components开发框架。 AceMarkdown.tsx: import { Component, createRef, h, signal, tag } from "omi"; import * as ace from "ace-builds"; import 阅读全文
posted @ 2024-09-03 00:52 卓能文 阅读(9) 评论(0) 推荐(0) 编辑
摘要: index.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <tit 阅读全文
posted @ 2024-08-31 10:15 卓能文 阅读(5) 评论(0) 推荐(0) 编辑
摘要: src/components/AceMarkdown.tsx: import { useRef, useEffect, useState } from "react"; import { $paper, type Paper } from "../store/paper"; import ace f 阅读全文
posted @ 2024-08-27 07:09 卓能文 阅读(8) 评论(0) 推荐(0) 编辑