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=2660&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 29319 results for "function"(3538ms)

easyAQImain.tsx1 match

@stevekrouse•Updated 1 year ago
7const cacheKey = location => "easyAQI_locationID_cache_" + encodeURIComponent(location);
8
9export async function easyAQI({ location }: {
10 location: string;
11}) {

easyAQI_cachedmain.tsx1 match

@stevekrouse•Updated 1 year ago
7const cacheKey = location => "easyAQI_locationID_cache_" + encodeURIComponent(location);
8
9export async function easyAQI({ location }: {
10 location: string;
11}) {

valTownAnalyticsmain.tsx1 match

@maxm•Updated 1 year ago
94};
95
96async function handler(req: Request): Promise<Response> {
97 const url = new URL(req.url);
98 if (req.method === "GET" && url.pathname === "/event") {

weatherGPTmain.tsx1 match

@developersdigest•Updated 1 year ago
31console.log(text);
32
33export async function weatherGPT() {
34 await email({ subject: "Weather Today", text });
35}

semanticSearchBlobsmain.tsx1 match

@janpaul123•Updated 1 year ago
10const dimensions = 1536;
11
12export default async function semanticSearchPublicVals(query) {
13 const allValsBlobEmbeddingsMeta = (await blob.getJSON(`allValsBlob${dimensions}EmbeddingsMeta`)) ?? {};
14 const allBatchDataIndexes = _.uniq(Object.values(allValsBlobEmbeddingsMeta).map((item: any) => item.batchDataIndex));

generativeNoisemain.tsx2 matches

@wking•Updated 1 year ago
70};
71
72function createArrayOfLength(length: number): number[] {
73 return Array.from(Array(length === 0 ? 1 : length), (_, i) => i);
74}
79 * noise range to fit the 0 to 1 scale we need.
80 */
81function getColorByNoise(colors: string[], noise: number) {
82 return colors[Math.floor(((noise + 1) / 2) * colors.length)];
83}

CommandProcessorTestmain.tsx2 matches

@curtcox•Updated 1 year ago
2import { form } from "https://esm.town/v/curtcox/command_processor_test_form";
3
4async function process(command: string): Promise<string> {
5 const result = await command_processor(command);
6 return result.output.content;
7}
8
9export default async function(req: Request): Promise<Response> {
10 return form(req, process);
11}

tomatoSpiderREADME.md1 match

@tfayyaz•Updated 1 year ago
8import { useState } from "https://esm.sh/react@18.2.0";
9
10export function App() {
11 const [ count, setCount ] = useState(0)
12 return (

tomatoSpidermain.tsx1 match

@tfayyaz•Updated 1 year ago
1export default function({ component, sourceURL, head }: { component: Function; sourceURL: string; head?: string }) {
2 return new Response(
3 `<html>

Appmain.tsx3 matches

@xyc•Updated 1 year ago
7import { ObjectInspector } from "https://esm.sh/react-inspector";
8
9async function fetchGgufMetadata(url: string) {
10 const { metadata, tensorInfos } = await gguf(url);
11 return { metadata, tensorInfos };
12}
13
14function Counter() {
15 const [counter, setCounter] = React.useState(0);
16
26}
27
28export function App() {
29 return (
30 <>
tuna

tuna9 file matches

@jxnblk•Updated 1 day 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.