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/$%7BsvgDataUrl%7D?q=function&page=60&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 31522 results for "function"(3211ms)

TownieuseProject.tsx1 match

@fave_24•Updated 3 days ago
4const FILES_ENDPOINT = "/api/project-files";
5
6export function useProject(projectId: string, branchId?: string) {
7 const [data, setData] = useState<any>(null);
8 const [loading, setLoading] = useState(true);

TownieuseProjects.tsx1 match

@fave_24•Updated 3 days ago
3const ENDPOINT = "/api/projects-loader";
4
5export function useProjects() {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(true);

TownieuseLoadingFavicon.ts3 matches

@fave_24•Updated 3 days ago
1import { useEffect } from "react";
2
3function setLoadingFavicon() {
4 document.querySelector('link[rel="icon"]').href = "/favicon-loading.svg";
5}
6function resetFavicon() {
7 document.querySelector('link[rel="icon"]').href = "/favicon.svg";
8}
9
10export function useLoadingFavicon(loading: boolean) {
11 useEffect(() => {
12 if (loading) setLoadingFavicon();

TownieuseCreditBalance.tsx1 match

@fave_24•Updated 3 days ago
2import { useState, useEffect } from "react";
3
4export function useCreditBalance() {
5 const [balance, setBalance] = useState<number | null>(null);
6 const [loading, setLoading] = useState(true);

TownieuseCreateProject.tsx1 match

@fave_24•Updated 3 days ago
3const ENDPOINT = "/api/create-project";
4
5export function useCreateProject() {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(false);

TownieuseCreateBranch.tsx1 match

@fave_24•Updated 3 days ago
3const ENDPOINT = "/api/create-branch";
4
5export function useCreateBranch(projectId: string) {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(false);

TownieuseChatLogic.ts1 match

@fave_24•Updated 3 days ago
14const LIMIT_RE = /You have reached/;
15
16export function useChatLogic({
17 project,
18 branchId,

TownieuseBranches.tsx1 match

@fave_24•Updated 3 days ago
3const ENDPOINT = "/api/project-branches";
4
5export function useBranches (projectId: string) {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(true);

Townieusage-detail.ts1 match

@fave_24•Updated 3 days ago
43}
44
45export function renderUsageDetail(
46 usage: UsageDetail,
47 inferenceCalls: InferenceCall[],

Townietext-editor.ts1 match

@fave_24•Updated 3 days ago
4import fileWithLinesNumbers from "../utils/fileWithLinesNumbers.ts";
5
6function printFileType(file: any) {
7 if (file.type === "interval")
8 return " (cron)";
tuna

tuna9 file matches

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