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/$1?q=function&page=8&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 24046 results for "function"(1699ms)

Fairnotify1 match

@canstralian•Updated 5 hours ago
4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}

Fairmonitor1 match

@canstralian•Updated 5 hours ago
9const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
10
11export async function uptimeCheck(url: string, attempt = 1) {
12 let reason: string = "";
13 let status: number | null = null;

GlancerdemoCache.ts1 match

@lightweight•Updated 5 hours ago
11// this cron updates a blob that the ../../shared/utils/pollEnabledStatus.ts hits during demos
12// that blob determines whether or not the cobrowsing button is ON or OFF
13export default async function (interval: Interval) {
14 // every page in the "Glancer demo" database should have it's own blob, so we have a cache for each demo
15 // this cron saves a blob for every page in the Demos DB

webscrapeBareBonesTikimain.tsx1 match

@eczajk•Updated 5 hours ago
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
4
5function isHTMLElement(node: Node): node is HTMLElement {
6 return node.nodeType === Node.ELEMENT_NODE;
7}

ChatMessage.tsx3 matches

@c15r•Updated 5 hours ago
19}
20
21export default function MessageComponent({ message }: MessageProps) {
22 const [expandedSections, setExpandedSections] = useState<Set<string>>(new Set());
23
152
153 // Detect tool calls
154 if (line.includes('tool_use') || line.includes('function_call')) {
155 try {
156 // Try to parse as JSON
170
171 // Detect tool results
172 if (line.includes('tool_result') || line.includes('function_result')) {
173 try {
174 const resultData = JSON.parse(line);

untitled-2795main.tsx1 match

@notpickard•Updated 5 hours ago
1import axios from "axios";
2async function fetchUsers() {
3 try {
4 const response = await axios.get("https://jsonplaceholder.typicode.com/users");

endpointsget_vals_endpoints.tsx1 match

@chadparker•Updated 6 hours ago
1export default async function(req: Request) {
2 try {
3 const apiKey = Deno.env.get("VALTOWN_API_TOKEN");

saulyteindex.tsx1 match

@laurynas•Updated 6 hours ago
40}
41
42function App() {
43 const [weatherData, setWeatherData] = useState<WeatherData | null>(null);
44 const [location, setLocation] = useState<Location | null>(null);

MCPApp.tsx1 match

@c15r•Updated 6 hours ago
22}
23
24export function App() {
25 const [apiKey, setApiKey] = useState<string>("");
26 const [messages, setMessages] = useState<Message[]>([]);

MCPApiKeyInput.tsx1 match

@c15r•Updated 6 hours ago
7}
8
9export function ApiKeyInput({ apiKey, onApiKeyChange }: ApiKeyInputProps) {
10 const [isVisible, setIsVisible] = useState(false);
11 const [tempKey, setTempKey] = useState(apiKey);

getFileEmail4 file matches

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

tuna8 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.