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=1315&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 18515 results for "function"(1804ms)

solidAquaHarriermain.tsx1 match

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

scientificSalmonBonobomain.tsx1 match

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

obedientPeachPheasantmain.tsx1 match

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

invincibleTanMarmosetmain.tsx1 match

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

expertCoralDinosaurmain.tsx1 match

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

emailRandomJokemain.tsx1 match

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

JokeGeneratorRealmain.tsx1 match

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

scribemain.tsx8 matches

@yawnxyz•Updated 5 months ago
35}
36
37// Helper function to normalize transcription response
38function normalizeTranscription(response: string | Transcription): Transcription {
39 console.log('Normalized transcription:', response);
40 if (typeof response === 'string') {
45
46// Fetch the size of the file using HTTP HEAD request
47export async function fetchFileSize(url: string): Promise<number> {
48 const response = await fetch(url, { method: 'HEAD' });
49 const contentLength = response.headers.get('content-length');
52
53// Transcribe a single chunk of audio data using Deno's ReadableStream
54async function transcribeChunk(buffer: Uint8Array, params: TranscriptionParams): Promise<Transcription> {
55 console.log('Transcribing chunk with params:', {
56 model: params.model,
80}
81
82export async function transcribeAudio(input: AudioInput, params: TranscriptionParams): Promise<Transcription> {
83 console.log('Transcribing audio with params:', params);
84
214}
215
216async function getTranscript(data) {
217 try {
218 console.log("Starting transcription...");
720// Inlined content from ./plugins/useAuth.js
721// Based on threadg1rl's auth system
722function useAuth(Alpine) {
723 Alpine.data('authApp', () => ({
724 user: {},
775}
776
777// Export the function properly
778export const useAuthExport = `
779 const useAuth = ${useAuth.toString()};

constantPeachPorcupinemain.tsx1 match

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

statusmain.tsx3 matches

@DFYMagicThemes•Updated 5 months ago
5import { renderToString } from "npm:react-dom/server";
6
7function StatusRow({ rows }) {
8 return (
9 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",

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.