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=function&page=2152&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 30417 results for "function"(4734ms)

valentinemain.tsx1 match

@f2realw•Updated 3 months ago
2import { renderToString } from "npm:react-dom@18.2.0/server";
3
4export default async function App() {
5 const [isAttending, setIsAttending] = false;
6 const [noClicks, setNoClicks] = 0;

insightfulPinkOttermain.tsx1 match

@fatimazahra_10•Updated 3 months ago
1export default async function (interval: Interval) {
2
3}

reactHonoStarterApp.tsx1 match

@jxnblk•Updated 3 months ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [clicked, setClicked] = useState(0);
6 return (

steel_puppeteer_startermain.tsx3 matches

@brokencircuits•Updated 3 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [messages, setMessages] = useState([
7 { role: "system", content: "You are a helpful AI assistant." },
126}
127
128function client() {
129 createRoot(document.getElementById("root")).render(<App />);
130}
131if (typeof document !== "undefined") { client(); }
132
133export default async function server(request: Request): Promise<Response> {
134 if (request.method === "POST") {
135 const { messages, model } = await request.json();

replicate_starterApp.tsx1 match

@stevekrouse•Updated 3 months ago
3import React from "https://esm.sh/react@18.2.0";
4
5function ImageGenerator() {
6 const [prompt, setPrompt] = React.useState("");
7 const [images, setImages] = React.useState<any>([]);

spagserver.ts1 match

@stevekrouse•Updated 3 months ago
2import { parseProject, serveFile } from "https://esm.town/v/std/utils@64-main/index.ts";
3
4export default async function(req: Request): Promise<Response> {
5 const path = new URL(req.url).pathname;
6

spagindex.html4 matches

@stevekrouse•Updated 3 months ago
185 audio: true,
186 })
187 .then(function (stream) {
188 // uh oh... a promise
189 recorder = new MediaRecorder(stream);
246 );
247
248 async function fetchUploads() {
249 const response = await fetch("https://todepond-spagList.web.val.run");
250 const data = await response.json();
252 }
253
254 async function pullUploads() {
255 refreshButton.disabled = true;
256 previewAllButton.hidden = true;
278
279 const uploadsElement = document.getElementById("uploads");
280 function renderUploads(_uploads) {
281 uploadsElement.innerHTML = "";
282

spagLICENSE1 match

@stevekrouse•Updated 3 months ago
300and execute modified versions of a covered work in that User Product from
301a modified version of its Corresponding Source. The information must
302suffice to ensure that the continued functioning of the modified object
303code is in no case prevented or interfered with solely because
304modification has been made.

PrimeCoderindex7 matches

@primedark•Updated 3 months ago
23);
24
25function Hero({
26 prompt,
27 setPrompt,
44
45 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46 Turn your ideas into fully functional apps in{" "}
47 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48 less than a second
115}
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
169 });
170
171 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
172 setLoading(true);
173 setTimeout(() => handleSubmit(promptItem.prompt), 0);
174 }
175
176 async function handleSubmit(e: React.FormEvent | string) {
177 if (typeof e !== "string") {
178 e.preventDefault();
225 }
226
227 function handleVersionChange(direction: "back" | "forward") {
228 const { currentVersionIndex, versions } = versionHistory;
229 if (direction === "back" && currentVersionIndex > 0) {
973);
974
975function client() {
976 const path = window.location.pathname;
977 const root = createRoot(document.getElementById("root")!);

SethGodinBlogEmailmain.tsx1 match

@charmaine•Updated 3 months ago
1import { email } from "https://esm.town/v/std/email";
2
3export default async function (interval: Interval) {
4 try {
5 const response = await fetch("https://seths.blog/feed/");
tuna

tuna9 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.