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=1786&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 19392 results for "function"(2638ms)

untitled_tomatoHarriermain.tsx1 match

@bli27•Updated 1 year ago
1function x() {
2 console.log("Welcome to CS1200!");
3}

untitled_indigoSolemain.tsx1 match

@reshmarajkuma03•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",

ghAssignCardWhenOnColumnmain.tsx1 match

@augustohp•Updated 1 year ago
8 * @return boolean TRUE if an assignment was made.
9 */
10export async function ghAssignCardWhenOnColumn(
11 issueNodeId: string,
12 assigneeNodeId: string,

untitled_oliveTapirmain.tsx1 match

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

untitled_ivoryBeavermain.tsx1 match

@dwrii•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_coffeeDuckmain.tsx1 match

@josh_mcd05•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",

countWeekdaysInMonthmain.tsx1 match

@augustohp•Updated 1 year ago
1const { default: dayjs } = await import("https://esm.sh/dayjs");
2
3export async function countWeekdaysInMonth(
4 weekday:
5 | "Monday"

untitled_orangeGophermain.tsx1 match

@NghiiHua•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",

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",

getFileEmail4 file matches

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

tuna8 file matches

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