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/$1?q=image&page=7&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 8306 results for "image"(1192ms)

my-first-valindex.ts1 match

@Mahi77Updated 12 hours ago
45 maxFileSize: 50 * 1024 * 1024, // 50MB
46 supportedFormats: {
47 image: ['image/jpeg', 'image/png', 'image/webp'],
48 video: ['video/mp4', 'video/webm'],
49 audio: ['audio/mp3', 'audio/wav', 'audio/webm']

my-first-valmedia.ts7 matches

@Mahi77Updated 12 hours ago
10} from "../database/queries.ts";
11import {
12 analyzeImage,
13 analyzeAudio,
14 analyzeVideo,
39 }
40
41 if (!['image', 'video', 'audio'].includes(mediaType)) {
42 return c.json({
43 success: false,
66
67 switch (mediaType) {
68 case 'image':
69 analysisResult = await analyzeImage(fileData, cleanFileName);
70 break;
71 case 'audio':
256 let contentType = 'application/octet-stream';
257
258 if (['jpg', 'jpeg'].includes(extension)) contentType = 'image/jpeg';
259 else if (extension === 'png') contentType = 'image/png';
260 else if (extension === 'webp') contentType = 'image/webp';
261 else if (extension === 'mp4') contentType = 'video/mp4';
262 else if (extension === 'webm') contentType = 'video/webm';

my-first-valai-analysis.ts12 matches

@Mahi77Updated 12 hours ago
4const openai = new OpenAI();
5
6export async function analyzeImage(imageData: string, fileName: string): Promise<AnalysisResponse> {
7 try {
8 // Remove data URL prefix if present
9 const base64Data = imageData.replace(/^data:image\/[a-z]+;base64,/, '');
10
11 const response = await openai.chat.completions.create({
17 {
18 type: "text",
19 text: `Analyze this image and provide:
201. A detailed description of what you see
212. List of objects/subjects in the image
223. Emotions or mood if people are present
234. Any text visible in the image
245. Tags for categorization
256. Confidence level (0-1)
36 },
37 {
38 type: "image_url",
39 image_url: {
40 url: `data:image/jpeg;base64,${base64Data}`
41 }
42 }
67 };
68 } catch (error) {
69 console.error('Image analysis error:', error);
70 return {
71 success: false,
72 message: `Failed to analyze image: ${error.message}`
73 };
74 }
154export async function analyzeVideo(videoData: string, fileName: string): Promise<AnalysisResponse> {
155 try {
156 // For video analysis, we'll extract a frame and analyze it as an image
157 // In a production environment, you might want to extract multiple frames or use specialized video analysis
158
159 // This is a simplified approach - we'll treat the video thumbnail as an image
160 // In practice, you'd need to extract frames from the video
161

my-first-valmigrations.ts1 match

@Mahi77Updated 12 hours ago
21 id INTEGER PRIMARY KEY AUTOINCREMENT,
22 user_id INTEGER NOT NULL,
23 media_type TEXT NOT NULL CHECK (media_type IN ('image', 'video', 'audio')),
24 file_name TEXT NOT NULL,
25 file_size INTEGER NOT NULL,

my-first-valtypes.ts6 matches

@Mahi77Updated 12 hours ago
18 id: number;
19 user_id: number;
20 media_type: 'image' | 'video' | 'audio';
21 file_name: string;
22 file_size: number;
28
29export interface AnalysisRequest {
30 mediaType: 'image' | 'video' | 'audio';
31 fileName: string;
32 fileData: string; // base64 encoded
48export interface SearchRequest {
49 query: string;
50 mediaType?: 'image' | 'video' | 'audio';
51 limit?: number;
52}
80 maxFileSize: 50 * 1024 * 1024, // 50MB
81 allowedTypes: [
82 'image/jpeg',
83 'image/png',
84 'image/webp',
85 'video/mp4',
86 'video/webm',

my-first-valREADME.md1 match

@Mahi77Updated 12 hours ago
6
7- **User Authentication**: Secure login/signup system with session management
8- **Multi-Media Support**: Image, video, and audio recognition
9- **Real-time Capture**: In-browser media capture capabilities
10- **AI Analysis**: Powered by OpenAI's vision and audio models

ProtoSharecontent.ts5 matches

@c15rUpdated 13 hours ago
49 }
50
51 // if (!["text", "image", "url"].includes(data.type)) {
52 // return c.json({ error: "Invalid content type", body }, 400);
53 // }
62 // }
63
64 // // For images, we expect base64 data or a URL
65 // if (data.type === "image") {
66 // if (!data.content.startsWith("data:image/") && !data.content.startsWith("http")) {
67 // return c.json({ error: "Invalid image format", body }, 400);
68 // }
69 // }
placeholdji

placeholdjimain.tsx1 match

@jjgUpdated 13 hours ago
72 return new Response(svg, {
73 headers: {
74 "Content-Type": "image/svg+xml",
75 "Cache-Control": "public, max-age=3600",
76 },

blog-3README.md3 matches

@jxnblkUpdated 13 hours ago
30 - **`proxy.ts`**: Proxy to the old blog for legacy content
31 - **`rss.ts`**: RSS feed generation
32 - **`favicon.ts`** & **`og-image.ts`**: Asset routes
33- **`/utils/`**: Utility functions for post processing, caching, etc.
34- **`/posts/`**: Markdown files for blog posts
69- Tables
70- Lists
71- Images
72- And other standard markdown features
73
91- Efficient proxy for legacy content
92- Minimal CSS with no external frameworks
93- Optimized image handling
94
95## Deployment

blog-3OGImage.tsx1 match

@jxnblkUpdated 13 hours ago
4const LINE_HEIGHT = 72;
5
6export default function OGImage({
7 title = "Val Town Blog",
8 ...props
placeholdji

placeholdji2 file matches

@jjgUpdated 10 hours ago
Placeholder image service with emojis 🖼️

image_proxy

@oopsUpdated 5 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