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=1662&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 18002 results for "function"(1429ms)

animemain.tsx1 match

@yieldray•Updated 1 year ago
98};
99
100export async function anime(catOrName?: number | string, episode?: string | number) {
101 if (catOrName != undefined)
102 if (episode != undefined) return getEpisode(catOrName, episode);

extractReceiptEndpointmain.tsx1 match

@clayway•Updated 1 year ago
7 time_zone: string;
8};
9export async function extractReceiptEndpoint(request: Request): Promise<Response> {
10 if (request.method !== "POST") {
11 return Response.json({

receive_emailmain.tsx1 match

@andreterron•Updated 1 year ago
2import { saveToAirtable } from "https://esm.town/v/andreterron/saveToAirtable";
3
4export async function receive_email(email: Email) {
5 console.log(JSON.stringify(email, null, 2));
6 const data = await extractData(email);

untitled_674cf68fmain.tsx1 match

@neverstew•Updated 1 year ago
2import { htmlResponse } from "https://esm.town/v/neverstew/htmlResponse";
3
4export async function untitled_674cf68f(request: Request): Promise<Response> {
5 return htmlResponse(
6 <main>

getAccessTokenmain.tsx1 match

@raymondcamden•Updated 1 year ago
1export async function getAccessToken(id, secret) {
2 const params = new URLSearchParams();
3 params.append("client_secret", secret);

getRedditAccessTokenmain.tsx1 match

@tambre•Updated 1 year ago
4
5// The account's 2FA needs to be disabled.
6export async function getRedditAccessToken() {
7 const formData = new URLSearchParams();
8 formData.append("grant_type", "password");

parse_cookiesREADME.md1 match

@mattx•Updated 1 year ago
2Parses Cookie headers into objects.
3- `jar`: Value of the Cookie header
4- `decoder`: Function to run on all cookie names and values. This is to get around character limitations (see [RFC 6265](https://httpwg.org/specs/rfc6265.html#rfc.section.4.1.1)). There is no formal standard, but as most sites prefer URL encoding, it is the default. `x => x` can be used as a way to disable decoding.
5
6Migrated from folder: loginable_demo/parse_cookies

valSignmain.tsx1 match

@easrng•Updated 1 year ago
2import { Buffer } from "node:buffer";
3
4export async function valSign({ keys, data, expireIn }: {
5 keys: {
6 publicKey: string;

valSignVerifymain.tsx1 match

@easrng•Updated 1 year ago
1import { Buffer } from "node:buffer";
2
3export async function valSignVerify(encoded: string) {
4 const matches = (encoded + "").match(/^@([^\.]+)\.(.+)$/);
5 if (!matches)

generateKeysmain.tsx1 match

@easrng•Updated 1 year ago
1import { Buffer } from "node:buffer";
2
3export async function generateKeys() {
4 const { default: nacl } = await import("npm:tweetnacl@1.0.3");
5 const keyPair = nacl.sign.keyPair();

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",