Windsurfprojectcontext12 matches
45* @returns {React.ReactElement}
46*/
47function App() {
48const [state, setState] = useState(null);
49const [error, setError] = useState(null);
112/**
113* CurrentPhase component
114* @param {{phase: string, onUpdate: Function}} props
115* @returns {React.ReactElement}
116*/
117function CurrentPhase({ phase, onUpdate }) {
118const [newPhase, setNewPhase] = useState(phase);
119const [error, setError] = useState("");
152/**
153* ActiveBlocks component
154* @param {{blocks: string[], onUpdate: Function}} props
155* @returns {React.ReactElement}
156*/
157function ActiveBlocks({ blocks, onUpdate }) {
158const [newBlock, setNewBlock] = useState("");
159const [error, setError] = useState("");
210/**
211* TaskList component
212* @param {{tasks: Task[], onUpdate: Function}} props
213* @returns {React.ReactElement}
214*/
215function TaskList({ tasks, onUpdate }) {
216const [newTask, setNewTask] = useState({ description: "", priority: "medium", assignedTo: "" });
217const [error, setError] = useState("");
338/**
339* StepList component
340* @param {{steps: Step[], onUpdate: Function}} props
341* @returns {React.ReactElement}
342*/
343function StepList({ steps, onUpdate }) {
344const [newStep, setNewStep] = useState({ description: "", priority: "medium" });
345const [error, setError] = useState("");
455* @returns {React.ReactElement}
456*/
457function ChangeList({ changes }) {
458return (
459<div className="section">
473* Client-side initialization
474*/
475function client() {
476createRoot(document.getElementById("root")).render(<App />);
477}
487* @returns {Promise<Response>} The server response
488*/
489export default async function server(req: Request): Promise<Response> {
490const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
491const { blob } = await import("https://esm.town/v/std/blob");
WindsurfunbeatableAquaCow4 matches
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
58`);
5960// Utility functions
61async function hashPassword(password: string, salt?: string): Promise<{ hash: string, salt: string }> {
62salt = salt || crypto.randomUUID();
63const encoder = new TextEncoder();
69}
7071async function authenticateUser(request: Request): Promise<number | null> {
72const authHeader = request.headers.get('Authorization');
73if (!authHeader) return null;
video_calling_appmain.tsx3 matches
4import Peer from 'https://esm.sh/simple-peer@9.11.1';
56function App() {
7const [myStream, setMyStream] = useState(null);
8const [remoteStream, setRemoteStream] = useState(null);
179};
180181function client() {
182createRoot(document.getElementById("root")).render(<App />);
183}
185if (typeof document !== "undefined") { client(); }
186187export default async function server(request: Request): Promise<Response> {
188return new Response(`
189<html>
OpenAIChatCompletionmain.tsx1 match
9/**** rate-limited access to the OpenAI API ****/
1011export default async function (Request:Request):Promise<Response> {
12if (Request.method === 'OPTIONS') {
13return new Response(null, {
1import { postToBluesky } from "./blueskyPost";
23export default async function(interval: Interval) {
4await postToBluesky();
5}
1import { BskyAgent } from "npm:@atproto/api";
23export async function postToBluesky() {
4const agent = new BskyAgent({
5service: "https://bsky.social",
NotionJsSDKmain.tsx2 matches
7});
89// Example function to list Notion users
10export async function listNotionUsers() {
11const listUsersResponse = await notion.users.list({});
12return listUsersResponse;
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
34export async function aqi(interval: Interval) {
5const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6const data = await easyAQI({ location });
BraintrustSDKtutorial1 match
3import { Eval } from "npm:braintrust";
45export default async function handler() {
6const result = {
7apiKeyStatus: null,
trackESMContentmain.tsx5 matches
10const TABLE_NAME = `${KEY}_versions_v1`;
1112async function fetchContent(url: string) {
13const response = await fetch(url);
14return await response.text();
15}
1617async function initializeDatabase() {
18await sqlite.execute(`
19CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
26}
2728export default async function(interval: Interval) {
29await initializeDatabase();
3056}
5758async function sha256(message: string): Promise<string> {
59const msgUint8 = new TextEncoder().encode(message);
60const hashBuffer = await crypto.subtle.digest("SHA-256", msgUint8);
64}
6566export async function getAllVersions() {
67await initializeDatabase();
68const versions = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} ORDER BY timestamp DESC`);