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=2655&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 29385 results for "function"(4237ms)

createGeneratedValmain.tsx3 matches

@yawnxyz•Updated 12 months ago
25 {
26 role: "user",
27 content: `Here's the description of the function I want to write:
28 ${description}
29 Please start writing the function now, and just write the function, no console.log required:
30 `,
31 },
47};
48
49export async function createVal({ description, valTownKey, code, name, type }) {
50
51 // give it code or generate code

magentaCanidaemain.tsx1 match

@yawnxyz•Updated 12 months ago
1export default async function (req: Request): Promise<Response> {
2 return new Response('HELLO HELLO', { status: 200 });
3}

wahoomain.tsx1 match

@yawnxyz•Updated 12 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json( {message: 'hello!!'})
3}

basicHtmlReqmain.tsx1 match

@yawnxyz•Updated 12 months ago
1export default async function (req: Request): Promise<Response> {
2 const message = "HELLO HELLO";
3 return Response.json({message});

generateValCodemain.tsx2 matches

@yawnxyz•Updated 12 months ago
29 {
30 role: "user",
31 content: `Here's the description of the function I want to write:
32
33 ${description}
34
35 Please start writing the function now, and just write the function, no console.log required:
36 `,
37 },

nameOfUnicodemain.tsx1 match

@jdan•Updated 12 months ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2
3export async function nameOfCodepoint(codepoint: string) {
4 const names = await blob.getJSON("unicode_names");
5 return names[codepoint];

nameOfUnicodeREADME.md1 match

@jdan•Updated 12 months ago
4import { blob } from "https://esm.town/v/std/blob?v=12";
5
6fetch("https://unicode.org/Public/UNIDATA/UnicodeData.txt").then(async function(response) {
7 const text = await response.text();
8 const data = {};

htmxGenFormsExamplemain.tsx1 match

@yawnxyz•Updated 12 months ago
116export default app.fetch;
117
118export function showClicked() {
119 return "Button Clicked!";
120}

uptimemain.tsx1 match

@wilg•Updated 12 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

aiHonoHtmxAlpineStreamingExamplemain.tsx3 matches

@yawnxyz•Updated 12 months ago
18
19
20// in this example we use a custom function instead of htmx's custom sse extension, since it never closes!
21function getResponse({prompt}) {
22 const outputDiv = document.getElementById('output');
23 prompt = prompt ||document.getElementById('prompt').value;
97 <div id="output"></div>
98 <script>
99 // instead of htmx sse we pass it a custom function
100 ${getResponse}
101 </script>
tuna

tuna9 file matches

@jxnblk•Updated 2 days 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.