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?q=function&page=29&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 34996 results for "function"(2194ms)

onet2main.tsx4 matches

@join•Updated 3 days ago
814// --- AI SYSTEM PROMPTS ---
815const PROMPT_REFINER_SYSTEM_PROMPT =
816 `You operate as a specialized prompt engineer to generate {{variable}} meta prompts. Your function is to transmute raw, structured occupational data into an elaborate, efficacious, and long-form directive for a target AI. You will be given an "Occupation," "Task," and ancillary data fields. Your generated prompts must be comprehensive, detailed, and structured as a professional brief, suitable for guiding an advanced AI agent.
817
818# Core Rule
819This is the most critical mandate of your function. YOU MUST RETURN A PROMPT THAT HAS {{variables}} IN IT!! Your purpose is not to create a static prompt, but a reusable **template**. Your primary goal is to identify the most important, undefined, or abstract entities and concepts within the user's \`Task\` description and convert them all into descriptive, double-curly-braced {{placeholders}} or {{variables}} . You MUST include at least 2 placeholder variables in your response. For example, if the task is "Analyze data on market conditions to identify potential sales of a product or service," the key undefined entity is "a product or service," which you MUST turn into a placeholder like \`{{product_or_service}}\`. Other examples include specific documents ("a report" -> \`{{report_topic}}\`), timeframes ("in the coming quarter" -> \`{{target_quarter}}\`), or clients ("for the client" -> \`{{client_name}}\`). A generated prompt template that fails to create appropriate \`{{placeholders}}\` for all such undefined entities is considered a failure. You must always create at least one.
820
821# Instructions
898
899// --- FRONTEND ---
900function generateHtml(sourceUrl: string) {
901 return `
902 <!DOCTYPE html>
1020 let formFieldsState = [];
1021
1022 function renderLatexDocument(latexSource, targetElement) {
1023 if (!latexSource || !targetElement) return;
1024

github-user-emailgithub.ts1 match

@stevekrouse•Updated 3 days ago
59}
60
61export function isPushEvent(event: GitHubEvent): event is PushEvent {
62 return event.type === "PushEvent" && event.payload?.commits;
63}

github-user-emailgithub-commits.ts2 matches

@stevekrouse•Updated 3 days ago
2import type { EmailOccurrence, Repository, CommitData } from "../types/github.ts";
3
4export async function getGithubUserEmailFromCommits(
5 username: string,
6): Promise<EmailOccurrence[]> {
9}
10
11export async function getGithubUserEmailFromCommitsWithDebug(
12 username: string,
13): Promise<{ results: EmailOccurrence[]; debugData: any }> {

github-user-emailgithub-events.ts2 matches

@stevekrouse•Updated 3 days ago
5import { isPushEvent } from "../types/github.ts";
6
7export async function getGithubUserEmailFromEvents(
8 username: string,
9): Promise<EmailOccurrence[]> {
12}
13
14export async function getGithubUserEmailFromEventsWithDebug(
15 username: string,
16): Promise<{ results: EmailOccurrence[]; debugData: any }> {

github-user-emailSearchForm.tsx1 match

@stevekrouse•Updated 3 days ago
1/** @jsxImportSource npm:hono/jsx */
2
3export function SearchForm({ username, method }: { username?: string; method?: string }) {
4 return (
5 <form class="mb-8">

github-user-emailLayout.tsx1 match

@stevekrouse•Updated 3 days ago
1/** @jsxImportSource npm:hono/jsx */
2
3export function Layout({ children, viewSourceUrl }: { children: any; viewSourceUrl: string }) {
4 return (
5 <html>

ccExtensionStatsmain.tsx1 match

@ampp•Updated 3 days ago
1// Val.town Endpoint 3: ccExtensionStats
2// Statistics and analytics endpoint for passdown data
3export default async function(req: Request): Promise<Response> {
4 const corsHeaders = {
5 "Access-Control-Allow-Origin": "*",

ccPassdownAcknowledgemain.tsx1 match

@ampp•Updated 3 days ago
1// Val.town Endpoint 2: ccPassdownAcknowledge
2// Specialized endpoint for acknowledgment operations
3export default async function(req: Request): Promise<Response> {
4 const corsHeaders = {
5 "Access-Control-Allow-Origin": "*",

ccExtensionPassdownsmain.tsx1 match

@ampp•Updated 3 days ago
2// Make sure this val is set to PUBLIC and named exactly "ccExtensionPassdowns"
3
4export default async function handler(req: Request): Promise<Response> {
5 console.log(`[${new Date().toISOString()}] ${req.method} request received`);
6

github-user-emaildemo.tsx4 matches

@stevekrouse•Updated 3 days ago
14}
15
16function Layout({ children }: { children: any }) {
17 return (
18 <html>
31}
32
33function SearchForm({ username }: { username?: string }) {
34 return (
35 <form class="mb-8">
62}
63
64function ResultsTable({ results }: { results: EmailOccurrence[] }) {
65 if (results.length === 0) {
66 return (
143}
144
145function ErrorMessage({ error }: { error: string }) {
146 return (
147 <div class="bg-red-50 border border-red-200 rounded-lg p-4">

discordWebhook2 file matches

@stevekrouse•Updated 2 weeks ago
Helper function to send Discord messages
tuna

tuna9 file matches

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