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/$2?q=function&page=2749&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 29175 results for "function"(2126ms)

untitled_pinkRoundwormmain.tsx2 matches

@stevekrouse•Updated 1 year ago
5const KEY = import.meta.url.split("?")[0];
6
7export async function addComment(str) {
8 const comments = await blob.getJSON(KEY) as Array<string> ?? [];
9 comments.push(str);
11 await email({ text: "New Comment Alert!: " + str });
12}
13export async function getComments() {
14 return await blob.getJSON(KEY) as Array<string> ?? [];
15}

reportCommentsmain.tsx1 match

@vez•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3export function reportComments() {
4 email({ text: "elliot.website reported comment alert!" });
5}

randomMediaUrlmain.tsx1 match

@jamiedubs•Updated 1 year ago
1// select random record from "files" based on format
2export default async function(req: Request): Promise<Response> {
3 const format = new URL(req.url).searchParams.get("format");
4
1export const script_6sbfbg98wajm0b51pjunnu2pwj8nbi98 = (async function() {
2 const rosters = {
3 "Zack": ["PHI", "WSH", "IND", "TB", "LAR", "TEN", "HOU"],

twitterSearchmain.tsx1 match

@jplhomer•Updated 1 year ago
3import { twitterUser } from "https://esm.town/v/stevekrouse/twitterUser";
4
5export async function twitterSearch({
6 query,
7 start_time,

blob_admin_blobmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { blob } from "https://esm.town/v/std/blob";
3
4export async function blob_admin_blob(key: string) {
5 let response = await blob.get(key);
6 let text = await response.text();

sqlite_admin_tablesmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { blob } from "https://esm.town/v/std/blob?v=10";
3
4export async function sqlite_admin_tables() {
5 let blobs = await blob.list();
6 return (

watch_bilibili_videomain.tsx2 matches

@rebelpotato•Updated 1 year ago
1import { post_bilibili } from "https://esm.town/v/rebelpotato/bilibili_methods";
2
3function randint(x) {
4 return Math.floor(Math.random() * x);
5}
8
9// watch a bilibili video for a random time less than its duration
10export async function watch_video(video, cookie) {
11 let watch_video_data = {
12 aid: video.aid,

watch_random_bilibili_videomain.tsx2 matches

@rebelpotato•Updated 1 year ago
9};
10
11function brief(video) {
12 return {
13 tname: video.tname,
29}
30
31async function watch_random_video(cookie) {
32 try {
33 let video = await get_random_video(cookie);

htmlBuildermain.tsx5 matches

@xkonti•Updated 1 year ago
187 * Renders the provided tag into HTML string.
188 */
189export function renderTag(tag: TagDescriptor): string {
190 const content = renderTags(tag.content);
191
218 * Renders provided tags into a list of HTML strings.
219 */
220export function renderTags(tags: Array<HtmlContent>): string[] {
221 return tags.map(element => {
222 if (typeof element === "string") {
228}
229
230export function basicTag(tagName: string, content: HtmlContents | undefined = undefined): Tag {
231 const tag = new Tag(tagName);
232 if (content !== undefined) tag.addContent(content);
234}
235
236export function selfClosingTag(tagName: string): Tag {
237 return new Tag(tagName).makeSelfClose();
238}
239
240export function fragment(content: HtmlContents | undefined = undefined): Tag {
241 return basicTag("");
242}
tuna

tuna9 file matches

@jxnblk•Updated 1 day 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.