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=2142&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 22243 results for "function"(1587ms)

decomposeGlideWebhookParamsmain.tsx1 match

@markprobst•Updated 1 year ago
1export function decomposeGlideWebhookParams(params, names) {
2 const results = [];
3 for (const name of names) {

myApimain.tsx1 match

@MattPayneOrg•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

createQdrantCollectionmain.tsx1 match

@wilt•Updated 1 year ago
5 * Uses recommended values for OpenAPI embeddings
6 */
7export async function createQdrantCollection(args: {
8 collectionName: string;
9 qdrantKey: string;

sendRandomChihuahuaToSlackmain.tsx1 match

@metart43•Updated 1 year ago
2import process from "node:process";
3
4export async function sendRandomChihuahuaToSlack() {
5 const dogAPIURL = new URL(
6 "https://dog.ceo/api/breed/chihuahua/images/random",

valToStringmain.tsx1 match

@sdan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function valToString(val: string) {
4 if (val.startsWith("@")) {
5 val = val.slice(1);

questionmain.tsx1 match

@tmcw•Updated 1 year ago
1export function question() {
2 return "hello";
3}

measureValTownE2emain.tsx1 match

@tmcw•Updated 1 year ago
28
29 console.log(
30 `average e2e user function time: ${(
31 userFuncTimes.reduce((a, b) => a + b, 0) / count
32 ).toFixed(0)}ms (fastest was ${userFuncTimes

checkIfTwitterAPIIsDownmain.tsx1 match

@stevekrouse•Updated 1 year ago
7// until it's down, and store the state in
8// @stevekrouse.twitterAPIDown ({ down: boolean, reason: string})
9export async function checkIfTwitterAPIIsDown() {
10 try {
11 // query for something we know will return results

myApimain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

groupBymain.tsx5 matches

@stevekrouse•Updated 1 year ago
3 * (c) 2019 Tom Bremmer (https://tbremer.com/) and Chris Ferdinandi (https://gomakethings.com), MIT License,
4 * @param {Array} arr The array to group items from
5 * @param {String|Function} criteria The criteria to group by
6 * @return {Object} The grouped object
7 */
8export function groupBy<A>(arr: A[], criteria: ((a: A) => string) | string) {
9 return arr.reduce(function (obj, item) {
10 // Check if the criteria is a function to run on the item or a property of it
11 var key = typeof criteria === "function" ? criteria(item) : item[criteria];
12
13 // If the key doesn't exist yet, create it

getFileEmail4 file matches

@shouser•Updated 4 weeks 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.