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=2586&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 28846 results for "function"(1973ms)

newCommentNotificationmain.tsx1 match

@parkerdavis•Updated 11 months ago
5const baseUrl = "agave-astro.netlify.app";
6
7export default async function(req: Request): Promise<Response> {
8 if (req.method === "POST") {
9 const comment = await req.json() as Comment;

sqliteExplorerAppREADME.md1 match

@hlobil•Updated 11 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

SongTaggermain.tsx1 match

@benlenarts•Updated 11 months ago
125});
126
127async function getToken(c) {
128 const state = c.req.query("state") as string;
129 const authData = await db.select().from(table).where(eq(table.id, state)).limit(1);

dateme_faqmain.tsx1 match

@vawogbemi•Updated 11 months ago
6let linkClass = "text-sky-600 hover:text-sky-500";
7
8export default function FAQ(c) {
9 return c.html(
10 <Layout activeTab={new URL(c.req.url).pathname}>

sqliteExplorerAppREADME.md1 match

@burcs•Updated 11 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

processTextInChunksmain.tsx2 matches

@yawnxyz•Updated 11 months ago
3
4
5export async function processTextInChunks(inputText, processFn = async (text) => console.log(text), config = {}) {
6 const {
7 chunkLength = 1000,
49
50// just gives information about the chunks; doesn't actually do anything!
51export function preprocessTextChunks(inputText, config = {}) {
52 const {
53 chunkLength = 1000,

wikiOGmain.tsx3 matches

@stevekrouse•Updated 11 months ago
1async function getWikipediaInfo(url: string) {
2 // Extract the title from the URL
3 const title = url.split("/wiki/")[1];
25}
26
27export default async function(req: Request): Promise<Response> {
28 const url = new URL(req.url);
29 const path = url.pathname.replace(/^\/proxy/, "");
51 ${ogMetaTags}
52 <script type="text/javascript">
53 setTimeout(function() {
54 window.location.href = "${wikipediaUrl}";
55 }, 0);

WebComponentExamplemain.tsx1 match

@matthiasraimann•Updated 11 months ago
1export default async function(req: Request): Promise<Response> {
2 const jsFile = `
3 class RegisterForEvent extends HTMLElement {

Work_Time_Calculator_2README.md1 match

@willthereader•Updated 11 months ago
1I track how much time I work in a week in a note. This function takes that unstructured format and calculates how much time I work each day and week.
2
3The input looks like:

ownedGamesToSqlitemain.tsx1 match

@alvi•Updated 11 months ago
7const DISCORD_WEBSOCKET_URL = process.env.DISCORD_WEBSOCKET_URL;
8
9export default async function(interval: Interval) {
10 if (!STEAM_WEB_API_KEY || !STEAM_ID || !DISCORD_WEBSOCKET_URL) {
11 throw new Error("STEAM_WEB_API_KEY, STEAM_ID or DISCORD_WEBSOCKET_URL not set");
tuna

tuna9 file matches

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