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=1230&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 18323 results for "function"(3455ms)

cerebras_codermain.tsx11 matches

@justin2•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
170 });
171
172 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173 setLoading(true);
174 setTimeout(() => handleSubmit(promptItem.prompt), 0);
175 }
176
177 async function handleSubmit(e: React.FormEvent | string) {
178 if (typeof e !== "string") {
179 e.preventDefault();
226 }
227
228 function handleVersionChange(direction: "back" | "forward") {
229 const { currentVersionIndex, versions } = versionHistory;
230 if (direction === "back" && currentVersionIndex > 0) {
974);
975
976function client() {
977 const path = window.location.pathname;
978 const root = createRoot(document.getElementById("root")!);
1010}
1011
1012function extractCodeFromFence(text: string): string {
1013 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014 return htmlMatch ? htmlMatch[1].trim() : text;
1015}
1016
1017async function generateCode(prompt: string, currentCode: string) {
1018 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019 if (starterPrompt) {
1060}
1061
1062export default async function cerebras_coder(req: Request): Promise<Response> {
1063 // Dynamic import for SQLite to avoid client-side import
1064 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163 <meta property="og:site_name" content="Cerebras Coder">
1164 <meta property="og:url" content="https://cerebrascoder.com"/>
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">

invitingMagentaFlyingfishmain.tsx12 matches

@diegoivo•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
170 });
171
172 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173 setLoading(true);
174 setTimeout(() => handleSubmit(promptItem.prompt), 0);
175 }
176
177 async function handleSubmit(e: React.FormEvent | string) {
178 if (typeof e !== "string") {
179 e.preventDefault();
226 }
227
228 function handleVersionChange(direction: "back" | "forward") {
229 const { currentVersionIndex, versions } = versionHistory;
230 if (direction === "back" && currentVersionIndex > 0) {
879);
880
881function client() {
882 const path = window.location.pathname;
883 const root = createRoot(document.getElementById("root")!);
915}
916
917function extractCodeFromFence(text: string): string {
918 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
919 return htmlMatch ? htmlMatch[1].trim() : text;
920}
921
922async function generateCode(prompt: string, currentCode: string) {
923 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
924 if (starterPrompt) {
965}
966
967export default async function cerebras_coder(req: Request): Promise<Response> {
968 // Dynamic import for SQLite to avoid client-side import
969 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1068 <meta property="og:site_name" content="Tool Builder">
1069 <meta property="og:url" content="https://toolbuilder.com"/>
1070 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1071 <meta property="og:type" content="website">
1072 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1118}
1119
1120The error has been fixed by removing the erroneous text at the end of the file and ensuring all functions and components are properly closed. The code should now parse correctly.

cerebras_codermain.tsx11 matches

@yonirunge•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
170 });
171
172 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173 setLoading(true);
174 setTimeout(() => handleSubmit(promptItem.prompt), 0);
175 }
176
177 async function handleSubmit(e: React.FormEvent | string) {
178 if (typeof e !== "string") {
179 e.preventDefault();
226 }
227
228 function handleVersionChange(direction: "back" | "forward") {
229 const { currentVersionIndex, versions } = versionHistory;
230 if (direction === "back" && currentVersionIndex > 0) {
974);
975
976function client() {
977 const path = window.location.pathname;
978 const root = createRoot(document.getElementById("root")!);
1010}
1011
1012function extractCodeFromFence(text: string): string {
1013 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014 return htmlMatch ? htmlMatch[1].trim() : text;
1015}
1016
1017async function generateCode(prompt: string, currentCode: string) {
1018 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019 if (starterPrompt) {
1060}
1061
1062export default async function cerebras_coder(req: Request): Promise<Response> {
1063 // Dynamic import for SQLite to avoid client-side import
1064 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163 <meta property="og:site_name" content="Cerebras Coder">
1164 <meta property="og:url" content="https://cerebrascoder.com"/>
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">

cerebras_codermain.tsx3 matches

@diegoivo•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 // ... [rest of the existing App component remains unchanged]
120

safeBlushRabbitmain.tsx7 matches

@semisemsem•Updated 4 months ago
25}
26
27function generateNextFifteenDays(): DateInfo[] {
28 const dates: DateInfo[] = [];
29 for (let i = 1; i <= 15; i++) { // Start from 1 to skip today
56};
57
58function CodeNameGrid() {
59 return (
60 <div style={{
94}
95
96function App() {
97 const [nickname, setNickname] = useState('');
98 const [dates] = useState(generateNextFifteenDays());
301}
302
303function ResultsPage() {
304 const [votes, setVotes] = useState<any[]>([]);
305 const [loading, setLoading] = useState(true);
307
308 useEffect(() => {
309 async function fetchVotes() {
310 const response = await fetch('/get-votes');
311 const data = await response.json();
492}
493
494function client() {
495 const root = document.getElementById("root");
496 const path = window.location.pathname;
505if (typeof document !== "undefined") { client(); }
506
507export default async function server(request: Request): Promise<Response> {
508 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
509 const KEY = "safeBlushRabbit";

reasoninghelpermain.tsx3 matches

@prashamtrivedi•Updated 4 months ago
25];
26
27function App() {
28 const [topic, setTopic] = useState("");
29 const [mode, setMode] = useState("regular");
443}
444
445function client() {
446 createRoot(document.getElementById("root")).render(<App />);
447}
451}
452
453export default async function server(request: Request): Promise<Response> {
454 const { OpenAI } = await import("npm:openai");
455 const { zodResponseFormat } = await import("npm:openai/helpers/zod");

educatedMaroonChinchillamain.tsx5 matches

@amvicioushecs•Updated 4 months ago
30];
31
32function Carousel() {
33 return (
34 <section className="hero">
80}
81
82function CardSection() {
83 const [activeModal, setActiveModal] = useState(null);
84
147}
148
149function App() {
150 return (
151 <div>
196}
197
198function client() {
199 createRoot(document.getElementById("root")).render(<App />);
200}
202if (typeof document !== "undefined") { client(); }
203
204export default async function server(request: Request): Promise<Response> {
205 return new Response(`
206 <!DOCTYPE html>

cerebras_codermain.tsx11 matches

@larryyangsen•Updated 4 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
170 });
171
172 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173 setLoading(true);
174 setTimeout(() => handleSubmit(promptItem.prompt), 0);
175 }
176
177 async function handleSubmit(e: React.FormEvent | string) {
178 if (typeof e !== "string") {
179 e.preventDefault();
226 }
227
228 function handleVersionChange(direction: "back" | "forward") {
229 const { currentVersionIndex, versions } = versionHistory;
230 if (direction === "back" && currentVersionIndex > 0) {
974);
975
976function client() {
977 const path = window.location.pathname;
978 const root = createRoot(document.getElementById("root")!);
1010}
1011
1012function extractCodeFromFence(text: string): string {
1013 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014 return htmlMatch ? htmlMatch[1].trim() : text;
1015}
1016
1017async function generateCode(prompt: string, currentCode: string) {
1018 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019 if (starterPrompt) {
1060}
1061
1062export default async function cerebras_coder(req: Request): Promise<Response> {
1063 // Dynamic import for SQLite to avoid client-side import
1064 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163 <meta property="og:site_name" content="Cerebras Coder">
1164 <meta property="og:url" content="https://cerebrascoder.com"/>
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">

coffeeBrewAppmain.tsx3 matches

@bennybowden•Updated 4 months ago
154};
155
156function App() {
157 const [selectedMethod, setSelectedMethod] = useState(null);
158
255}
256
257function client() {
258 // Ensure the DOM is fully loaded before rendering
259 if (document.readyState === "loading") {
281}
282
283export default async function server(request: Request): Promise<Response> {
284 return new Response(
285 `

alquranApiProxymain.tsx1 match

@rahil224•Updated 4 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Extract the path after the first segment
3 const url = new URL(request.url);

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.