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/$%7Bart_info.art.src%7D?q=function&page=1535&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 20531 results for "function"(2896ms)

cerebras_codermain.tsx5 matches

@kxxoling•Updated 6 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("");
18 >(null);
19
20 async function handleSubmit(e: React.FormEvent) {
21 e.preventDefault();
22 setLoading(true);
97}
98
99function client() {
100 createRoot(document.getElementById("root")!).render(<App />);
101}
105}
106
107function extractCodeFromFence(text: string): string {
108 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
109 return htmlMatch ? htmlMatch[1].trim() : text;
110}
111
112export default async function server(req: Request): Promise<Response> {
113 if (req.method === "POST") {
114 const client = new Cerebras();

gregariousIvoryOstrichmain.tsx8 matches

@danieladmsf•Updated 6 months ago
7const formatCurrency = (amount) => `R$ ${amount.toFixed(2)}`;
8
9function WhatsAppCell({ number }) {
10 return (
11 <a href={`https://wa.me/${number}`} target="_blank" rel="noopener noreferrer" className="whatsapp-link">
15}
16
17function DeliveryCalendar({ days }) {
18 return <span className="delivery-info">{days} dias</span>;
19}
20
21function ActionButton({ icon, onClick, type, tooltip }) {
22 const IconComponent = type === 'edit' ? FaEdit : FaTrash;
23 return (
32}
33
34function StatCard({ title, value, type }) {
35 return (
36 <div className="stat-card">
41}
42
43function Dashboard() {
44 const [data, setData] = useState({
45 lastQuote: new Date(),
216}
217
218function App() {
219 return <Dashboard />;
220}
221
222function client() {
223 createRoot(document.getElementById("root")).render(<App />);
224}
225if (typeof document !== "undefined") { client(); }
226
227export default async function server(request: Request): Promise<Response> {
228 return new Response(`
229 <html>

webpage_summarizermain.tsx3 matches

@ubixsnow•Updated 6 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [url, setUrl] = useState("");
7 const [summary, setSummary] = useState("");
90}
91
92function client() {
93 createRoot(document.getElementById("root")).render(<App />);
94}
95if (typeof document !== "undefined") { client(); }
96
97export default async function server(request: Request): Promise<Response> {
98 if (request.method === "POST" && new URL(request.url).pathname === "/summarize") {
99 try {

renderResumemain.tsx5 matches

@art3miz18•Updated 6 months ago
2import { Document, Page, pdf } from "https://esm.sh/@react-pdf/renderer";
3
4export function renderResume({
5 resumeDetails,
6 theme,
38 };
39
40 // Generate HTML for web view with PDF download functionality
41 const name = resumeDetails?.basics?.name || 'Resume';
42 const title = customTitle || `${name}'s Resume`;
71 const resumeDetails = ${JSON.stringify(resumeDetails)};
72
73 // PDF Download Function
74 async function downloadPDF() {
75 const { ResumeDocument } = await import(import.meta.url);
76 const blob = await pdf(<ResumeDocument resumeDetails={resumeDetails} />).toBlob();
97}
98
99export function ResumeDocument({ resumeDetails }) {
100 const allSections = ['header', 'summary', 'education', 'work', 'projects', 'volunteer', 'awards', 'certificates', 'publications', 'skills', 'languages', 'interests', 'references'];
101

magnificentJadeDonkeymain.tsx8 matches

@daniel1987600•Updated 6 months ago
43};
44
45function StatCard({ title, value, type }) {
46 return (
47 <div className="stat-card">
52}
53
54function DeliveryCalendar({ days }) {
55 const getCurrentWeekDays = () => {
56 const today = new Date();
89}
90
91function ActionButton({ icon, onClick, type, tooltip }) {
92 if (!ActionIcons[type]) {
93 console.error(`Icon type "${type}" not found`);
102}
103
104function WhatsAppCell({ number }) {
105 const linkNumber = number.replace(/\D/g, '');
106
129];
130
131function Dashboard() {
132 const [data, setData] = useState(mockData);
133 const [loading, setLoading] = useState(true);
267}
268
269function App() {
270 return <Dashboard />;
271}
272
273function client() {
274 if (typeof document !== "undefined") {
275 try {
283client();
284
285export default async function server(request: Request): Promise<Response> {
286 const css = `
287 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

mightyAmberAlbatrossmain.tsx1 match

@anniewong25•Updated 6 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

dailyDadJokemain.tsx1 match

@theswiftcoder•Updated 6 months ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({

travelSurveyAppmain.tsx6 matches

@ntontischris•Updated 6 months ago
40];
41
42function AIRecommendationModal({ preferences, onClose }) {
43 const [recommendation, setRecommendation] = useState(null);
44 const [loading, setLoading] = useState(true);
45
46 useEffect(() => {
47 async function generateRecommendation() {
48 try {
49 const { OpenAI } = await import("https://esm.town/v/std/openai");
96}
97
98function UltraEngagedSurvey({ onComplete }) {
99 const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0);
100 const [answers, setAnswers] = useState([]);
209}
210
211function TravelPersonalityTest() {
212 const [engagementLevel, setEngagementLevel] = useState(null);
213 const [showUltraSurvey, setShowUltraSurvey] = useState(false);
250}
251
252function client() {
253 createRoot(document.getElementById("root")).render(<TravelPersonalityTest />);
254}
256if (typeof document !== "undefined") { client(); }
257
258export default async function server(request: Request): Promise<Response> {
259 return new Response(`
260 <html>

cerebras_codermain.tsx5 matches

@chabhishek420•Updated 6 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("");
18 >(null);
19
20 async function handleSubmit(e: React.FormEvent) {
21 e.preventDefault();
22 setLoading(true);
97}
98
99function client() {
100 createRoot(document.getElementById("root")!).render(<App />);
101}
105}
106
107function extractCodeFromFence(text: string): string {
108 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
109 return htmlMatch ? htmlMatch[1].trim() : text;
110}
111
112export default async function server(req: Request): Promise<Response> {
113 if (req.method === "POST") {
114 const client = new Cerebras();

Attendencemain.tsx3 matches

@nirwan•Updated 6 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function AttendanceApp() {
6 const [company, setCompany] = useState('');
7 const [amtType, setAmtType] = useState('');
306}
307
308function client() {
309 createRoot(document.getElementById("root")).render(<AttendanceApp />);
310}
312if (typeof document !== "undefined") { client(); }
313
314export default async function server(request: Request): Promise<Response> {
315 // Import SQLite dynamically
316 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

getFileEmail4 file matches

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

tuna8 file matches

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