val_E1oovKNSVpmain.tsx2 matches
12export default async function handler(req) {
3try {
4const result = await (async () => {
5function fibonacci() { let a = 0, b = 1; while (b < 1000) { let temp = b; b = a + b; a = temp; } return b;}
67fibonacci();
val_6ob0t5Fmjmmain.tsx3 matches
12export default async function handler(req) {
3try {
4const result = await (async () => {
5function isPrime(num) {
6if (num <= 1) return false;
7for (let i = 2; i <= Math.sqrt(num); i++) {
11}
1213function findLowestThreeDigitPrime() {
14for (let num = 100; num < 1000; num++) {
15if (isPrime(num)) {
val_T3Axgfc7n3main.tsx2 matches
12export default async function handler(req) {
3try {
4const result = await (async () => {
5function fibonacci() {
6let a = 0, b = 1;
7let lowestThreeDigit = 0;
val_dO1pTtU7X9main.tsx3 matches
12export default async function handler(req) {
3try {
4const result = await (async () => {
5function isPrime(num) {
6if (num <= 1) return false;
7for (let i = 2; i <= Math.sqrt(num); i++) {
11}
1213function findLowestThreeDigitPrime() {
14for (let num = 100; num < 1000; num++) {
15if (isPrime(num)) {
val_Qj8c8xTIqvmain.tsx2 matches
12export default async function handler(req) {
3try {
4const result = await (async () => {
5function findLowestThreeDigitFibonacci() {
6let a = 0, b = 1;
7let lowestThreeDigit = null;
val_S1NNtqMDtfmain.tsx3 matches
12export default async function handler(req) {
3try {
4const result = await (async () => {
5function isPrime(num) {
6if (num <= 1) return false;
7for (let i = 2; i <= Math.sqrt(num); i++) {
11}
1213function findLowestThreeDigitPrime() {
14for (let num = 100; num < 1000; num++) {
15if (isPrime(num)) {
val_9Vk5LnFz7tmain.tsx2 matches
12export default async function handler(req) {
3try {
4const result = await (async () => {
5function fibonacci() {
6let a = 0, b = 1;
7while (b < 1000) {
openaiDefinermain.tsx7 matches
3const openai = new OpenAI();
45export default async function(req: Request): Promise<Response> {
6log.info("Request received:", req.method, req.url);
735}
3637export async function parseRequest(req: Request): Promise<{ selection: string; followUp: string; context: string[] }> {
38const body = await req.text();
39log.debug("Request body:", body);
51}
5253export function prepareMessages(selection: string, followUp: string, context: string[]): Array<Object> {
54const contextString = context.length > 0 ? `Consider the following context: ${context.join(", ")}. ` : "";
55const messages = [
82}
8384export function streamResponse(stream: ReadableStream): Response {
85const encoder = new TextEncoder();
86108}
109110export function handleError(error: Error): Response {
111log.error("Error occurred:", error);
112123}
124125export function handleCorsPreflightRequest(): Response {
126return new Response(null, {
127headers: {
142const currentLogLevel = logLevels.INFO; // Adjust this to change logging level
143144function formatMessage(level: string, message: string, ...args: any[]): string {
145const timestamp = new Date().toISOString();
146return `${timestamp} [${level}] ${message} ${args.join(" ")}`;
multilingualchatroommain.tsx9 matches
109};
110111function Banner({ message, isVisible, language }) {
112if (!isVisible) return null;
113return <div className="banner">{message[language] || message.en}</div>;
114}
115116function UserList({ users, t }) {
117return (
118<div className="user-list">
129}
130131function Sidebar({ users, language, handleLanguageChange, roomUrl, copyToClipboard, copied, t }) {
132return (
133<div className="sidebar">
165}
166167function TypingIndicator({ typingUsers, t }) {
168if (typingUsers.length === 0) return null;
169
180}
181182function App() {
183const [messages, setMessages] = useState([]);
184const [inputMessage, setInputMessage] = useState("");
506}
507508function client() {
509createRoot(document.getElementById("root")).render(<App />);
510}
511if (typeof document !== "undefined") { client(); }
512513export default async function server(request: Request): Promise<Response> {
514const url = new URL(request.url);
515const { blob } = await import("https://esm.town/v/std/blob");
524const TIME_WINDOW = 60 * 1000; // 1 minute
525526async function checkRateLimit() {
527const now = Date.now();
528const rateLimit = await blob.getJSON(RATE_LIMIT_KEY) || { count: 0, timestamp: now };
539}
540541async function translateText(text: string, targetLanguage: string, sourceLanguage: string): Promise<string> {
542const cacheKey = `${KEY}_translation_${sourceLanguage}_${targetLanguage}_${text}`;
543const cachedTranslation = await blob.getJSON(cacheKey);
weatherDashboardmain.tsx6 matches
14};
1516function getWeatherIcon(code) {
17if (code === 0) return weatherIcons.clear;
18if (code >= 1 && code <= 3) return weatherIcons.cloudy;
23}
2425function WeatherDashboard() {
26const [weatherData, setWeatherData] = useState(null);
27const [location, setLocation] = useState("New York");
32}, [location]);
3334async function fetchWeatherData(city) {
35try {
36const response = await fetch(`${API_BASE_URL}?latitude=40.71&longitude=-74.01&daily=weathercode,temperature_2m_max,temperature_2m_min,precipitation_probability_max¤t_weather=true&timezone=auto&forecast_days=7`);
42}
4344function handleSearch(e) {
45e.preventDefault();
46setLocation(searchInput);
93}
9495function client() {
96createRoot(document.getElementById("root")).render(<WeatherDashboard />);
97}
101}
102103export default async function server(request: Request): Promise<Response> {
104return new Response(
105`