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/$%7Burl%7D?q=function&page=9&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 31479 results for "function"(1374ms)

Townieuser-detail.ts1 match

@ianmenethil•Updated 1 day ago
36}
37
38export function renderUserDetail(data: UserSummaryRow[], userId: string, requests: UsageRequest[] = [], creditAdditions: CreditAddition[] = []): string {
39 // User data should only have one row if we're filtering by user ID
40 const userData = data[0] || {

TownieuseProject.tsx1 match

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

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

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

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

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

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

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

TownieuseBranches.tsx1 match

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

@ianmenethil•Updated 1 day ago
43}
44
45export function renderUsageDetail(
46 usage: UsageDetail,
47 inferenceCalls: InferenceCall[],
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.