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/$%7Bart_info.art.src%7D?q=function&page=2122&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 22744 results for "function"(3393ms)

fsrsEndpointmain.tsx5 matches

@syncretizm•Updated 1 year ago
288}
289
290function formatDate(date, timeZone = "Asia/Singapore") {
291 if (!(date instanceof Date) || isNaN(date.getTime())) {
292 return new Date(); // Return a placeholder or handle the error
312}
313
314function serverToTimeZone(timeZoneOffset) {
315 const nowUTC = new Date();
316 const offsetMilliseconds = timeZoneOffset * 60 * 60 * 1000;
319}
320
321function getRatingKey(grade) {
322 const ratingKeys = ["Again", "Hard", "Good", "Easy"]; // Array of keys in the Rating object
323 return ratingKeys[grade - 1]; // Subtract 1 because array indices start at 0
325
326// FSRS API Handler
327export async function fsrsEndpoint(req) {
328 // difficulty = 0, stability = 0, state = 0, reps = 0, lapses = 0, scheduled_days = 0, elapsed_days = 0;
329 // let lastReview = null;
406 const formattedDueDate = formatDate(dueDate, timeZone);
407
408 function ldp(num, decimalPlaces, defaultvalue) {
409 if (typeof num === "number" && !isNaN(num)) {
410 return parseFloat(num.toFixed(decimalPlaces));

untitled_peachQuokkamain.tsx1 match

@bellaboateng•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

untitled_orangeSwallowmain.tsx1 match

@deeks2115•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

untitled_sapphireHornetmain.tsx1 match

@dluscombe•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

untitled_blushSkinkmain.tsx1 match

@ian965•Updated 1 year ago
3// Fetches a random joke.
4// Fetches a random joke.
5async function fetchRandomJoke() {
6 const response = await fetch(
7 "https://official-joke-api.appspot.com/random_joke",

untitled_brownGrasshoppermain.tsx1 match

@achitnis086•Updated 1 year ago
2
3// Fetches a random joke
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

untitled_moccasinDragonmain.tsx1 match

@moeykens_n•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

JokeGenmain.tsx1 match

@namthach•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

jokegeneratormain.tsx1 match

@arjunvgithub•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

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.