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=9&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 9911 results for "image"(3145ms)

FarcasterSpacesSpace.tsx6 matches

@moe•Updated 1 day ago
295 // console.log("User", uid, user);
296
297 const image =
298 user?.pfp_url ||
299 userImageUrl(uid) ||
300 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjmD59ugIABXQB5tNl2LwAAAAASUVORK5CYII='
301
302 const goToProfile = (uid) => {
329 <img
330 className="rounded-full w-14 h-14 object-cover bg-neutral-500/10"
331 src={image}
332 onClick={() => setShowMenu(true)}
333 />
346 <img
347 className="rounded-full w-14 h-14 object-cover bg-neutral-500/10"
348 src={image}
349 onClick={() => setShowMenu(true)}
350 />
411}
412
413function userImageUrl(address) {
414 if (!address) return null
415 return 'https://cdn.stamp.fyi/avatar/' + address + '?s=140'

FarcasterSpacesindex.tsx3 matches

@moe•Updated 1 day ago
6import { handleAnalyticsEndpoints } from './analytics.ts'
7import { embedMetadata, handleFarcasterEndpoints, name } from './farcaster.ts'
8import { handleImageEndpoints } from './image.tsx'
9import { fetchNeynarGet } from './neynar.ts'
10
11const app = new Hono()
12
13handleImageEndpoints(app)
14handleFarcasterEndpoints(app)
15handleAgoraEndpoints(app)
54 <meta name="fc:frame" content={JSON.stringify(embedMetadata(baseUrl, path))} />
55 <link rel="icon" href={baseUrl + '/icon'} />
56 <meta property="og:image" content={baseUrl + '/image'} />
57 </head>
58 <body class="bg-white text-black dark:bg-black dark:text-white">

FarcasterSpacesimage.tsx16 matches

@moe•Updated 1 day ago
8import { fetchUsersById } from './neynar.ts'
9
10export function handleImageEndpoints(app: Hono) {
11 const headers = {
12 'Content-Type': 'image/png',
13 'cache-control': 'public, max-age=3600', // 86400
14 }
15 app.get('/image', async (c) => {
16 const channel = c.req.query('channel')
17 if (channel) return c.body(await spaceImage(channel), 200, headers)
18 return c.body(await homeImage(), 200, headers)
19 })
20 app.get('/icon', async (c) => {
21 const rounded = !!c.req.query('rounded')
22 return c.body(await iconImage(rounded), 200, headers)
23 })
24}
25
26export async function homeImage() {
27 return await ogImage(
28 <div tw="w-full h-full flex justify-start items-end text-[100px] bg-black text-white p-[50px]">
29 <div tw="flex flex-col items-start">
37}
38
39export async function spaceImage(channel: string) {
40 const space = await fetchSpace(channel)
41 if (!space) return await homeImage()
42
43 const users = await fetchUsersById([space.created_by, ...space.hosts, ...space.speakers].join(','))
48 const speakers = users?.filter((u) => speakerFids.includes(u.fid))
49
50 return await ogImage(
51 <div tw="w-full h-full flex justify-start items-start text-[100px] bg-black text-white p-[50px]">
52 <div tw="flex flex-col items-start ">
84}
85
86export async function iconImage(rounded = false) {
87 const roundedClass = rounded ? 'rounded-[96px]' : ''
88 return await ogImage(
89 <div tw={`w-full h-full flex justify-center items-center text-[100px] bg-[#7c65c1] text-white p-[50px] ${roundedClass}`}>
90 <img tw="w-[350px] h-[350px]" src={base64Icon(Mic)} />
99//////////
100
101export async function ogImage(body, options = {}) {
102 const svg = await satori(body, {
103 width: 945,
109 if (code === 'emoji') {
110 const unicode = segment.codePointAt(0).toString(16).toUpperCase()
111 return `data:image/svg+xml;base64,` + btoa(await loadEmoji(unicode))
112 }
113 return ''
145 const base64 = Buffer.from(svg).toString('base64')
146 // console.log('getIconDataUrl', name, svg, base64)
147 return `data:image/svg+xml;base64,${base64}`
148}
149

GlancergeneratePDF.ts7 matches

@lightweight•Updated 1 day ago
1// Convert image URL to base64
2async function getImageBase64(url: string): Promise<string> {
3 const res = await fetch(url);
4 const buffer = await res.arrayBuffer();
5 const base64 = btoa(String.fromCharCode(...new Uint8Array(buffer)));
6 const contentType = res.headers.get("content-type") || "image/png";
7 return `data:${contentType};base64,${base64}`;
8}
20 const { applyPlugin } = await import("npm:jspdf-autotable");
21
22 const logoDataUrl = await getImageBase64(
23 "https://www.glance.cx/hs-fs/hubfs/raw_assets/public/Glance/images/gradientLogo.png"
24 );
25
44 let y = 20;
45
46 // Add image: (imageData, format, x, y, width, height)
47 doc.addImage(logoDataUrl, "PNG", 20, y, 30, 10);
48 y += 30;
49

untitled-4042main.js1 match

@hald•Updated 2 days ago
9 "User-Agent":
10 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
11 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
12 "Accept-Language": "en-US,en;q=0.9",
13 "Accept-Encoding": "gzip, deflate, br",

slackBotExampleREADME.md1 match

@charmaine•Updated 2 days ago
7your workspace.
8
9![test-message.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/d10a52df-8920-4d46-1e03-fad0f847ae00/public)
10
11Read the full guide here: https://docs.val.town/integrations/slack/bot/
compare-images

compare-imagesREADME.md1 match

@eeeps•Updated 2 days ago
1# compare-images
compare-images

compare-imagesgenerateComparison.tsx3 matches

@eeeps•Updated 2 days ago
101 a_iqa_score || a_iqa_description
102 ? `<dl>
103<dt><a href="https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#image_quality_analysis">IQA</a>:</dt>
104<dd>${prettyDescriptionAndScore(a_iqa_description, a_iqa_score)}</dd>
105</dl>`
122 b_iqa_score || b_iqa_description
123 ? `<dl>
124<dt><a href="https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#image_quality_analysis">IQA</a>:</dt>
125<dd>${prettyDescriptionAndScore(b_iqa_description, b_iqa_score)}</dd>
126</dl>`
133</two-up>
134
135<script type="module" src="https://esm.town/v/eeeps/compare-images/public/two-up-min.js"></script>
136
137</body>

townie-126val-summary.ts3 matches

@dinavinter•Updated 2 days ago
16 SUM(cache_write_tokens) as total_cache_write_tokens,
17 SUM(price) as total_price,
18 SUM(num_images) as total_images
19 FROM ${USAGE_TABLE}
20 WHERE val_id = ? AND our_api_token = 1
54 total_cache_write_tokens: 0,
55 total_price: 0,
56 total_images: 0
57 };
58
85 // Always include inference price for comparison
86 inference_price: inferenceSummary.inference_price || 0,
87 total_images: usageSummary.total_images,
88 // Add flag to indicate inference data usage
89 used_inference_data: !!inferenceSummary.inference_price,

townie-126val-detail.ts6 matches

@dinavinter•Updated 2 days ago
17 price?: number;
18 finish_reason?: string;
19 num_images?: number;
20 our_api_token: boolean;
21}
31 inference_price: number;
32 original_price?: number;
33 total_images: number;
34 used_inference_data?: boolean;
35 inference_price_primary?: boolean;
66 <th>Cache Write</th>
67 <th>Total Price</th>
68 <th>Images</th>
69 </tr>
70 </thead>
76 <td>${formatNumber(summary.total_cache_write_tokens)}</td>
77 <td class="price">${formatPrice(summary.total_price)}</td>
78 <td>${formatNumber(summary.total_images)}</td>
79 </tr>
80 </tbody>
97 <th>Price</th>
98 <th>Finish</th>
99 <th>Images</th>
100 </tr>
101 </thead>
114 <td class="price">${formatPrice(row.price)}</td>
115 <td>${row.finish_reason || '-'}</td>
116 <td>${formatNumber(row.num_images)}</td>
117 </tr>
118 `).join("")}
compare-images

compare-images2 file matches

@eeeps•Updated 2 days ago
Compare two images and show some metadata about ’em

pdf-image1 file match

@stevekrouse•Updated 2 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