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=71&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 19899 results for "function"(2028ms)

town-hallEventDetails.tsx1 match

@stevekrouse•Updated 2 days ago
2import React from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3
4export function EventDetails() {
5 return (
6 <div className="mt-4 p-4 bg-blue-50 rounded-lg border border-blue-100 text-gray-700 text-left w-full">

town-hallThankYouMessage.tsx1 match

@stevekrouse•Updated 2 days ago
2import React from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3
4export function ThankYouMessage() {
5 return (
6 <div className="text-center py-8">

town-hallApp.tsx1 match

@stevekrouse•Updated 2 days ago
6import { ThankYouMessage } from "./ThankYouMessage.tsx";
7
8export function App() {
9 const [formSubmitted, setFormSubmitted] = useState(false);
10 const [error, setError] = useState<string | null>(null);

Townie-02useUsageStats.ts1 match

@jxnblk•Updated 2 days ago
1import { useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3export function useUsageStats (messages: any[], usages: any[]) {
4 useEffect(() => {
5 if (!messages?.length) return;

Townie-02useScrollToBottom.tsx3 matches

@jxnblk•Updated 2 days ago
7 *
8 * @param {Array} dependencies - Array of dependencies that trigger scrolling when changed
9 * @returns {Object} An object containing containerRef and scrollToBottom function
10 */
11export function useScrollToBottomContainer(dependencies = []) {
12 const containerRef = useRef(null);
13
28
29// body scroll version
30export function useScrollToBottom(dependencies = []) {
31 const bottomRef = useRef(null);
32

Townie-02user-summary.ts1 match

@jxnblk•Updated 2 days ago
6 * This includes a fallback to inference calls data when usage data is missing
7 */
8export async function getUserSummary() {
9 // First, get the standard grouped data from the usage table
10 const groupedUsageData = await sqlite.execute(`

Townie-02useLoadingFavicon.ts3 matches

@jxnblk•Updated 2 days ago
1import { useEffect } from "https://esm.sh/react@18.2.0?dev";
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();

Townie-02useCreateProject.tsx1 match

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

Townie-02useCreateBranch.tsx1 match

@jxnblk•Updated 2 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);

Townie-02useChatLogic.ts1 match

@jxnblk•Updated 2 days ago
11}
12
13export function useChatLogic({
14 project,
15 branchId,

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.