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/$%7Bsuccess?q=function&page=1705&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 19769 results for "function"(2259ms)

tomatoSpiderREADME.md1 match

@tfayyaz•Updated 11 months 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 11 months ago
1export default function({ component, sourceURL, head }: { component: Function; sourceURL: string; head?: string }) {
2 return new Response(
3 `<html>

Appmain.tsx3 matches

@xyc•Updated 11 months 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 <>

semanticSearchTursomain.tsx1 match

@janpaul123•Updated 11 months ago
5import OpenAI from "npm:openai";
6
7export default async function semanticSearchPublicVals(query) {
8 const sqlite = createClient({
9 url: "libsql://valsembeddings-jpvaltown.turso.io",

debugValEmbeddingsmain.tsx1 match

@janpaul123•Updated 11 months ago
29import { email } from "https://esm.town/v/std/email?v=12";
30
31export default async function(interval: Interval) {
32 const dynamiclandWebsiteHash = await blob.getJSON("dynamiclandWebsiteHash");
33 const newHash = await getHashForUrl("https://dynamicland.org/");

gameIdeaApimain.tsx3 matches

@xkonti•Updated 11 months ago
90const ideasKey = "game-ideas";
91
92async function getIdeas(): Promise<Idea[]> {
93 let ideas = await blob.getJSON(ideasKey) as Idea[];
94 if (ideas == null) ideas = [];
96}
97
98async function setIdeas(ideas: Idea[]): Promise<void> {
99 await blob.setJSON(ideasKey, ideas);
100}
101
102function getRandomElement<T>(array: T[]): T {
103 const randomIndex = Math.floor(Math.random() * array.length);
104 return array[randomIndex];

extractHttpEndpointmain.tsx1 match

@xkonti•Updated 11 months ago
1export function extractHttpEndpoint(url: string | URL) {
2 const { pathname } = new URL(url);
3 const [author, filename] = pathname.split("/").slice(-2);

formatResumemain.tsx3 matches

@iamseeley•Updated 11 months ago
1export function formatResume(resumeDetails) {
2 function applyFormatting(text) {
3 if (typeof text === 'string') {
4 return text
9 }
10
11 function preprocessResumeDetails(details) {
12 if (Array.isArray(details)) {
13 return details.map(item => preprocessResumeDetails(item));

jadeMacawmain.tsx1 match

@janpaul123•Updated 11 months ago
8import OpenAI from "npm:openai";
9
10export default async function semanticSearchPublicVals(query) {
11 const allValsBlobEmbeddingsMeta = (await blob.getJSON("allValsBlobEmbeddingsMeta")) ?? {};
12 const allBatchDataIndexes = _.uniq(Object.values(allValsBlobEmbeddingsMeta).map(item => item.batchDataIndex));

Title_Extractormain.tsx4 matches

@willthereader•Updated 11 months ago
2import { fetch } from "https://esm.town/v/std/fetch";
3
4// Helper function to retrieve CSRF token if needed
5async function getCsrfToken(url, cookies) {
6 try {
7 console.log("Fetching CSRF Token from URL:", url);
36}
37
38// Function to fetch HTML content and extract titles
39async function titleExtractor(url, cookies, csrfToken) {
40 try {
41 console.log("Fetching URL:", url);

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks 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.