FetchBasicREADME.md1 match
1# Framer Fetch: Basic
23A basic example of an API endpoint to use with Framer Fetch.
verseOfTheDayAppmain.tsx11 matches
5const bibleEndpoints = [
6{ url: "/worker", name: "ASV" },
7{ url: "https://bible-api.com/?random=true&translation=bbe", name: "BBE" },
8{ url: "https://bible-api.com/?random=true&translation=darby", name: "Darby" },
9{ url: "https://bible-api.com/?random=true&translation=dra", name: "DRA" },
10{ url: "https://bible-api.com/?random=true&translation=web", name: "WEB" },
11{ url: "https://bible-api.com/?random=true&translation=ylt", name: "YLT" },
12{ url: "https://bible-api.com/?random=true&translation=oeb-cw", name: "OEB-CW" },
13{ url: "https://bible-api.com/?random=true&translation=webbe", name: "WEBBe" },
14{ url: "https://bible-api.com/?random=true&translation=oeb-us", name: "OEB-US" },
15];
1653});
5455if (!response.ok) throw new Error(`API error for ${endpoint.name}: ${response.statusText}`);
5657const data = await response.json();
261262try {
263const response = await fetch("https://bible-api.com/?random=true&translation=asv");
264const data = await response.json();
265
290<title>Verse of the Day</title>
291<meta name="viewport" content="width=device-width, initial-scale=1.0">
292<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
293<script src="https://esm.town/v/std/catch"></script>
294<style>
notUbernotUberConsts1 match
1export const INSTANTDB_APP_ID = "b63bc79a-c9f3-486f-b067-7afc402b3efc";
2export const CLERK_PUBLISHABLE_KEY = "pk_test_cGVyZmVjdC1zYWlsZmlzaC02NS5jbGVyay5hY2NvdW50cy5kZXYk";
3// GO TO https://www.val.town/v/vawogbemi/notUberMapComponent to change the google maps api key -- for some reason importing it doesn't work.
adroitIvoryEchidnamain.tsx21 matches
70
71const mapRef = useRef<HTMLDivElement>(null);
72const mapInstanceRef = useRef<any>(null);
73const markersRef = useRef<any[]>([]);
74const recommendationsSectionRef = useRef<HTMLDivElement>(null);
148
149// Map update logic remains the same
150if (mapInstanceRef.current) {
151mapInstanceRef.current.setView([latitude, longitude], 10);
152
153// Add main location marker
154const mainMarker = mapInstanceRef.current.L.marker([latitude, longitude], {
155icon: mapInstanceRef.current.L.divIcon({
156className: 'main-location-marker',
157html: `<div style="background-color: ${colors.secondary}; width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 10px rgba(0,0,0,0.2);"></div>`,
158iconSize: [20, 20]
159})
160}).addTo(mapInstanceRef.current);
161markersRef.current.push(mainMarker);
162163// Add recommendation markers
164recommendationsWithDistance.forEach((rec: Recommendation) => {
165const marker = mapInstanceRef.current.L.marker([rec.latitude, rec.longitude])
166.addTo(mapInstanceRef.current)
167.bindPopup(`${rec.description} (${rec.distance} km)`);
168markersRef.current.push(marker);
178const clearPreviousMarkers = () => {
179markersRef.current.forEach(marker => {
180if (mapInstanceRef.current) {
181mapInstanceRef.current.removeLayer(marker);
182}
183});
187// Modify showRecommendationOnMap to scroll and show distance
188const showRecommendationOnMap = (rec: Recommendation) => {
189if (mapInstanceRef.current) {
190// Scroll to map smoothly
191mapRef.current?.scrollIntoView({ behavior: 'smooth' });
194markersRef.current
195.filter(marker => !marker.options.icon?.options?.className?.includes('main-location-marker'))
196.forEach(marker => mapInstanceRef.current.removeLayer(marker));
197
198// Center and zoom to recommendation
199mapInstanceRef.current.setView([rec.latitude, rec.longitude], 12);
200
201// Add recommendation marker
202const marker = mapInstanceRef.current.L.marker([rec.latitude, rec.longitude])
203.addTo(mapInstanceRef.current)
204.bindPopup(`${rec.description} (${rec.distance} km)`)
205.openPopup();
214const L = await import('https://esm.sh/leaflet@1.9.4/dist/leaflet.js');
215
216if (mapRef.current && !mapInstanceRef.current) {
217mapInstanceRef.current = L.map(mapRef.current, {
218center: [0, 0],
219zoom: 2,
221});
222223mapInstanceRef.current.L = L; // Store L for later use
224
225L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
226attribution: '© OpenStreetMap contributors'
227}).addTo(mapInstanceRef.current);
228229// Add click event to map
230mapInstanceRef.current.on('click', (e: any) => {
231const { lat, lng } = e.latlng;
232setLocation({ latitude: lat, longitude: lng });
506/>
507<link
508href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap"
509rel="stylesheet"
510/>
cerebras_coderREADME.md2 matches
671. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
cerebras_codermain.tsx5 matches
212} catch (error) {
213Toastify({
214text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215position: "center",
216duration: 3000,
1024};
1025} else {
1026const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027const completion = await client.chat.completions.create({
1028messages: [
1149<meta name="viewport" content="width=device-width, initial-scale=1.0">
1150<title>CerebrasCoder</title>
1151<link rel="preconnect" href="https://fonts.googleapis.com" />
1152<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153<link
1154href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155rel="stylesheet"
1156/>
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169
1export default async function (interval: Interval) {
2
3}
spotifyOauthServerserver1 match
50</li>
51<li>If your access token expires, we use the refresh token to get a new one.</li>
52<li>Use your access token to make requests to the Spotify API by importing `getSpotifyToken` in your other vals.</li>
53</ol>
54
spotifyOauthServerserver1 match
50</li>
51<li>If your access token expires, we use the refresh token to get a new one.</li>
52<li>Use your access token to make requests to the Spotify API by importing `getSpotifyToken` in your other vals.</li>
53</ol>
54
1# APITemplateWithSwaggerUI