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%22Image%20title%22?q=function&page=2786&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 34509 results for "function"(8504ms)

imagetopdfmain.tsx3 matches

@shubham02•Updated 5 months ago
4import { jsPDF } from "https://esm.sh/jspdf@2.5.1";
5
6function ImageToPDFConverter() {
7 const [size, setSize] = useState('A4');
8 const [customWidth, setCustomWidth] = useState('');
115}
116
117export default function handler(req: Request) {
118 const html = renderToString(
119 <html lang="en">
148}
149
150function client() {
151 const root = document.getElementById('root');
152 if (root) {

weatherBasedActivityAlertingmain.tsx6 matches

@mattwd7•Updated 5 months ago
25///////////////////////
26
27// Helper function to get day of week
28function getDayOfWeek(dateString: string): string {
29 const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
30 return days[new Date(dateString).getDay()];
31}
32
33// Helper function to format date as MM/DD
34function formatDate(dateString: string): string {
35 const date = new Date(dateString);
36 return `${date.getMonth() + 1}/${date.getDate()}`;
38
39// Dynamically extract unique metrics from activities
40function extractUniqueMetrics(activityDefinitions: typeof activities): string[] {
41 const metricsSet = new Set<string>();
42 Object.values(activityDefinitions).forEach(activity => {
46}
47
48export default async function() {
49 try {
50 // Dynamically generate metrics list

blob_adminmain.tsx8 matches

@yeiko•Updated 5 months ago
13}
14
15function Tooltip({ children, content }: TooltipProps) {
16 const [isVisible, setIsVisible] = useState(false);
17 const tooltipRef = useRef<HTMLDivElement>(null);
52}
53
54function formatBytes(bytes: number, decimals = 2) {
55 if (bytes === 0) return "0 Bytes";
56 const k = 1024;
61}
62
63function copyToClipboard(text: string) {
64 navigator.clipboard.writeText(text).then(() => {
65 console.log("Text copied to clipboard");
69}
70
71function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
72 const [isOpen, setIsOpen] = useState(false);
73 const menuRef = useRef(null);
76
77 useEffect(() => {
78 function handleClickOutside(event) {
79 if (menuRef.current && !menuRef.current.contains(event.target)) {
80 event.stopPropagation();
158}
159
160function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
161 const [isLoading, setIsLoading] = useState(false);
162 const decodedKey = decodeURIComponent(blob.key);
219}
220
221function App({ initialEmail, initialProfile }) {
222 const encodeKey = (key: string) => encodeURIComponent(key);
223 const decodeKey = (key: string) => decodeURIComponent(key);
645}
646
647function client() {
648 const initialEmail = document.getElementById("root").getAttribute("data-email");
649 const initialProfile = JSON.parse(document.getElementById("root").getAttribute("data-profile"));

valTownInspoListmain.tsx1 match

@rodrigotello•Updated 5 months ago
119}, {
120 "title": "Generate PDFs",
121 "description": "Generate PDFs using val functions by using an external library like jsPDF",
122 "val": "@vtdocs.examplePDF",
123 image:

reMarkableXNYTCrosswordmain.tsx2 matches

@rensaketh•Updated 5 months ago
3import request from "npm:request";
4
5export default async function(interval: Interval) {
6 // Cookies and Tokens -> use `mitmweb` to navigate to NYTimes.com to grab cookie. Repeat for my.remarkable.com
7
63 },
64 })
65 .then(function(response) {
66 var rmMetadata = { "parent": rmFolderGuid, "file_name": puzzleFriendlyName };
67

randomVideoChatAppmain.tsx4 matches

@ghouri•Updated 5 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function RandomVideoChat() {
6 const [connectionStatus, setConnectionStatus] = useState("Disconnected");
7 const [isSearching, setIsSearching] = useState(false);
167}
168
169function App() {
170 return <RandomVideoChat />;
171}
172
173function client() {
174 createRoot(document.getElementById("root")).render(<App />);
175}
176if (typeof document !== "undefined") { client(); }
177
178export default async function server(request: Request): Promise<Response> {
179 return new Response(`
180 <html>

valTownInspoListmain.tsx1 match

@charmaine•Updated 5 months ago
119}, {
120 "title": "Generate PDFs",
121 "description": "Generate PDFs using val functions by using an external library like jsPDF",
122 "val": "@vtdocs.examplePDF",
123 image:

woffToTtfConvertermain.tsx4 matches

@g•Updated 5 months ago
7import { Hono } from 'npm:hono';
8
9function html() {
10 /*
11<!DOCTYPE html>
37}
38
39function css() {
40 /*
41:root {
143}
144
145function js() {
146 /*
147import { convert } from 'https://esm.sh/fontverter';
151const statusEl = document.getElementById('status');
152
153function handleFiles(files) {
154 if (files.length === 0) return;
155 const file = files[0];

constantGrayRavenmain.tsx10 matches

@RareVibesAiDad•Updated 5 months ago
6
7// Operational Data Science Tool Report Generator
8async function generateDataScienceToolReport() {
9 const openai = new OpenAI();
10
48
49 // Advanced Operational Analysis
50 async function generateOperationalInsights(category: string) {
51 const operationalCompletion = await openai.chat.completions.create({
52 model: "gpt-4o-mini",
95 "Phased technology adoption",
96 "Continuous skill development",
97 "Cross-functional team alignment",
98 "Agile technology integration",
99 ],
101
102 // Advanced Export and Analysis Methods
103 async function exportOperationalReportToJSON() {
104 const reportKey = `operational_report_${Date.now()}`;
105 await blob.setJSON(reportKey, fullOperationalReport);
107 }
108
109 async function generateComprehensiveOperationalAnalysis() {
110 const analysis = {
111 totalToolsCovered: dataScienceToolCategories.reduce((total, category) => total + category.tools.length, 0),
122 }
123
124 function calculateOperationalReadinessScore(tool) {
125 const scoreMap = {
126 learningCurve: {
158
159// React-based Operational Dashboard
160function OperationalToolDashboard() {
161 const [report, setReport] = useState(null);
162 const [analysis, setAnalysis] = useState(null);
164
165 useEffect(() => {
166 async function fetchOperationalReport() {
167 try {
168 const reportGenerator = await generateDataScienceToolReport();
229
230// Server-side Handler
231export default async function server(request: Request) {
232 return new Response(
233 `
251
252// Client-side Rendering
253function client() {
254 createRoot(document.getElementById("root")).render(<OperationalToolDashboard />);
255}

RareVibesBoostmain.tsx10 matches

@RareVibesAiDad•Updated 5 months ago
6
7// Operational Data Science Tool Report Generator
8async function generateDataScienceToolReport() {
9 const openai = new OpenAI();
10
48
49 // Advanced Operational Analysis
50 async function generateOperationalInsights(category: string) {
51 const operationalCompletion = await openai.chat.completions.create({
52 model: "gpt-4o-mini",
95 "Phased technology adoption",
96 "Continuous skill development",
97 "Cross-functional team alignment",
98 "Agile technology integration",
99 ],
101
102 // Advanced Export and Analysis Methods
103 async function exportOperationalReportToJSON() {
104 const reportKey = `operational_report_${Date.now()}`;
105 await blob.setJSON(reportKey, fullOperationalReport);
107 }
108
109 async function generateComprehensiveOperationalAnalysis() {
110 const analysis = {
111 totalToolsCovered: dataScienceToolCategories.reduce((total, category) => total + category.tools.length, 0),
122 }
123
124 function calculateOperationalReadinessScore(tool) {
125 const scoreMap = {
126 learningCurve: {
158
159// React-based Operational Dashboard
160function OperationalToolDashboard() {
161 const [report, setReport] = useState(null);
162 const [analysis, setAnalysis] = useState(null);
164
165 useEffect(() => {
166 async function fetchOperationalReport() {
167 try {
168 const reportGenerator = await generateDataScienceToolReport();
229
230// Server-side Handler
231export default async function server(request: Request) {
232 return new Response(
233 `
251
252// Client-side Rendering
253function client() {
254 createRoot(document.getElementById("root")).render(<OperationalToolDashboard />);
255}

discordWebhook2 file matches

@stevekrouse•Updated 1 week ago
Helper function to send Discord messages
tuna

tuna9 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.