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=1108&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 18081 results for "function"(1602ms)

GitHubSync

GitHubSynccommit-files2 matches

@jxnblk•Updated 2 months ago
18
19/**
20 * General use function to commit files to GitHub
21 */
22export async function commitFiles({
23 token,
24 owner,
GitHubSync

GitHubSyncsign-webhook1 match

@jxnblk•Updated 2 months ago
1/**
2 * Use this function along with your valtown webhook secret to create
3 * the x-val-signature header when posting to the /export webhook
4 */

codemirrorTsdemo2 matches

@maxm•Updated 2 months ago
2import { renderToString } from "npm:react-dom/server";
3import { importMap } from "./importMap";
4export default async function(req: Request): Promise<Response> {
5 const u = new URL(req.url);
6
33let hasAnError: string = 10;
34
35function increment(num: number) {
36 return num + 1;
37}

allTheFrontendBackendPatternshttp1 match

@maxm•Updated 2 months ago
2import { renderToString } from "npm:react-dom/server";
3let counter = 0;
4export default async function(req: Request): Promise<Response> {
5 return new Response(
6 renderToString(

charmainesStatusstatus3 matches

@charmaine•Updated 2 months ago
6import { SparklineSVG } from "./sparklineSVG";
7
8function StatusRow({ rows }) {
9 return (
10 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",

allTheFrontendBackendPatternshttp3 matches

@maxm•Updated 2 months ago
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function Counter() {
6 const [count, setCount] = useState(4);
7
15}
16
17function client() {
18 createRoot(document.getElementById("root")).render(<Counter />);
19}
23}
24
25export default function server(request: Request): Response {
26 return new Response(
27 `

charmainesStatusnotify1 match

@charmaine•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}

allTheFrontendBackendPatternsfrontend.ts1 match

@maxm•Updated 2 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [count, setCount] = useState(4);
7 return (

charmainesStatussparklineSVG1 match

@charmaine•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;

charmainesStatusmonitor1 match

@charmaine•Updated 2 months ago
7);
8
9export async function uptimeCheck(url: string) {
10 let reason: string, status: number, end: number;
11 let ok = true;

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
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",