Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bsuccess?q=image&page=582&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=image

Returns an array of strings in format "username" or "username/projectName"

Found 6507 results for "image"(1187ms)

infiniteSVGGraphmain.tsx16 matches

@ttodosiβ€’Updated 8 months ago
8// Val-name scoped table addressing.
9const { name } = extractValInfo(import.meta.url);
10const tableName = `${name}_svg_images`;
11const heartHashTableName = `${name}_heart_hash`;
12
94 const decoder = new TextDecoder();
95 const svgCode = document.getElementById("svgCode");
96 const svgImage = document.getElementById("svgImage");
97 let foundSVGEnd = false;
98 let htmlContent = "";
99 let jsonResponse = "";
100 svgCode.textContent = "";
101 svgImage.innerHTML = "";
102 while (true) {
103 const { done, value } = await reader.read();
105 if (!foundSVGEnd) {
106 svgCode.textContent += decoder.decode(value, { stream: true });
107 svgImage.innerHTML = svgCode.textContent + "</svg>";
108 Prism.highlightElement(svgCode);
109 if (svgCode.textContent.indexOf("</svg>") > -1) {
338 <div class="bg-white p-6 rounded-lg shadow-md mb-8">
339 <div class="flex space-x-4 mb-4">
340 <div class="w-1/2 border p-4 rounded" id="svgImage">
341 ${svg.svg.svg_source}
342 </div>
398 const stream = await openai.chat.completions.create({
399 messages: [
400 { role: "user", content: "make me an svg image" },
401 { role: "system", content: "```xml\n" + svg.svg_source + "\n```" },
402 { role: "user", content: "Edit this svg. " + prompt },
421 });
422 try {
423 const svgDoc = parser.parseFromString(svgString, "image/svg+xml");
424 if (!svgDoc) return false;
425 const parserError = svgDoc.getElementsByTagName("parsererror");
434 let foundSVGEnd = false;
435 let buffer = "";
436 let svgImage = "";
437 return new Response(
438 new ReadableStream({
444 if (!foundSVGStart && location > -1) {
445 foundSVGStart = true;
446 svgImage = buffer.slice(location);
447 controller.enqueue(encoder.encode(buffer.slice(location)));
448 buffer = "";
449 } else if (foundSVGStart && !foundSVGEnd) {
450 svgImage += line;
451 let endLocation = svgImage.indexOf("</svg>");
452 if (endLocation > -1) {
453 svgImage = svgImage.slice(0, endLocation + "</svg>".length);
454 foundSVGEnd = true;
455 console.log(JSON.stringify(svgImage));
456 }
457 controller.enqueue(encoder.encode(line));
459 }
460 controller.enqueue(encoder.encode(" "));
461 if (isValidSVG(svgImage)) {
462 try {
463 let resp = await sqlite.execute({
464 sql: `INSERT INTO ${tableName} (prompt, svg_source, parent_id) VALUES (?, ?, ?) RETURNING *`,
465 args: [prompt, svgImage, svg.id],
466 });
467 controller.enqueue(encoder.encode(JSON.stringify(resultSetToSVG(resp)[0])));
496 let svg = await getSVG(c.req.param("id"));
497 return new Response(addSVGNamespace(svg.svg_source), {
498 headers: { "Content-Type": "image/svg+xml", "Cache-Control": "max-age=86400" },
499 });
500});

spotifymain.tsx6 matches

@ejfoxβ€’Updated 8 months ago
1// Thank you for the feedback! You're right, we need to handle cases where playlist images might be missing.
2// Let's update the code to handle this gracefully and provide a default image when necessary.
3
4import { Hono } from "npm:hono@3";
95 playlistEl.className = 'bg-gray-800 rounded-lg p-4 mb-4 flex items-center cursor-pointer hover:bg-gray-700 transition-colors duration-300';
96 playlistEl.onclick = () => fetchTracks(playlist.id, playlist.name);
97 const imageUrl = playlist.images && playlist.images.length > 0 ? playlist.images[0].url : 'https://via.placeholder.com/60';
98 playlistEl.innerHTML = \`
99 <img src="\${imageUrl}" alt="\${playlist.name}" class="w-16 h-16 rounded-md mr-4 object-cover">
100 <div>
101 <h3 class="font-semibold text-lg text-green-400">\${playlist.name}</h3>
125 const artistNames = track.track.artists.map(artist => artist.name).join(', ');
126 const duration = new Date(track.track.duration_ms).toISOString().substr(14, 5);
127 const imageUrl = track.track.album.images && track.track.album.images.length > 0 ? track.track.album.images[0].url : 'https://via.placeholder.com/50';
128 trackEl.innerHTML = \`
129 <div class="text-gray-500 mr-4 w-8 text-center">\${index + 1}</div>
130 <img src="\${imageUrl}" alt="\${track.track.name}" class="w-12 h-12 rounded-md mr-4 object-cover">
131 <div class="flex-grow">
132 <h3 class="font-semibold text-green-400">\${track.track.name}</h3>

renderResumemain.tsx4 matches

@iamseeleyβ€’Updated 8 months ago
7 savePDFIsVisible,
8 isOceanTheme,
9 ogImageUrl,
10 customTitle
11}) {
17 const name = resumeDetails?.basics?.name || 'Resume';
18 const title = customTitle || `${name}'s Resume`;
19 const ogImage = ogImageUrl ? `<meta property="og:image" content="${ogImageUrl}">` : '';
20
21 return `
28 <meta property="og:title" content="${title}">
29 <meta property="og:type" content="website">
30 ${ogImage}
31 <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><text y='50%' font-size='24' text-anchor='middle' x='50%' dy='.3em'>πŸ“„</text></svg>">
32 <style>
33 ${theme.styles}

savePDFmain.tsx1 match

@iamseeleyβ€’Updated 8 months ago
90 margin: [8, 8, 8, 8], // top, right, bottom, left in mm
91 filename: 'resume.pdf',
92 image: { type: 'jpeg', quality: 0.98 },
93 html2canvas: {
94 scale: 3,
14Navigate to the **API Keys** -> **Generate a new API key**.
15
16![image.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/5b4a330e-48b9-4a36-64f6-453568322700/public)
17

sqliteExplorerAppREADME.md1 match

@axelknockβ€’Updated 8 months ago
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
4
5![image.webp](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c8e102fd-39ca-4bfb-372a-8d36daf43900/public)
6
7## Install

sqliteExplorerAppREADME.md1 match

@tempdevβ€’Updated 8 months ago
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
4
5![image.webp](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c8e102fd-39ca-4bfb-372a-8d36daf43900/public)
6
7## Install

blob_adminREADME.md1 match

@bpughβ€’Updated 8 months ago
3This is a lightweight Blob Admin interface to view and debug your Blob data.
4
5![b7321ca2cd80899250589b9aa08bc3cae9c7cea276282561194e7fc537259b46.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/311a81bb-18d8-4583-b7e3-64bac326f700/public)
6
7Use this button to install the val:

blobmain.tsx1 match

@stdβ€’Updated 8 months ago
5/**
6 * Provides functions for interacting with your account's blob storage.
7 * Blobs can store any data type (text, JSON, images, etc.) and allow
8 * retrieval across different vals using the same key.
9 * ([Docs β†—](https://docs.val.town/std/blob))

blob_adminREADME.md1 match

@sedsonβ€’Updated 8 months ago
3This is a lightweight Blob Admin interface to view and debug your Blob data.
4
5![b7321ca2cd80899250589b9aa08bc3cae9c7cea276282561194e7fc537259b46.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/311a81bb-18d8-4583-b7e3-64bac326f700/public)
6
7Use this button to install the val:

gpt-image-test1 file match

@CaptainJackβ€’Updated 1 day ago
ζ΅‹θ―• gpt image ηš„δΈεŒ api θƒ½ε¦ζ»‘θΆ³ε›Ύη‰‡η”Ÿζˆθ¦ζ±‚

image-inpainting1 file match

@themichaellaiβ€’Updated 3 days ago
Chrimage
Atiq
"Focal Lens with Atig Wazir" "Welcome to my photography journey! I'm Atiq Wazir, a passionate photographer capturing life's beauty one frame at a time. Explore my gallery for stunning images, behind-the-scenes stories, and tips & tricks to enhance your own