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/?q=image&page=271&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 2776 results for "image"(336ms)

grievingYellowAspREADME.md1 match

@stevekrouse•Updated 7 months ago
4
5
6![Screenshot 2024-07-17 at 14.14.45@2x.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/b4cd5cc8-84f5-4c1a-1668-7e0abf909100/public)
7
8

buttonmain.tsx1 match

@stevekrouse•Updated 7 months ago
51 return new Response(svgContent, {
52 headers: {
53 "content-type": "image/svg+xml",
54 },
55 });

pushmain.tsx1 match

@stevekrouse•Updated 8 months ago
89 appName: 'ValPush',
90 appIconUrl: '${iconURL}',
91 assetUrl: 'https://cdn.jsdelivr.net/gh/philfung/add-to-homescreen@1.9/dist/assets/img/', // Link to directory of library image assets.
92 maxModalDisplayCount: -1
93});

test_migratedmain.tsx1 match

@jxnblk•Updated 8 months ago
97 const svg = render(badge);
98
99 return new Response(svg, { headers: { "Content-Type": "image/svg+xml;charset=utf-8" } });
100}

whenfilmedmain.tsx3 matches

@tmcw•Updated 9 months ago
7
8const TMDB_API_BASE = "https://api.themoviedb.org/3"
9const TMDB_IMAGE_BASE = "https://image.tmdb.org/t/p/w200"
10
11const headers = {
65 movies.map((movie, index) => `
66 <div class="movie-container">
67 <img src="${TMDB_IMAGE_BASE}${movie.poster_path}" alt="${movie.title}" style="width: 100px;">
68 <div class="movie-info">
69 <h3>${movie.title}</h3>
130 return `
131 <div class="movie-result ${resultClass}">
132 <img src="${TMDB_IMAGE_BASE}${movie.poster_path}" alt="${movie.title}" style="width: 100px;">
133 <div class="movie-info">
134 <h3>${movie.title}</h3>

azureCheetahmain.tsx1 match

@tmcw•Updated 9 months ago
42 functions where possible. Unless specified, don't add error handling,
43 make sure that errors bubble up to the caller.
44 Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
45 not practical for the user's request (e.g. if they ask for a particular animated gif).
46 If the user asks for something that requires persistence, use the Val Town Blob storage API, unless

VALLErunmain.tsx1 match

@tmcw•Updated 9 months ago
42 functions where possible. Unless specified, don't add error handling,
43 make sure that errors bubble up to the caller.
44 Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
45 not practical for the user's request (e.g. if they ask for a particular animated gif).
46 If the user asks for something that requires persistence, use the Val Town Blob storage API, unless

VALLEREADME.md1 match

@tmcw•Updated 9 months ago
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>

valleGetValsContextWindowmain.tsx1 match

@stevekrouse•Updated 9 months ago
327 ---
328
329 Val Town comes with blob storage built-in. It allows for storing any data: text, JSON, images. You can access it via [\`std/blob\`](https://www.val.town/v/std/blob).
330
331 Blob storage is scoped globally to your account. If you set a blob in one val, you can retrieve it by the same key in another val. It's backed by Cloudflare R2.

infiniteSVGGraphmain.tsx16 matches

@maxm•Updated 9 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});

brainrot_image_gen1 file match

@dcm31•Updated 2 days ago
Generate images for Italian Brainrot characters using FAL AI

modifyImage2 file matches

@stevekrouse•Updated 2 days ago