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%22Image%20title%22?q=function&page=15&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 18321 results for "function"(547ms)

20
21// Main handler for HTTP requests
22export default async function(req: Request): Promise<Response> {
23 console.log("Request received:", req.method);
24
103
104// Extract issue numbers from PR body
105function extractIssueNumbers(body: string): number[] {
106 // Match common issue linking keywords, hacky
107 const patterns = [
128
129// Update PR title
130async function updatePRTitle(repo: string, prNumber: number, newTitle: string) {
131 const token = Deno.env.get("GITHUB_TOKEN");
132
28
29// Main handler for HTTP requests
30export default async function(req: Request): Promise<Response> {
31 console.log("Request received:", req.method);
32
130
131// Extract issue numbers from PR body
132function extractIssueNumbers(body: string): number[] {
133 // Match common issue linking keywords
134 const patterns = [
155
156// Fetch issue details
157async function fetchIssue(repo: string, issueNumber: number): Promise<GitHubIssue> {
158 const token = Deno.env.get("GITHUB_TOKEN");
159
187
188// Add labels to PR
189async function addLabelsToPR(repo: string, prNumber: number, labels: string[]) {
190 const token = Deno.env.get("GITHUB_TOKEN");
191
24
25// Main handler for HTTP requests
26export default async function(req: Request): Promise<Response> {
27 console.log("Request received:", req.method);
28
90
91// Assign a user to a PR
92async function assignUserToPR(repo: string, prNumber: number, username: string) {
93 const token = Deno.env.get("GITHUB_TOKEN");
94

gta6-new-lmaoserver.ts1 match

@hacksore•Updated 13 hours ago
1export default function server(request: Request): Response {
2 // Define the redirect targets
3 const SPECIAL_REDIRECT_TARGET = "https://www.youtube.com/watch?v=VQRLujxTm3c";

instagram-toolsfollows-check.jsx1 match

@julianpera•Updated 16 hours ago
2const fetchCookie = makeFetchCookie(fetch);
3
4export default async function handleCron(interval) {
5 const following = await fetchCookie(
6 "https://www.instagram.com/api/v1/friendships/375942300/following/?query=miguelse10",

untitled-4074utils.ts1 match

@manikrana•Updated 17 hours ago
4 * Validates and parses the incoming request payload
5 */
6export function parseRequestPayload(body: any): RenderRequest {
7 // Validate required fields
8 if (!body.component || typeof body.component !== "string") {

telegramBotStarterusers.tsx5 matches

@asdfg•Updated 17 hours ago
6 * Get information about a user
7 */
8async function getUserInfo(userId) {
9 return await DB.get(`userInfo:${userId}`);
10}
13 * Get list of all active users who have messaged the bot
14 */
15async function getActiveUsers() {
16 const keys = await DB.list({ prefix: "userInfo:" });
17 const users = [];
29 * Get list of blocked user IDs
30 */
31async function getBlockedUsers() {
32 return await DB.get("blockedUsers") || [];
33}
36 * Block a user
37 */
38async function blockUser(userId) {
39 const blockedUsers = await getBlockedUsers();
40 userId = userId.toString();
51 * Unblock a user
52 */
53async function unblockUser(userId) {
54 const blockedUsers = await getBlockedUsers();
55 userId = userId.toString();

telegramBotStartersetupHook.tsx3 matches

@asdfg•Updated 17 hours ago
1// ============================================================
2// SETUP FUNCTIONS
3// ============================================================
4
8 */
9
10export async function setupWebhook(webhookUrl) {
11 try {
12 const botToken = process.env.TELEGRAM_BOT_TOKEN;
33 * Get information about the webhook status
34 */
35async function getWebhookInfo() {
36 try {
37 const botToken = process.env.TELEGRAM_BOT_TOKEN;

turbo-testmain.tsx1 match

@msmh•Updated 18 hours ago
2import { createClient } from "npm:@libsql/client/web";
3
4function createTursoClient() {
5 const client = createClient({
6 url: process.env.url,

untitled-7883main.tsx1 match

@pomdtr•Updated 18 hours ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks 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.