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/image-url.jpg%20%22Image%20title%22?q=image&page=599&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 6547 results for "image"(897ms)

readwiseReaderDocumentListmain.tsx1 match

@zerovoxUpdated 10 months ago
16 published_date: number;
17 summary: string;
18 image_url: string;
19 content: null;
20 source_url: string;

valTownChatGPTREADME.md1 match

@simonwUpdated 10 months ago
5<p align=center>
6<a href="https://maxm-valtownchatgpt.web.val.run/">
7<img width=600 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c180aba1-997a-4e40-615a-1ed8456b5a00/public">
8</a>
9</p>

ivoryPorpoisemain.tsx2 matches

@neverstewUpdated 10 months ago
46 {
47 src: "/icon.png",
48 type: "image/png",
49 sizes: "192x192",
50 },
51 {
52 src: "/icon-512.png",
53 type: "image/png",
54 sizes: "512x512",
55 },

heat_at_pointmain.tsx6 matches

@l3gacyb3taUpdated 10 months ago
13// Load our data tile from url, arraybuffer, or blob, so we can work with it:
14const tiff = await fromUrl("https://www.wpc.ncep.noaa.gov/heatrisk/data/HeatRisk_1_Mercator.tif");
15const image = await tiff.getImage(); // by default, the first image is read.
16
17// Convert a GPS coordinate to a pixel coordinate in our tile:
18
19const bbox = image.getBoundingBox();
20const pixelWidth = image.getWidth();
21const pixelHeight = image.getHeight();
22const bboxWidth = bbox[2] - bbox[0];
23const bboxHeight = bbox[3] - bbox[1];
35
36const window = [xPx, yPx, xPx + 1, yPx + 1];
37const data = await image.readRasters({ window });
38
39console.log(data);
40
41// const rasters = await image.readRasters();
42// const { width, height, [0]: raster } = rasters;
43

vtApiTypesmain.tsx1 match

