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=2131&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 24819 results for "function"(4739ms)

tealPheasantmain.tsx5 matches

@tempguy•Updated 10 months ago
11const captchaId = $("input[name=\"captcha_id\"]").val();
12const captchaAnswerValues = [];
13$("input[name=\"captcha_answer[]\"]").each(function() {
14 captchaAnswerValues.push($(this).val());
15});
33 "Cache-Control": "no-cache",
34};
35function getCombinations(arr, k) {
36 const result = [];
37
38 // Helper function to generate combinations recursively
39 function combine(prefix, start) {
40 if (prefix.length === k) {
41 result.push(prefix);
56
57console.log(combinations.length);
58async function postCombinations(combinations, url, headers, captchaId) {
59 for (const combination of combinations) {
60 // Create the body for the POST request

maroonBandicootmain.tsx1 match

@tempguy•Updated 10 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2export default async function(request: Request) {
3 const url = new URL(request.url);
4 const h = url.searchParams.get("tdestination");

scarletClammain.tsx1 match

@justinenerio•Updated 10 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true, msg: 'saba jah allergic kag air'})
3}

jsPythonmain.tsx2 matches

@kora•Updated 10 months ago
2
3const script = `
4def mapFunction(r, i):
5 v = r * i
6 return v
8x = [1, 2, 3, 4]
9x
10 .map(mapFunction)
11 .filter(r => r * r)
12 .join(",")

p5README.md4 matches

@moe•Updated 10 months ago
10```
11
12* Export any "global" p5 functions. These are functions like `setup` and `draw` that p5 will call.
13
14* Set the val type to http and default export the result of `sketch`, passing in `import.meta.url`.
19import type * as p5 from "npm:@types/p5";
20
21export function setup() {
22 createCanvas(400, 400);
23}
24
25export function draw() {
26 if (mouseIsPressed) {
27 fill(0);
37
38## How it works
39The sketch function returns an http handler that sets up a basic page with p5.js added. It then imports your module from the browser and wires up all the exports so p5.js can see them. All the code in your val will run in the browser (except for the default `sketch` export) so you can't call any Deno functions, environment variables, or other server side apis.
40
41

glideREADME.md3 matches

@dvdsgl•Updated 10 months ago
1# Glide API 2.0
2
3`Effects` and utility functions for working with Glide API 2.0.
4
5## Authentication
16await Glide.importTable({
17 table: "abc123-def456-ghi789",
18 getRows: async function*() {
19 // yield Row[] to add them to the stash
20 yield [{ Name: "David" }];
30await Glide.importTable({
31 table: "abc123-def456-ghi789",
32 getRows: async function*() {
33 const octokit = new Octokit({ auth: "..." });
34 for await (

aquaAntmain.tsx6 matches

@tempguy•Updated 10 months ago
76}
77
78// Extract function to process encrypted data
79async function extract(url) {
80 try {
81 const response = await fetch(url, {
101 const _0x3cbaf6 = "episode";
102
103 function key() {
104 return $("body[class^='container-']").attr("class").split("-").pop();
105 }
106
107 function iv() {
108 return $("div[class*='container-']").attr("class").split("-").pop();
109 }
110
111 function key2() {
112 return $("div[class*='videocontent-']").attr("class").split("-").pop();
113 }
152 return _0x3b405f;
153 } catch (error) {
154 console.error("Error in extract function:", error);
155 }
156}

ReactStream_migratedREADME.md4 matches

@jxnblk•Updated 10 months ago
7import { render, React } from "https://esm.town/v/jxnblk/ReactStream";
8
9function App() {
10 const [count, setCount] = React.useState(0);
11 return (
62```tsx
63// example middleware
64async function api (req: Request, res: Response, next): Promise<Response> {
65 if (req.pathname !== "/api") return next();
66 if (req.method === "POST") {
78```tsx
79// example middleware
80async function getInitialProps (req: Request, res: Response, next) {
81 // fetch data or do async work to pass as props to the component
82 req.data = {
95import { render } from "https://esm.town/v/jxnblk/ReactStream";
96
97function App () {
98 return (
99 <html>

hono_countermain.tsx1 match

@iamseeley•Updated 10 months ago
3import { useState } from "https://esm.sh/hono/jsx/dom";
4
5export default function Counter(props: { initialCount?: number }) {
6 const [count, setCount] = useState(props.initialCount || 0);
7 return (

copperScorpionmain.tsx1 match

@tempguy•Updated 10 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2export default async function(request: Request) {
3 const url = new URL(request.url);
4 const h = url.searchParams.get("tdestination");

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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.