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/$%7Bsuccess?q=function&page=61&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 19769 results for "function"(1676ms)

Townie-02Home.tsx1 match

@jxnblk•Updated 2 days ago
4import { EyeIcon, FileCode2Icon, SparklesIcon, SquarePenIcon } from "./icons.tsx";
5
6export function Home() {
7 return (
8 <div className="container">

Townie-02formatters.ts1 match

@jxnblk•Updated 2 days ago
1// Utility functions for formatting data in the dashboard
2
3/**

Townie-02fileWithLinesNumbers.ts1 match

@jxnblk•Updated 2 days ago
1export default function fileWithLineNumbers(text: string, view_range = []) {
2 return [
3 undefined, // Line numbers are 1-indexed

Townie-02favicon.http.tsx1 match

@jxnblk•Updated 2 days ago
3import { TownieIcon } from "./components/icons.tsx";
4
5export default async function (loading: boolean) {
6 const svg = renderToString(
7 <TownieIcon

Townie-02DebugStyles.tsx1 match

@jxnblk•Updated 2 days ago
4import { Messages } from "./Messages.tsx";
5
6export function DebugStyles () {
7 const [ pathname, setPathname ] = useState("");
8 return (

Townie-02dashboard.ts1 match

@jxnblk•Updated 2 days ago
15}
16
17export function renderDashboard(data: UserSummaryRow[]): string {
18 // Calculate totals
19 const totalUsers = data.length;

Townie-02ChatRoute.tsx3 matches

@jxnblk•Updated 2 days ago
14import { Loading } from "./Loading.tsx";
15
16export function ChatRoute () {
17 const { projectId, branchId } = useParams() as {
18 projectId: string;
51}
52
53function Conversation ({
54 project,
55 files,
173}
174
175function shouldRefetch (message) {
176 for (let i = 0; i < message?.parts?.length; i++) {
177 let part = message.parts[i];

Townie-02calculateCost.tsx1 match

@jxnblk•Updated 2 days ago
5const CACHE_WRITE_RATE = 3.75; // $3.75 per M cache-write tokens
6
7export function calculateCost({
8 input_tokens,
9 output_tokens,

Townie-02auth.ts1 match

@jxnblk•Updated 2 days ago
5 * Returns null if authentication is successful, or a Response if it fails
6 */
7export async function basicAuthMiddleware(req: Request): Promise<Response | null> {
8 const realm = "Usage Dashboard";
9 const unauthorizedResponse = new Response("Unauthorized", {

town-hallSpeakerForm.tsx1 match

@stevekrouse•Updated 2 days ago
16}
17
18export function SpeakerForm({ onSubmitSuccess, onSubmitError }: SpeakerFormProps) {
19 const [formData, setFormData] = useState<FormData>({
20 name: "",

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.