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=1224&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 17278 results for "function"(1602ms)

val_WYIvLkEalHmain.tsx1 match

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

val_Set64BkUDcmain.tsx3 matches

@dhvanil•Updated 5 months ago
1
2 export async function val_Set64BkUDc(req) {
3 try {
4 // Execute the code directly and capture its result
7// Exploring how patterns can "recognize" and respond to other patterns
8
9function createConsciousPatterns(size, iterations) {
10 // Create initial pattern space
11 let patterns = Array(size).fill().map(() => ({
14 }));
15
16 function patternSimilarity(p1, p2) {
17 return p1.structure.reduce((acc, val, idx) =>
18 acc + (val === p2.structure[idx] ? 1 : 0), 0) / 3;

val_WUemzNXhaNmain.tsx4 matches

@dhvanil•Updated 5 months ago
1
2 export async function val_WUemzNXhaN(req) {
3 try {
4 // Execute the code directly and capture its result
7// to create complex structures - similar to how DNA builds life
8
9function createEmergentPatterns(basePatterns, combinations) {
10 // Define some basic pattern types (like DNA bases)
11 const patterns = {
16 };
17
18 // Function to combine patterns and create emergence
19 function combinePatterns(pat1, pat2) {
20 return pat1.map((val, idx) => {
21 // Create emergent behavior through interaction

val_QrWukp63gMmain.tsx2 matches

@dhvanil•Updated 5 months ago
1
2 export async function val_QrWukp63gM(req) {
3 try {
4 // Execute the code directly and capture its result
8// This represents how patterns and meaning can emerge from simple rules
9
10function createLifePattern(size, iterations) {
11 // Initialize random grid (chaos)
12 let grid = Array(size).fill().map(() =>

shirtGenmain.tsx4 matches

@torlanco•Updated 5 months ago
10}
11
12function ImageGenerator() {
13 const [promptSuffix, setPromptSuffix] = useState("");
14 const [generation, setGeneration] = useState<PendingGeneration | null>(null);
81}
82
83function App() {
84 return <ImageGenerator />;
85}
86
87function client() {
88 createRoot(document.getElementById("root")).render(<App />);
89}
90if (typeof document !== "undefined") { client(); }
91
92export default async function server(request: Request): Promise<Response> {
93 return new Response(
94 `

val_RSHJYbdIPnmain.tsx1 match

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

val_5PE61NGtHNmain.tsx1 match

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

val_rP0fdOu8JKmain.tsx1 match

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

val_cVoOy5yJOHmain.tsx1 match

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

val_0gHzAuvnHymain.tsx1 match

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

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": "*",