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/$1?q=function&page=2390&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 28754 results for "function"(5786ms)

val_IRL0Iqm2q4main.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function val_IRL0Iqm2q4(req) {
3 try {
4 // Execute the code directly and capture its result

val_0LDoys9VFkmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function val_0LDoys9VFk(req) {
3 try {
4 // Execute the code directly and capture its result

val_wzsgIq92EPmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function val_wzsgIq92EP(req) {
3 try {
4 // Execute the code directly and capture its result

val_hrjcREMr1Tmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function val_hrjcREMr1T(req) {
3 try {
4 // Execute the code directly and capture its result

val_hhGpnm1tf9main.tsx21 matches

@dhvanil•Updated 7 months ago
1
2 export async function val_hhGpnm1tf9(req) {
3 try {
4 // Execute the code directly and capture its result
5 const result = await (async () => {
6 function generateAllProblems() {
7 const arrayProblems = [
8 "Implement a function to find the missing number in an array of 1 to N",
9 "Write a function to rotate an array by k positions",
10 "Create a function to merge two sorted arrays",
11 "Implement a function to find the longest increasing subsequence",
12 "Write a function to find pairs in array with sum equal to target"
13 ];
14
15 const stringProblems = [
16 "Write a function to find the longest palindromic substring",
17 "Implement a function to check if two strings are anagrams",
18 "Create a function to find the first non-repeating character",
19 "Write a function to perform string compression (e.g., 'aabbb' -> 'a2b3')",
20 "Implement a function to validate balanced parentheses"
21 ];
22
23 const treeGraphProblems = [
24 "Implement a function to check if a binary tree is balanced",
25 "Write a function to find the lowest common ancestor in a binary tree",
26 "Create a function to serialize and deserialize a binary tree",
27 "Implement BFS and DFS for a graph",
28 "Write a function to detect a cycle in a directed graph"
29 ];
30
31 const algorithmProblems = [
32 "Implement a function to solve the N-Queens problem",
33 "Write a function to find the kth largest element using QuickSelect",
34 "Create a function to implement LRU Cache",
35 "Implement a function for word break problem using dynamic programming",
36 "Write a function to find the median of two sorted arrays"
37 ];
38

val_BUsb2yqi8ymain.tsx14 matches

@dhvanil•Updated 7 months ago
1
2 export async function val_BUsb2yqi8y(req) {
3 try {
4 // Execute the code directly and capture its result
5 const result = await (async () => {
6 function generateStringProblems() {
7 const problems = [
8 "Write a function to find the longest palindromic substring",
9 "Implement a function to check if two strings are anagrams",
10 "Create a function to find the first non-repeating character",
11 "Write a function to perform string compression (e.g., 'aabbb' -> 'a2b3')",
12 "Implement a function to validate balanced parentheses"
13 ];
14 return problems;
15}
16
17function generateArrayProblems() {
18 const problems = [
19 "Implement a function to find the missing number in an array of 1 to N",
20 "Write a function to rotate an array by k positions",
21 "Create a function to merge two sorted arrays",
22 "Implement a function to find the longest increasing subsequence",
23 "Write a function to find pairs in array with sum equal to target"
24 ];
25 return problems;
26}
27
28function combineProblemSets() {
29 return [...generateArrayProblems(), ...generateStringProblems()];
30}

val_oXSqoQ1L7Xmain.tsx7 matches

@dhvanil•Updated 7 months ago
1
2 export async function val_oXSqoQ1L7X(req) {
3 try {
4 // Execute the code directly and capture its result
5 const result = await (async () => {
6 function generateArrayProblems() {
7 const problems = [
8 "Implement a function to find the missing number in an array of 1 to N",
9 "Write a function to rotate an array by k positions",
10 "Create a function to merge two sorted arrays",
11 "Implement a function to find the longest increasing subsequence",
12 "Write a function to find pairs in array with sum equal to target"
13 ];
14 return problems;

val_bH5VlbZAwWmain.tsx3 matches

@dhvanil•Updated 7 months ago
1
2 export async function val_bH5VlbZAwW(req) {
3 try {
4 // Execute the code directly and capture its result
5 const result = await (async () => {
6 function generateArrayProblem() {
7 const operations = ['find duplicates', 'remove duplicates', 'find missing numbers', 'rotate array'];
8 const sizes = ['small', 'medium', 'large'];
13 const constraint = constraints[Math.floor(Math.random() * constraints.length)];
14
15 return `Write a function to ${operation} in a ${size} array ${constraint}.`;
16}
17

htmlToMarkdownConvertermain.tsx6 matches

@willow•Updated 7 months ago
4import TurndownService from "https://esm.sh/turndown";
5
6function convertTableToMarkdown(tableHtml) {
7 const parser = new DOMParser();
8 const doc = parser.parseFromString(tableHtml, 'text/html');
34}
35
36function App() {
37 const [html, setHtml] = useState('');
38 const [markdown, setMarkdown] = useState('');
46 service.addRule('tableRule', {
47 filter: ['table'],
48 replacement: function (content, node) {
49 return convertTableToMarkdown(node.outerHTML);
50 }
53 service.addRule('links', {
54 filter: ['a'],
55 replacement: function (content, node) {
56 return `[${content}](${node.getAttribute('href')})`;
57 }
102}
103
104function client() {
105 createRoot(document.getElementById("root")).render(<App />);
106}
108if (typeof document !== "undefined") { client(); }
109
110export default async function server(request: Request): Promise<Response> {
111 return new Response(`
112 <html>

web_La1PCylq8qmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function web_La1PCylq8q(req) {
3 return new Response(`<!DOCTYPE html>
4<html>

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.