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=520&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 6019 results for "image"(621ms)

faviconGeneratormain.tsx11 matches

@iamseeley•Updated 7 months ago
21 const response = await fetch(`/generate?prompt=${encodeURIComponent(prompt)}`);
22 if (!response.ok) {
23 throw new Error(`Failed to generate image: ${response.statusText}`);
24 }
25 const data = await response.json();
26 setFaviconUrl(data.imageUrl);
27 } catch (err) {
28 setError(err.message);
74}
75
76async function generateImage(prompt: string) {
77 const FAL_KEY = Deno.env.get("FAL_KEY");
78 if (!FAL_KEY) {
88 body: JSON.stringify({
89 prompt: prompt,
90 image_size: "square",
91 num_inference_steps: 2,
92 guidance_scale: 1,
93 num_images: 1,
94 }),
95 });
98 const errorText = await response.text();
99 console.error("fal.ai API error:", response.status, response.statusText, errorText);
100 throw new Error(`Failed to generate image: ${response.status} ${response.statusText}`);
101 }
102
104 console.log("API response:", data);
105
106 if (!data.images || data.images.length === 0 || !data.images[0].url) {
107 console.error("Unexpected API response format:", data);
108 throw new Error("Unexpected API response format");
109 }
110
111 return data.images[0].url;
112}
113
126
127 try {
128 const imageUrl = await generateImage(prompt);
129 console.log("Generated image URL:", imageUrl);
130 return new Response(JSON.stringify({ imageUrl }), {
131 headers: { "Content-Type": "application/json" },
132 });

dbpediaenhancedmain.tsx4 matches

@ejfox•Updated 7 months ago
121 "div",
122 { key: index, className: "border-b border-gray-200 pb-4 last:border-b-0 flex" },
123 result.image && React.createElement(
124 "div",
125 { className: "mr-4 flex-shrink-0" },
126 React.createElement("img", {
127 src: result.image,
128 alt: result.label || "Entity image",
129 className: "w-32 h-32 object-cover rounded",
130 })
233 score,
234 explanation,
235 image: result.thumbnail ? result.thumbnail[0] : null
236 };
237 }).sort((a, b) => b.score - a.score);

dbpediaenhancedREADME.md1 match

@ejfox•Updated 7 months ago
1An API and basic interface for entity searching from DBPedia, enhanced with images

dbpediamain.tsx7 matches

@ejfox•Updated 7 months ago
1// This tool uses the DBpedia Lookup API and SPARQL endpoint to find entities and their details, including images.
2// It provides a web interface and a JSON API endpoint for entity search, including hero images.
3
4// Helper function to strip HTML tags and decode HTML entities
73 "div",
74 { key: index, className: "border-b border-gray-200 pb-4 last:border-b-0 flex" },
75 result.image && React.createElement(
76 "div",
77 { className: "mr-4 flex-shrink-0" },
78 React.createElement("img", {
79 src: result.image,
80 alt: result.label,
81 className: "w-32 h-32 object-cover rounded"
134 const uri = doc.resource[0];
135 const sparqlQuery = `
136 SELECT ?abstract ?image
137 WHERE {
138 <${uri}> dbo:abstract ?abstract .
139 OPTIONAL { <${uri}> dbo:thumbnail ?image }
140 FILTER (lang(?abstract) = "en")
141 }
154 label: sanitizeHtml(doc.label[0]),
155 description: bindings?.abstract?.value ? sanitizeHtml(bindings.abstract.value) : "No description available",
156 image: bindings?.image?.value || null,
157 };
158 }));

dbpediaREADME.md1 match

@ejfox•Updated 7 months ago
1An API and basic interface for entity searching from DBPedia, enhanced with images

scrape2mdmain.tsx1 match

@taras•Updated 7 months ago
62 "User-Agent":
63 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36",
64 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
65 "Accept-Language": "en-US,en;q=0.5",
66 "Sec-Fetch-Site": "cross-site",

redditImageGrabmain.tsx11 matches

@yawnxyz•Updated 7 months ago
6const subreddits = ["IdiotsInCars"];
7
8const fetchWithImage = async (subreddit: string) => {
9 const { data: { children } } = await fetchJSON(
10 `https://www.reddit.com/r/${subreddit}.json`,
13 const posts = children
14 .map((child: any) => child.data)
15 .filter((post: any) => post.post_hint === "image")
16 .map((post: any) => ({
17 title: post.title,
25
26const fetchAllReddits = async () => {
27 const posts = (await Promise.all(subreddits.map(fetchWithImage))).flat();
28 return posts;
29};
30
31function ImageGrid({ posts }) {
32 return (
33 <div className="image-grid">
34 {posts.map((post, index) => (
35 <div key={index} className="image-item">
36 <img src={post.url} alt={post.title} />
37 </div>
51 return (
52 <div>
53 <ImageGrid posts={posts} />
54 </div>
55 );
93body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background-color: #f0f0f0; }
94h1 { text-align: center; color: #333; }
95.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
96.image-item { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 8px rgba(0,0,0,0.1); transition: transform 0.3s ease; }
97.image-item:hover { transform: scale(1.05); }
98.image-item img { width: 100%; height: 250px; object-fit: cover; display: block; }
99`;

redditImageGrabREADME.md1 match

@yawnxyz•Updated 7 months ago
1Migrated from folder: ExamplesAndForks/redditImageGrab

pr0nmain.tsx11 matches

@roramigator•Updated 7 months ago
6const subreddits = ["Battletops", "AverageBattlestations", "desksetup"];
7
8const fetchWithImage = async (subreddit: string) => {
9 const { data: { children } } = await fetchJSON(
10 `https://www.reddit.com/r/${subreddit}.json`,
13 const posts = children
14 .map((child: any) => child.data)
15 .filter((post: any) => post.post_hint === "image")
16 .map((post: any) => ({
17 title: post.title,
25
26const fetchAllReddits = async () => {
27 const posts = (await Promise.all(subreddits.map(fetchWithImage))).flat();
28 return posts;
29};
30
31function ImageGrid({ posts }) {
32 return (
33 <div className="image-grid">
34 {posts.map((post, index) => (
35 <div key={index} className="image-item">
36 <img src={post.url} alt={post.title} />
37 </div>
51 return (
52 <div>
53 <ImageGrid posts={posts} />
54 </div>
55 );
93body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background-color: #f0f0f0; }
94h1 { text-align: center; color: #333; }
95.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
96.image-item { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 8px rgba(0,0,0,0.1); transition: transform 0.3s ease; }
97.image-item:hover { transform: scale(1.05); }
98.image-item img { width: 100%; height: 250px; object-fit: cover; display: block; }
99`;

sqliteExplorerAppREADME.md1 match

@feb•Updated 7 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

brainrot_image_gen1 file match

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

modifyImage2 file matches

@stevekrouse•Updated 6 days ago
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