simpleChatAPImain.tsx3 matches
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
45function App() {
6const [messages, setMessages] = useState([]);
7const [newMessage, setNewMessage] = useState("");
243}
244245function client() {
246createRoot(document.getElementById("root")).render(<App />);
247}
248if (typeof document !== "undefined") { client(); }
249250export default async function server(request: Request): Promise<Response> {
251const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
252const KEY = "simpleChatAPI";
SermonGPTUImain.tsx5 matches
78const endpointURL = "https://mjweaver01-sermongptapi.web.val.run";
7980function App() {
81const [question, setQuestion] = useState("");
82const [response, setResponse] = useState("");
617}
618619function client() {
620const root = document.getElementById("root");
621if (!root) throw new Error("Root element not found");
633}
634635export default async function server(request: Request): Promise<Response> {
636const { blob } = await import("https://esm.town/v/std/blob");
637664}
665666// Helper function to determine season based on current date
667function getSeason(date: Date): string {
668const month = date.getMonth();
669switch (true) {
legendaryRoseSwordfishmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [participants, setParticipants] = useState([]);
7const [logs, setLogs] = useState([]);
217}
218219function client() {
220createRoot(document.getElementById("root")).render(<App />);
221}
225}
226227export default async function server(req: Request): Promise<Response> {
228const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
229const SCHEMA_VERSION = 3;
linkInBioTemplatemain.tsx1 match
2import { renderToString } from "npm:react-dom/server";
34export default async function(req: Request) {
5return new Response(
6renderToString(
emojiVectorEmbeddingsmain.tsx11 matches
15]);
16// Get embedding for a single emoji
17async function getEmbedding(emoji: string): Promise<number[]> {
18const result = await openai.embeddings.create({
19input: emoji,
23}
2425async function loadEmoji(e: string) {
26const result = await sqlite.execute("SELECT 1 FROM emojis WHERE emoji = ?", [e]);
27if (result.rows.length !== 0) {
43}
4445async function loadAllEmojis() {
46const batchSize = 20;
47for (let i = 0; i < emojis.length; i += batchSize) {
54// await loadAllEmojis();
5556export async function searchEmojis(query: string): Promise<string[]> {
57return (await sqlite.execute(
58`SELECT emoji
70// };
7172// // Function to get all emojis (this is a subset for demonstration)
7374// // Calculate cosine similarity between two vectors
75// function cosineSimilarity(vecA: number[], vecB: number[]): number {
76// const dotProduct = vecA.reduce((sum, a, i) => sum + a * vecB[i], 0);
77// const magnitudeA = Math.sqrt(vecA.reduce((sum, a) => sum + a * a, 0));
8182// // Get embedding for a single emoji
83// async function getEmbedding(emoji: string): Promise<number[]> {
84// const result = await openai.embeddings.create({
85// input: emoji,
9091// // Get embeddings for all emojis
92// async function getAllEmbeddings(): Promise<EmojiEmbedding[]> {
93// const emojis = getAllEmojis();
94// const embeddings: EmojiEmbedding[] = [];
116117// // Find nearest neighbors for a given emoji
118// function findNearestNeighbors(
119// targetEmbedding: number[],
120// allEmbeddings: EmojiEmbedding[],
130// }
131132// // Main function to demonstrate usage
133// async function main() {
134// try {
135// console.log("Getting embeddings for all emojis...");
fairAquaHeronmain.tsx1 match
1export default async function() {
2const body = await Deno.readFile("/opt/render/project/src/guest/index.ts");
3return new Response(body);
SermonGPTAPImain.tsx2 matches
1export default async function server(request: Request): Promise<Response> {
2const { blob } = await import("https://esm.town/v/std/blob");
3const KEY = "sermon_generator";
182}
183184function getSeason(date: Date): string {
185const month = date.getMonth();
186switch (true) {
linearRegressionmain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function linearRegression(x: number[], y: number[]) {
6const n = x.length;
7
22}
2324function App() {
25const [inputData, setInputData] = useState('');
26const [result, setResult] = useState<{ slope?: number; intercept?: number }>({});
107}
108109function client() {
110createRoot(document.getElementById("root")).render(<App />);
111}
112if (typeof document !== "undefined") { client(); }
113114export default async function server(request: Request): Promise<Response> {
115return new Response(`
116<html>
blob_adminmain.tsx8 matches
13}
1415function Tooltip({ children, content }: TooltipProps) {
16const [isVisible, setIsVisible] = useState(false);
17const tooltipRef = useRef<HTMLDivElement>(null);
52}
5354function formatBytes(bytes: number, decimals = 2) {
55if (bytes === 0) return "0 Bytes";
56const k = 1024;
61}
6263function copyToClipboard(text: string) {
64navigator.clipboard.writeText(text).then(() => {
65console.log("Text copied to clipboard");
69}
7071function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
72const [isOpen, setIsOpen] = useState(false);
73const menuRef = useRef(null);
7677useEffect(() => {
78function handleClickOutside(event) {
79if (menuRef.current && !menuRef.current.contains(event.target)) {
80event.stopPropagation();
158}
159160function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
161const [isLoading, setIsLoading] = useState(false);
162const decodedKey = decodeURIComponent(blob.key);
219}
220221function App({ initialEmail, initialProfile }) {
222const encodeKey = (key: string) => encodeURIComponent(key);
223const decodeKey = (key: string) => decodeURIComponent(key);
645}
646647function client() {
648const initialEmail = document.getElementById("root").getAttribute("data-email");
649const initialProfile = JSON.parse(document.getElementById("root").getAttribute("data-profile"));
dailyThoughtPromptmain.tsx1 match
4import { email } from "https://esm.town/v/std/email";
56export default async function(interval: Interval) {
7const TOPICS = [
8"Productivity",