@neverstewUpdated 10 months ago
668 bio?: string | null;
669 /** @description The url for the user's profile picture */
670 profileImageUrl?: string | null;
671 }) & components["schemas"]["Author"];
672 BaseVal: {
12
13// INST: Add these keys in val env variables
14// NOTE: the image notes don't work at the moment, and if you add a image note,
15// the task is skipped
16
22var add_to_habitify_todoist_project_id = "XXXX"; // INST: Project ID goes here
23var todoist_dict_mapping = { // Note: You can choose to leave this dict empty and it will still work
24 "Image Notes": { // This is for a section that is image notes only for any habit without adding a log
25 "todoist-section-id": "XXXX", // INST: section id for just image notes section goes here
26 "habitify-area-name": "undefined", // keep this value as undefined
27 specialPrompt: "only_image", // keep the value as only_image
28 },
29 "Text Notes": { // This is for a section that is text notes only for any habit without adding a log
30 "habitify-area-name": "undefined", // keep this value as undefined
31 "todoist-section-id": "XXXX", // INST: section id for just image notes section goes here
32 specialPrompt: "only_text", // keep the value as only_text
33 },
115}
116
117async function resizeAndConvertImage(imageBuffer) {
118 try {
119 const image = await Jimp.read(imageBuffer);
120 const resizedImage = await image.resize(800, 800, Jimp.RESIZE_BILINEAR);
121 const jpegBuffer = await resizedImage.quality(80).getBufferAsync(Jimp.MIME_JPEG);
122
123 if (jpegBuffer.length >= 2000000) {
124 console.error("Error: Resized image size should be smaller than 2MB");
125 return null;
126 }
128 return jpegBuffer;
129 } catch (error) {
130 console.error("Error processing image:", error);
131 return null;
132 }
133}
134
135async function downloadImage(url) {
136 try {
137 const response = await fetch(url, {
144 }
145
146 const imageBuffer = await response.buffer();
147 const resizedImageBuffer = await resizeAndConvertImage(imageBuffer);
148
149 return resizedImageBuffer;
150 } catch (error) {
151 console.error("Error downloading or processing image:", error);
152 return null;
153 }
227 let habitSchema;
228
229 if (specialPrompt === "only_text" || specialPrompt === "only_image") {
230 habitSchema = z.object({
231 name: z.enum(habitKeys),
264 prompt += "The habits you can choose from are: " + habitKeys_str + ".\n";
265
266 if (specialPrompt === "only_image" || specialPrompt === "only_text") {
267 prompt +=
268 "You are extracting the name of the habit, the date of the habit (if mentioned, or otherwise an empty string), and any note if it exists about a habit (if mentioned, or otherwise an empty string). Remember, a note is associated with only 1 habit and will say 'note that' or something like that.\n";
365}
366
367async function addImageNote(habit_id, created_at, imageBuffer) {
368 const url = `https://api.habitify.me/notes/addImageNote/${habit_id}?created_at=${encodeURIComponent(created_at)}`;
369 const headers = {
370 Authorization: HABITIFY_API_KEY,
371 "Content-Type": "image/jpeg",
372 };
373
376 method: "POST",
377 headers: headers,
378 body: imageBuffer,
379 });
380 if (!response.ok) {
462 for (const task of tasks) {
463 console.log(task);
464 task.imageComments = null;
465 if (task.commentCount > 0) {
466 const imageComments = [];
467 const todoist_comments = await getCommentsForTask(task.id);
468 for (const comment of todoist_comments) {
469 // console.log(comment);
470 if (comment.attachment && comment.attachment.resourceType === "image") {
471 const imageBuffer = await downloadImage(comment.attachment.image);
472 if (imageBuffer) {
473 imageComments.push(imageBuffer);
474 }
475 }
476 }
477 task.imageComments = imageComments ? imageComments : null;
478 }
479
480 /// START---REMOVE ONCE UPLOAD IS FIXED
481 if (task.imageComments) {
482 continue;
483 }
499 console.log(habits);
500 for (const habit of habits) {
501 if (specialPrompt != "only_image" || specialPrompt != "only_text") {
502 await addLog(
503 habits_list[habitifyAreaName][habit.name].id,
510 await addTextNote(habits_list[habitifyAreaName][habit.name].id, habit.date, habit.note);
511 }
512 if (task.imageComments) {
513 for (const imageComment of task.imageComments) {
514 await addImageNote(
515 habits_list[habitifyAreaName][habit.name].id,
516 habit.date,
517 imageComment,
518 );
519 }

resumeConfigmain.tsx1 match

@ajaxUpdated 10 months ago
19 "name": "Thomas Davis",
20 "label": "Web Developer",
21 "image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
22 "summary":
23 "I'm a full stack web developer who can build apps from the ground up. I've worked mostly at startups so I am used to wearing many hats. I am a very product focused developer who prioritizes user feedback first and foremost. I'm generally very flexible when investigating new roles. ",

modifyImagemain.tsx6 matches

@uUpdated 10 months ago
1import { ImageMagick, initializeImageMagick, MagickGeometry } from "https://deno.land/x/imagemagick_deno@0.0.14/mod.ts";
2
3export async function modifyImage(
4 input: Uint8Array | "logo:",
5) {
6 return new Promise<File>((resolve) => {
7 ImageMagick.read(input, (image) => {
8 image.trim();
9 image.repage();
10 image.write((data) => resolve(new File([data], "logo.png", { type: "image/png" })));
11 });
12 });

modifyImageREADME.md2 matches

@uUpdated 10 months ago
1Code from https://deno.com/blog/build-image-resizing-api
2
3Useful for compressing an image before sending to chatgpt4v, for example

imageMagickWasmExamplemain.tsx11 matches

@maxmUpdated 10 months ago
1import {
2 ImageMagick,
3 initializeImageMagick,
4 Magick,
5 MagickFormat,
6 Quantum,
7} from "https://esm.sh/@imagemagick/magick-wasm";
8
9const resp = await fetch("https://esm.sh/@imagemagick/magick-wasm@0.0.29/dist/magick.wasm");
10const wasmBytes = await resp.arrayBuffer();
11
12initializeImageMagick(wasmBytes).then(() => {
13 console.log(Magick.imageMagickVersion);
14 console.log("Delegates:", Magick.delegates);
15 console.log("Features:", Magick.features);
17
18 console.log("");
19 ImageMagick.read("logo:", image => {
20 image.resize(100, 100);
21 image.blur(1, 5);
22 console.log(image.toString());
23
24 image.write(MagickFormat.Jpeg, data => {
25 console.log(data.length);
26 });

image-gen

@armadillomikeUpdated 3 hours ago

gpt-image-test1 file match

@CaptainJackUpdated 1 day ago
测试 gpt image 的不同 api 能否满足图片生成要求
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