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%20%22Optional%20title%22?q=function&page=15&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 18618 results for "function"(1504ms)

9const LOCK_TIMEOUT = 15 * 60 * 1000;
10
11// Main function that runs as a scheduled val
12export default async function() {
13 console.log("🕒 Map Vote Cron Job started");
14
109}
110
111// Utility function to clear the lock manually if needed
112export async function clearLock() {
113 try {
114 await blob.delete("is_creating_map_vote");

crypto-geminiscript.tsx2 matches

@hexmanshu•Updated 22 hours ago
57const FNG_API_URL = "https://api.alternative.me/fng/?limit=1";
58
59async function fetchFromApi<T>(url: string, isCoinGecko: boolean = true): Promise<T | null> {
60 const headers: HeadersInit = {};
61 if (isCoinGecko && COINGECKO_API_KEY) {
78}
79
80export default async function(req: Request): Promise<Response> {
81 // Set CORS headers to allow requests from any origin (or restrict to your frontend's domain)
82 // For development, '*' is fine. For production, specify your frontend's origin.
27}
28// Get current configuration from hardcoded values
29export function getCurrentConfig() {
30 try {
31 const config = {
42
43// Get completed vote bookend embed data
44export function getCompletedVoteBookendEmbedData(): CompletedVoteCreationBookendEmbedData {
45 return {
46 topBookend: {
23}
24
25export function getHellLetLooseMapData(): HellLetLooseMapData {
26 return {
27 Maps: [
12
13// Get initial embed data
14export function getInitialEmbedData(): InitialVoteCreationEmbedData {
15 return {
16 InitialEmbedTitle: "Loading . . .",

forwarderforwarder1 match

@shlmt•Updated 23 hours ago
5const { author, name } = extractValInfo(import.meta.url);
6
7export async function forwarder(e: Email) {
8 let attachments: AttachmentData[] = [];
9 for (const f of e.attachments) {

translateToEnglishWithOpenAImain.tsx1 match

@shlmt•Updated 23 hours ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function translateToEnglishWithOpenAI(text: string) {
4 const openai = new OpenAI();
5 const completion = await openai.chat.completions.create({
1// Get alphabet image URLs
2export function getAlphabetImageUrls(): Record<string, string> {
3 return {
4 "A": "https://i.imgur.com/POhK1wg.png",

mastodon-pogodanew-file-2457.tsx1 match

@tomasz•Updated 23 hours ago
4import { load } from "npm:cheerio";
5
6async function mastodonWeatherMap() {
7 const html = await fetchText("https://www.bankier.pl//gielda/notowania/indeksy-gpw"); // Przykład linku do strony z ETF-ami
8 const $ = load(html);

getFileEmail4 file matches

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

tuna8 file matches

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