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/?q=function&page=32&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 30746 results for "function"(2363ms)

Plantfo

Plantfotest.html2 matches

@Llad•Updated 1 day ago
128
129 <script>
130 async function testPlant() {
131 const plantName = document.getElementById('plantInput').value.trim();
132 const responseContent = document.getElementById('responseContent');
177
178 // Copy URL to clipboard
179 function copyUrl() {
180 const urlText = document.getElementById('urlDisplay').textContent;
181 navigator.clipboard.writeText(urlText).then(() => {
Plantfo

Plantfoadmin.html2 matches

@Llad•Updated 1 day ago
34
35 <script>
36 async function loadData() {
37 try {
38 const response = await fetch('/admin/cache/full');
66 }
67
68 async function clearCache() {
69 if (!confirm('Are you sure you want to clear all cached data? This action cannot be undone.')) {
70 return;

fashionWardrobefashionWardrobe.tsx3 matches

@kaltesommer•Updated 1 day ago
15 * @returns {Promise<any>} Das gespeicherte Kleidungsstück-Objekt.
16 */
17export async function addWardrobeItem(imageUrl: string, description: string) {
18 if (!imageUrl || !description || description.trim() === "") {
19 throw new Error("imageUrl und description sind erforderlich.");
43 * @returns {Promise<Array<any>>} Eine Liste von Kleidungsstück-Objekten.
44 */
45export async function getWardrobe() {
46 // Ruft alle Schlüssel (IDs) ab, die zum Benutzer gehören.
47 const userWardrobeKeys = (await db.get(`user_wardrobe_keys:${USER_ID}`)) || [];
62// Dies ist der HTTP-Endpunkt deiner Val. Val Town stellt diese Funktion über eine URL bereit.
63// Sie reagiert auf POST-Anfragen (zum Hinzufügen von Items) und GET-Anfragen (zum Abrufen von Items).
64export default async function(req: Request): Promise<Response> {
65 if (req.method === "POST") {
66 try {

molarmessengermain.tsx2 matches

@Dentalabcs•Updated 1 day ago
1export default async function(req: Request): Promise<Response> {
2 if (req.method !== "POST") {
3 return new Response("Only POST allowed", { status: 405 });
66}
67
68async function sendTwilioMessage(to: string, body: string) {
69 const res = await fetch(
70 `https://api.twilio.com/2010-04-01/Accounts/${Deno.env.get("TWILIO_ACCOUNT_SID")}/Messages.json`,

web_kVDHRd4ECFmain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

web_a0FrDgrpnimain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

reactHonoStarterApp.tsx1 match

@Twissy•Updated 1 day ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [clicked, setClicked] = useState(0);
6 return (

web_UBBZ9j3vK9main.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

web_rBLwvWdDlnmain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

cardamonparse.ts4 matches

@connnolly•Updated 1 day ago
9// PDF parsing is now handled by unpdf library
10
11// Function to validate and clean recipe data
12function validateAndCleanRecipe(recipe: any): Recipe {
13 // Ensure required fields exist
14 if (!recipe.title || typeof recipe.title !== "string") {
75}
76
77// Function to convert fractional Unicode characters to decimal values
78function convertFractionsToDecimals(text: string): string {
79 const fractionMap: { [key: string]: string } = {
80 "¼": "0.25",
tuna

tuna9 file matches

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