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/$2?q=function&page=2359&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 27790 results for "function"(8378ms)

Whatsapp_Sendmain.tsx3 matches

@muhammad_owais_warsi•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [title, setTitle] = useState("");
7 const [embedCode, setEmbedCode] = useState("");
60}
61
62function client() {
63 createRoot(document.getElementById("root")).render(<App />);
64}
68}
69
70export default async function server(request: Request): Promise<Response> {
71 return new Response(
72 `

freesoundSearchmain.tsx2 matches

@sedson•Updated 8 months ago
25 * Get the nth sound for a search string.
26 */
27async function search(query: string, nth: number = 0): Promise<Sound> {
28 const queryString = qs.stringify({
29 query: query,
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { pathname, searchParams } = new URL(req.url);
48 let index = parseInt(searchParams.get("i"));

aqimain.tsx1 match

@phyllislim•Updated 8 months ago
7const cacheKey = location => "easyAQI_locationID_cache_" + encodeURIComponent(location);
8
9export async function easyAQI({ location }: {
10 location: string;
11}) {

iframeGridInfinitemain.tsx7 matches

@maxm•Updated 8 months ago
8import { createRoot } from "https://esm.sh/react-dom/client";
9
10function Modal({ onClose }) {
11 return (
12 <div style={{
28}
29
30function IframeCell({ cellKey, url, onUrlSubmit, isLoading }) {
31 const [inputUrl, setInputUrl] = useState(url || '');
32
59}
60
61function App() {
62 const [position, setPosition] = useState({ x: 0, y: 0 });
63 const [isDragging, setIsDragging] = useState(false);
206}
207
208function client() {
209 createRoot(document.getElementById("root")).render(<App />);
210}
212if (typeof document !== "undefined") { client(); }
213
214async function handleSubmitUrl(request: Request): Promise<Response> {
215 const { cellKey, url } = await request.json();
216 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
236}
237
238async function handleLoadUrls(): Promise<Response> {
239 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
240 const KEY = "iframeGridInfinite";
255}
256
257async function server(request: Request): Promise<Response> {
258 if (request.method === 'POST' && new URL(request.url).pathname === '/api/submit-url') {
259 return handleSubmitUrl(request);

drumMachinemain.tsx8 matches

@mo3ly•Updated 8 months ago
9const searchUrl = "https://sedson-freesoundsearch.web.val.run";
10
11function WaveformPreview({ buffer, start, end }) {
12 const canvasRef = useRef(null);
13
56}
57
58function trimAudioBuffer(originalBuffer, maxDurationInSeconds = 1) {
59 const sampleRate = originalBuffer.sampleRate;
60 const numberOfChannels = originalBuffer.numberOfChannels;
78}
79
80function ControlRow({ track, onVolumeChange, onSpeedChange, onStartChange, onEndChange, onSearchChange }) {
81 return (
82 <div className="control-row">
152}
153
154function MelodySequencer({ melodySequence, setMelodySequence, currentStep }) {
155 const noteNames = ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C'];
156
182}
183
184function BeatSequencer({ beatSequence, setBeatSequence, currentStep }) {
185 const patternNames = ['Kick', 'Snare', 'Hi-hat', 'Clap'];
186
212}
213
214function App() {
215 const [sequence, setSequence] = useState(Array(TRACKS).fill().map(() => Array(STEPS).fill(false)));
216 const [melodySequence, setMelodySequence] = useState(Array(STEPS).fill(null));
459}
460
461function client() {
462 createRoot(document.getElementById("root")).render(<App />);
463}
465if (typeof document !== "undefined") { client(); }
466
467async function server(request: Request): Promise<Response> {
468 return new Response(
469 `

saveAsPDFmain.tsx2 matches

@all•Updated 8 months ago
1function applyPDFStyles() {
2 const style = document.createElement("style");
3 style.textContent = `
77}
78
79export function saveAsPDF() {
80 const saveButton = document.getElementById("saveAsPDFButton");
81 if (saveButton) {

RobotBackupCallGraphmain.tsx15 matches

@synapticrobotics•Updated 8 months ago
2import { thisWebURL } from "https://esm.town/v/stevekrouse/thisWebURL?v=2";
3
4export default async function server(req: Request): Promise<Response> {
5 // Handle GET requests
6 if (req.method === "GET") {
288 layout: {
289 name: 'preset',
290 positions: function(node) {
291 return { x: 0, y: 0 }; // Initial positions, will be overwritten
292 }
297 });
298
299 // Custom layout function
300 function customLayout() {
301 const mainGraph = cy.elements().not('#isolated, #isolated > node');
302 const isolatedGraph = cy.getElementById('isolated');
349
350 // Add event listeners for highlighting
351 cy.on('mouseover', 'node', function(e) {
352 const node = e.target;
353 highlightNodeChildrenAndParents(node);
354 });
355
356 cy.on('mouseout', 'node', function(e) {
357 unhighlightAll();
358 });
359
360 cy.on('click', 'node', function(e) {
361 const node = e.target;
362 if (node.hasClass('highlighted') || node.hasClass('parent-highlighted')) {
368 });
369
370 function highlightNodeChildrenAndParents(node) {
371 const children = node.outgoers();
372 const parents = node.incomers();
376 }
377
378 function unhighlightAll() {
379 cy.elements().removeClass('highlighted');
380 cy.elements().removeClass('parent-highlighted');
529 let match;
530 while ((match = callRegex.exec(line)) !== null) {
531 const calledFunction = match[1].toLowerCase();
532 relationships.get(caller).add(calledFunction);
533 allNodes.add(calledFunction);
534 }
535 });
545
546 const edges = [];
547 relationships.forEach((calledFunctions, file) => {
548 calledFunctions.forEach(calledFunction => {
549 edges.push({
550 data: {
551 source: file,
552 target: calledFunction,
553 },
554 });

looseTomatoCougarmain.tsx1 match

@willthereader•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [links, setLinks] = useState([]);
7 const [error, setError] = useState(null);

datetimeFormatterToolmain.tsx3 matches

@maxencelav•Updated 8 months ago
15];
16
17function App() {
18 const [dateTime, setDateTime] = useState("2023-06-15T14:30:00");
19 const [selectedFormat, setSelectedFormat] = useState("MM/dd/yyyy");
92}
93
94function client() {
95 createRoot(document.getElementById("root")).render(<App />);
96}
100}
101
102export default async function server(request: Request): Promise<Response> {
103 return new Response(
104 `

drumMachinemain.tsx6 matches

@sedson•Updated 8 months ago
14const searchUrl = "https://sedson-freesoundsearch.web.val.run";
15
16function WaveformPreview({ buffer, start, end }) {
17 const canvasRef = useRef(null);
18 useEffect(() => {
55}
56
57function trimAudioBuffer(originalBuffer, maxDurationInSeconds = 1) {
58 const sampleRate = originalBuffer.sampleRate;
59 const numberOfChannels = originalBuffer.numberOfChannels;
79}
80
81function ControlRow({ track, onVolumeChange, onSpeedChange, onStartChange, onEndChange, onSearchChange }) {
82 const [searchInput, setSearchInput] = useState(track.search);
83
172}
173
174function App() {
175 const [sequence, setSequence] = useState(Array(TRACKS).fill().map(() => Array(STEPS).fill(false)));
176 const [isPlaying, setIsPlaying] = useState(false);
362}
363
364function client() {
365 createRoot(document.getElementById("root")).render(<App />);
366}
368if (typeof document !== "undefined") { client(); }
369
370async function server(request: Request): Promise<Response> {
371 return new Response(
372 `

getFileEmail4 file matches

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

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