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=8&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 9912 results for "image"(2961ms)

nasaImageDetails1 file match

@wallek•Updated 11 months ago

modifyImage2 file matches

@u•Updated 12 months ago

imageMagickWasmExample2 file matches

@maxm•Updated 12 months ago

textToImagePlayground2 file matches

@iamseeley•Updated 12 months ago

realtimeGenerateImageHandler2 file matches

@iamseeley•Updated 12 months ago

generateImageHandler2 file matches

@iamseeley•Updated 12 months ago

uploadImage2 file matches

@chriswmartin•Updated 12 months ago

jamesWebbImageProxy1 file match

@maxm•Updated 1 year ago

uploadImage2 file matches

@qqyule•Updated 1 year ago

asciiImageExample2 file matches

@maxm•Updated 1 year ago

huyhieumain.js3 matches

@lanly•Updated 1 hour ago
86 const buffer = new Uint8Array(await res.arrayBuffer())
87 const base64 = btoa(String.fromCharCode(...buffer))
88 faviconDataUrl = `data:image/x-icon;base64,${base64}`
89 }
90 } catch {
150 ${badgeBg}
151 ${valueBg}
152 ${faviconDataUrl ? `<image x='${iconX}' y='${Math.round((s.height - s.icon) / 2)}' width='${s.icon}' height='${s.icon}' href='${faviconDataUrl}'/>` : ''}
153 ${labelText ? `<text x='${labelTextX}' y='${s.y}' fill='#333' text-anchor='${faviconDataUrl ? 'start' : 'middle'}'>${labelText}</text>` : ''}
154 ${valueText ? `<text x='${labelWidth + iconWidth + valueWidth / 2}' y='${s.y}' fill='${textColor}' text-anchor='middle'>${valueText}</text>` : ''}
156 `,
157 {
158 headers: { 'Content-Type': 'image/svg+xml' }
159 }
160 )

cardamonparse.ts16 matches

@connnolly•Updated 4 hours ago
71 tags: Array.isArray(recipe.tags) ? recipe.tags.filter(tag => typeof tag === "string") : undefined,
72 source: recipe.source && typeof recipe.source === "string" ? recipe.source.trim() : undefined,
73 imageUrl: recipe.imageUrl && typeof recipe.imageUrl === "string" ? recipe.imageUrl.trim() : undefined,
74 };
75}
125// System prompt for recipe parsing
126const RECIPE_PARSING_PROMPT =
127 `You are a recipe parsing expert. Your task is to extract structured recipe information from various sources (text, images, PDFs).
128
129IMPORTANT: You must return ONLY a valid JSON object with no additional text, markdown formatting, or explanations.
237});
238
239app.post("/image", async (c) => {
240 try {
241 const { content: base64Image } = await c.req.json() as ParseRequest;
242
243 console.log("Processing image upload, base64 length:", base64Image?.length);
244
245 // Validate base64 image
246 if (!base64Image || base64Image.length < 100) {
247 return c.json({ success: false, error: "Invalid or empty image data" } as ParseResponse);
248 }
249
250 // Use OpenAI Vision to parse recipe from image
251 const completion = await openai.chat.completions.create({
252 model: "gpt-4o-mini",
259 type: "text",
260 text:
261 "Parse the recipe from this image. Extract all visible recipe information including title, ingredients with amounts, and cooking steps.",
262 },
263 {
264 type: "image_url",
265 image_url: {
266 url: base64Image.startsWith("data:") ? base64Image : `data:image/jpeg;base64,${base64Image}`,
267 },
268 },
306 const rawRecipe = JSON.parse(jsonText);
307 const recipe = validateAndCleanRecipe(rawRecipe);
308 recipe.source = "Image upload";
309
310 return c.json({ success: true, recipe } as ParseResponse);
318 }
319 } catch (error) {
320 console.error("Image parsing error:", error);
321 return c.json({
322 success: false,
323 error: `Failed to parse recipe from image: ${error.message}`,
324 } as ParseResponse);
325 }
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