get_gemini_modelsmain.tsx1 match
7}
89export async function getGeminiModels(): Promise<GeminiModel[]> {
10try {
11const API_KEY = process.env.GEMINI_API_KEY;
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
10import debounce from "https://esm.sh/lodash.debounce";
1112function App() {
13const [query, setQuery] = useState("");
14const [suggestions, setSuggestions] = useState([]);
112}
113114function client() {
115createRoot(document.getElementById("root")).render(<App />);
116}
120}
121122async function server(request: Request): Promise<Response> {
123if (request.method === "POST" && new URL(request.url).pathname === "/geocode") {
124const { query } = await request.json();
whoIsHiringmain.tsx3 matches
7import About from "https://esm.town/v/vawogbemi/whoIsHiringAbout";
89function App() {
10const tabs = { "/": "Home", "/about": "About" };
11const [activeTab, setActiveTab] = useState("/");
335}
336337function ServerApp() {
338return (
339<html>
358}
359360export default async function(req: Request): Promise<Response> {
361const url = new URL(req.url);
362if (url.pathname === "/api/stories") {
spanishPoeticClockmain.tsx5 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function formatTime() {
7const now = new Date();
8const hours = now.getHours();
97];
9899function getRandomPoem(time) {
100const poem = POEMS[Math.floor(Math.random() * POEMS.length)];
101return {
105}
106107function SpanishTimePoemApp() {
108const time = formatTime();
109const { spanishPoem, englishPoem } = getRandomPoem(time);
139}
140141function client() {
142createRoot(document.getElementById("root")).render(<SpanishTimePoemApp />);
143}
144if (typeof document !== "undefined") { client(); }
145146export default async function server(request: Request): Promise<Response> {
147const { blob } = await import("https://esm.town/v/std/blob");
148const time = formatTime();
sqliteExplorerAppmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [query, setQuery] = useState("");
7const [table, setTable] = useState("val_town_agent_specifications");
129}
130131window.initClient = function() {
132const rootElement = document.getElementById("root");
133if (rootElement) {
141}
142143export default async function server(request: Request): Promise<Response> {
144// Handle GET requests by serving the HTML
145if (request.method === 'GET') {
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
4import { nanoid } from "https://esm.sh/nanoid";
56function App() {
7const [specId, setSpecId] = useState("");
8const [implementationResult, setImplementationResult] = useState(null);
84}
8586window.initClient = function() {
87const rootElement = document.getElementById("root");
88if (rootElement) {
96}
9798export default async function server(request: Request): Promise<Response> {
99// Handle GET requests by serving the HTML
100if (request.method === 'GET') {
2133. Ensure the implementation is under 15KB
2144. Follow Unix philosophy: do one thing well
2155. Use functional programming principles
2166. Provide clear, concise, and efficient code
2177. MUST return a valid JSON object with implementation details
thrillingAmaranthKiwimain.tsx11 matches
162const GOOGLE_MAPS_API_KEY = 'AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw';
163164// Utility Functions
165function calculateDistance(lat1, lon1, lat2, lon2) {
166const R = 6371; // Radius of the earth in km
167const dLat = (lat2 - lat1) * Math.PI / 180;
175}
176177// Geocoding Utility Function
178async function geocodeLocation(location) {
179const algerianLocations = {
180'alger': { lat: 36.7538, lng: 3.0588, region: 'Alger' },
242243// Cat Report Form Component
244function CatReportForm() {
245const [report, setReport] = useState({
246location: '',
307308// Veterinary Contacts Component
309function VeterinaryContacts() {
310const mapRef = useRef(null);
311const [location, setLocation] = useState('');
380// Find nearest vets based on location
381useEffect(() => {
382async function findNearestVets() {
383if (!locationCoords) {
384setNearestVets(EMERGENCY_VETERINARY_CONTACTS);
544545// Main App Component
546function App() {
547const [view, setView] = useState('report');
548588}
589590// Rendering Function
591function renderApp() {
592const rootElement = document.getElementById("root");
593if (!rootElement) return;
621622// Server Response Handler
623export default async function server(request: Request): Promise<Response> {
624return new Response(`
625<!DOCTYPE html>