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=802&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 12287 results for "function"(632ms)

ultimateGraySailfishmain.tsx3 matches

@Htkhan5•Updated 2 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [query, setQuery] = useState('');
7 const [aiSummary, setAiSummary] = useState('');
473}
474
475function client() {
476 const style = document.createElement('style');
477 style.textContent = `
506if (typeof document !== "undefined") { client(); }
507
508export default async function server(request: Request): Promise<Response> {
509 if (request.method === 'POST') {
510 const { OpenAI } = await import("https://esm.town/v/std/openai");

statusmonitor1 match

@brie•Updated 2 months ago
7);
8
9export async function uptimeCheck(url: string, attempt = 1) {
10 let reason: string = "";
11 let status: number | null = null;

statusstatus3 matches

@brie•Updated 2 months ago
9const thisURL = parseProject(import.meta.url).links.self.project;
10
11function StatusRow({ rows }) {
12 return (
13 <div className="w-full flex flex-col space-y-2">
31}
32
33function StatusSection({ url, rows }) {
34 const sectionRows = rows.filter(row => row[0] === url);
35 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
49}
50
51export default async function(req: Request): Promise<Response> {
52 const { rows } = await sqlite.execute(
53 "select url, ok, duration, timestamp, title from uptime order by timestamp desc limit 200",

statussparklineSVG1 match

@brie•Updated 2 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2export function SparklineSVG({ strokeWidth = 2, data = [], fill = "none", stroke = "black" }) {
3 const padding = 2;
4 const xMargin = 25;

statusnotify1 match

@brie•Updated 2 months ago
4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}

valentinemain.tsx3 matches

@rittideat•Updated 2 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `

valentinemain.tsx3 matches

@user172k•Updated 2 months ago
11 "C,mon, you know you like me ;)",
12
13function App() {
14 const [noClicks, setNoClicks] = useState(0);
15 const [isValentine, setIsValentine] = useState(false);
96}
97
98function client() {
99 createRoot(document.getElementById("root")).render(<App />);
100}
101if (typeof document !== "undefined") { client(); }
102
103export default async function server(request: Request): Promise<Response> {
104 return new Response(
105 `

LateValentineGiftmain.tsx3 matches

@Inverius•Updated 2 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
99}
100
101function client() {
102 createRoot(document.getElementById("root")).render(<App />);
103}
104if (typeof document !== "undefined") { client(); }
105
106export default async function server(request: Request): Promise<Response> {
107 return new Response(
108 `

uptimeCheckmain.tsx1 match

@stevekrouse•Updated 2 months ago
2
3const MAX_TRIES = 3;
4export async function uptimeCheck(url: string, attempt = 1) {
5 let ok = true;
6 try {

uptimeCheckmain.tsx1 match

@stevekrouse•Updated 2 months ago
2
3const MAX_TRIES = 3;
4export async function uptimeCheck(url: string, attempt = 1) {
5 let ok = true;
6 try {

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town