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/$%7Burl%7D?q=function&page=2081&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 22454 results for "function"(2489ms)

untitled_amethystShrewmain.tsx1 match

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

aoc23_05main.tsx5 matches

@karfau•Updated 1 year ago
60// expect(firstStar(``), "*1 sample 2").to.equal("?");
61
62function firstStar(input: string) {
63 const [, seedsInput, ...mapsInput] = input.split(/\s*[a-z -]+:\s*/m);
64 const seeds = extractNumbers(seedsInput);
71expect(secondStar(sample), "*2 sample 1").to.equal(46);
72// expect(secondStar(``), "*1 sample 2").to.equal("?");
73function secondStar(input: string) {
74 const [, seedsInput, ...mapsInput] = input.split(/\s*[a-z -]+:\s*/m);
75 const maps = mapsInput.map(parseMap);
91console.log("solution *2:", secondStar(input()));
92
93function input() {
94 return `seeds: 3121711159 166491471 3942191905 154855415 3423756552 210503354 2714499581 312077252 1371898531 165242002 752983293 93023991 3321707304 21275084 949929163 233055973 3626585 170407229 395618482 226312891
95
282
283// [0,1,2,3].reduce(sum, 0) => 6
284function sum(sum: number, current: number) {
285 return sum + current;
286}
287// wrap a value to print and return it
288function debug<T>(value: T, msg = "debug"): T {
289 console.log(msg, value);
290 return value;

untitled_coralGerbilmain.tsx1 match

@lokyeyoung_create•Updated 1 year ago
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 const SAMPLE_JOKE = {
6 "setup": "What do you call a group of disorganized cats?",

untitled_sapphireEchidnamain.tsx1 match

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

crates_iomain.tsx1 match

@vladimyr•Updated 1 year ago
26});
27
28export async function getCrateInfo(crateName: string, version?: string) {
29 const createURL = joinURL(API_URL, `/crates/${crateName}`);
30 const crateInfo = parse(CrateInfoSchema, await ky.get(createURL).json());

systemsDevModulemain.tsx1 match

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

npmRegistrymain.tsx1 match

@vladimyr•Updated 1 year ago
17});
18
19export async function getPkgInfo(pkgName: string, version = "latest") {
20 const pkgURL = new URL(encodeURIComponent(pkgName).replace(/^%40/, "@"), REGISTRY_URL);
21 const headers = {

podcastBadgemain.tsx1 match

@vladimyr•Updated 1 year ago
58export default app.fetch;
59
60async function getBadgeOptions(rssUrl: string | URL): Promise<BadgenOptions> {
61 const label = BADGE_LABEL;
62 try {

spotifyPodcastmain.tsx2 matches

@vladimyr•Updated 1 year ago
1export function isSpotifyPodcast(podcastURL: URL | string) {
2 try {
3 podcastURL = new URL(podcastURL);
9}
10
11export function getSpotifyId(podcastURL: URL | string) {
12 try {
13 podcastURL = new URL(podcastURL);

applePodcastmain.tsx2 matches

@vladimyr•Updated 1 year ago
1export function isApplePodcast(podcastURL: URL | string) {
2 try {
3 podcastURL = new URL(podcastURL);
9}
10
11export function getItunesId(podcastURL: URL | string) {
12 try {
13 podcastURL = new URL(podcastURL);

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.