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%22Optional%20title%22?q=function&page=2429&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 28846 results for "function"(2105ms)

savvyPurpleSpoonbillmain.tsx7 matches

@stevekrouse•Updated 7 months ago
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
45 }
46
47 function handleBack() {
48 if (currentIndex > 0) {
49 setCurrentIndex(currentIndex - 1);
52 }
53
54 function handleForward() {
55 if (currentIndex < history.length - 1) {
56 setCurrentIndex(currentIndex + 1);
132}
133
134function client() {
135 createRoot(document.getElementById("root")!).render(<App />);
136}
140}
141
142function extractCodeFromFence(text: string): string {
143 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
144 return htmlMatch ? htmlMatch[1].trim() : text;
145}
146
147export default async function server(req: Request): Promise<Response> {
148 if (req.method === "POST") {
149 const client = new Cerebras();

cerebras_debatermain.tsx3 matches

@stevekrouse•Updated 7 months ago
16];
17
18function App() {
19 const [personality1, setPersonality1] = useState("an emacs enthusiast");
20 const [personality2, setPersonality2] = useState("a vim enthusiast");
205}
206
207function client() {
208 createRoot(document.getElementById("root")).render(<App />);
209}
213}
214
215export default async function server(req: Request): Promise<Response> {
216 const url = new URL(req.url);
217

intellectualMaroonMockingbirdmain.tsx5 matches

@stevekrouse•Updated 7 months ago
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
131}
132
133function client() {
134 createRoot(document.getElementById("root")!).render(<App />);
135}
139}
140
141function extractCodeFromFence(text: string): string {
142 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
143 return htmlMatch ? htmlMatch[1].trim() : text;
144}
145
146export default async function server(req: Request): Promise<Response> {
147 if (req.method === "POST") {
148 const client = new Cerebras();

intellectualMaroonMockingbirdmain.tsx5 matches

@stevekrouse•Updated 7 months ago
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
131}
132
133function client() {
134 createRoot(document.getElementById("root")!).render(<App />);
135}
139}
140
141function extractCodeFromFence(text: string): string {
142 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
143 return htmlMatch ? htmlMatch[1].trim() : text;
144}
145
146export default async function server(req: Request): Promise<Response> {
147 if (req.method === "POST") {
148 const client = new Cerebras();

truthfulAmethystParakeetmain.tsx5 matches

@stevekrouse•Updated 7 months ago
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
123}
124
125function client() {
126 createRoot(document.getElementById("root")!).render(<App />);
127}
131}
132
133function extractCodeFromFence(text: string): string {
134 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
135 return htmlMatch ? htmlMatch[1].trim() : text;
136}
137
138export default async function server(req: Request): Promise<Response> {
139 if (req.method === "POST") {
140 const client = new Cerebras();

truthfulAmethystParakeetmain.tsx5 matches

@stevekrouse•Updated 7 months ago
6import { tomorrow } from "https://esm.sh/react-syntax-highlighter/dist/esm/styles/prism";
7
8function App() {
9 const [prompt, setPrompt] = useState("hello llamapalooza");
10 const [code, setCode] = useState("");
20 >(null);
21
22 async function handleSubmit(e: React.FormEvent) {
23 e.preventDefault();
24 setLoading(true);
123}
124
125function client() {
126 createRoot(document.getElementById("root")!).render(<App />);
127}
131}
132
133function extractCodeFromFence(text: string): string {
134 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
135 return htmlMatch ? htmlMatch[1].trim() : text;
136}
137
138export default async function server(req: Request): Promise<Response> {
139 if (req.method === "POST") {
140 const client = new Cerebras();

southcloudmain.tsx2 matches

@temptemp•Updated 7 months ago
6const dataChart: { variable: string; value: number }[][] = [];
7
8function getValueOf(text: string): number {
9 const pattern = new RegExp(`,${text}=0x([a-zA-Z0-9]+)`, "g");
10 const match = pattern.exec(str);
34 }
35};
36export function base(p) {
37 let key = "";
38 let encryptedText = p;

retiredRedMarlinmain.tsx2 matches

@temptemp•Updated 7 months ago
1import { base } from "https://esm.town/v/tempguy/southcloud";
2
3async function fetchStreamLink() {
4 try {
5 const headers = {
48}
49
50// Call the function
51fetchStreamLink();

basemain.tsx2 matches

@temptemp•Updated 7 months ago
6const dataChart: { variable: string; value: number }[][] = [];
7
8function getValueOf(text: string): number {
9 const pattern = new RegExp(`,${text}=0x([a-zA-Z0-9]+)`, "g");
10 const match = pattern.exec(str);
34 }
35};
36export function base(p) {
37 let key = "";
38 let encryptedText = p;

ViewCountermain.tsx1 match

@youhavetrouble•Updated 7 months ago
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3
4export default async function(req: Request): Promise<Response> {
5 if (req.method !== "GET") {
6 return new Response("Method not allowed", {
tuna

tuna9 file matches

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