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=2069&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 22564 results for "function"(2667ms)

glifJsonmain.tsx1 match

@cjpais•Updated 1 year ago
3export const glifJson = async (id: string) => {
4 const getRandom = (list) => {
5 const shuffledList = list.sort(function () {
6 return 0.5 - Math.random();
7 });

mgsrBotEndpointmain.tsx1 match

@rayman•Updated 1 year ago
60 }));
61 break;
62 // Helper function to show the user an ephemeral message how to undo a recorded game.
63 case "Undo Help":
64 res.json({

copy_textmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
2
3export default async function(ctx: BrowserContext<{ text: string }>) {
4 return {
5 type: "copy",

open_urlmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
2
3export default async function(ctx: BrowserContext<{ url: string }>) {
4 return {
5 type: "open",

search_user_valsmain.tsx1 match

@pomdtr•Updated 1 year ago
2import { valToListItem } from "https://esm.town/v/pomdtr/val_to_listitem";
3
4export default async function(ctx: BrowserContext<{ user: string }>) {
5 const { user: userID } = ctx.params;
6 const resp = await fetch(`https://api.val.town/v1/users/${userID}/vals?limit=100`, {

mgsrBotEndpoint2main.tsx2 matches

@stevekrouse•Updated 1 year ago
5import process from "node:process";
6
7export async function mgsrBotEndpoint(request) {
8 const signatureTimestamp = request.headers.get("X-Signature-Timestamp");
9 const signatureEd25519 = request.headers.get("X-Signature-Ed25519");
54}
55
56async function handleApplicationCommands(body) {
57 let response;
58 switch (body.data.name) {

testUrlConstructionValmain.tsx2 matches

@willthereader•Updated 1 year ago
4// File: testUrlConstructionVal.js in Val Town (Named: @username.testUrlConstructionVal)
5export const testUrlConstructionVal = (async () => {
6 // Reference the function from the other Val
7 // Example input
8 const order = ["created_at DESC", "id DESC"]; // Sorting order for comments
9 const timestamp = "2024-01-19T17:00:00.000Z"; // Filtering criteria
10 const page = 1; // Page number to fetch
11 // Invoke the function from the other Val
12 const constructedUrl = ConstructReadTangleUrl2(timestamp);
13 logMessage("debug", `Constructed URL: ${constructedUrl}`);

keyDidResolvermain.tsx2 matches

@vladimyr•Updated 1 year ago
1import ky from "npm:ky@1.2.0";
2
3function resolveDidKey(did) {
4 return ky.get(`https://dev.uniresolver.io/1.0/identifiers/${did}`, {
5 headers: {
9}
10
11export function getResolver() {
12 return { key: resolveDidKey };
13}

sqliteDumpREADME.md4 matches

@nbbaier•Updated 1 year ago
1# SQLite Dump Util
2
3A utility function that generates SQL statements to dump the data and schema of tables in a SQLite database.
4
5## Usage
25```
26
27## Function Signature
28
29```typescript
30function sqliteDump(tables?: string[], callback?: ((result: string) => string | void | Promise<void>) | undefined): Promise<string | void>
31```
32
34
35- `tables`: (Optional) Array of table names to include in the dump. If not provided, all tables will be included.
36- `callback`: (Optional) An (potentially async) callback function to process the dump result. The callback receives the dump string as its argument.
37

untitled_jadeLizardmain.tsx1 match

@trea•Updated 1 year ago
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4
5export default async function(req: Request): Promise<Response> {
6 console.log(req.headers, req.headers.get("Authorization"));
7

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.