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/$1?q=function&page=28&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 28936 results for "function"(1897ms)

CineVideoGallery.tsx1 match

@eddie_walk•Updated 1 day ago
9}
10
11export default function VideoGallery({ videos, onVideoSelect, isLoading = false }: VideoGalleryProps) {
12 if (isLoading) {
13 return (

CineContact.tsx1 match

@eddie_walk•Updated 1 day ago
3import type { ContactForm } from "../../shared/types.ts";
4
5export default function Contact() {
6 const [contactForm, setContactForm] = useState<ContactForm>({
7 name: '',

CineGetInvolved.tsx1 match

@eddie_walk•Updated 1 day ago
3import type { ClubInterestForm } from "../../shared/types.ts";
4
5export default function GetInvolved() {
6 const [activeForm, setActiveForm] = useState<'club' | 'volunteer' | 'donate' | 'partner'>('club');
7 const [clubForm, setClubForm] = useState<ClubInterestForm>({

CineHero.tsx1 match

@eddie_walk•Updated 1 day ago
2import React from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3
4export default function Hero() {
5 return (
6 <div className="relative min-h-screen flex items-center justify-center overflow-hidden">

untitled-2487main.tsx1 match

@BOTBUNESS•Updated 1 day ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

tidbytmain.tsx1 match

@Curt•Updated 1 day ago
10 });
11
12export default async function server(request: Request): Promise<Response> {
13 // Allow all CORS
14 if (request.method === "OPTIONS") {

OpenTelemetryCollectortransformExport.ts10 matches

@synth•Updated 1 day ago
24 * By convention, we only use string and number values. Complex values are serialized.
25 */
26export async function transformExport(
27 tracesData: IExportTraceServiceRequest,
28): Promise<Array<OtelSpan>> {
107 | Record<string, AttributeValuePrimitive>;
108
109async function mapAttributeValue(value: IAnyValue): Promise<AttributeValue> {
110 if (!value) {
111 return null;
137}
138
139async function mapAttributes(
140 attributes: IKeyValue[],
141): Promise<Record<string, AttributeValue>> {
158}
159
160async function mapEvent(event: IEvent) {
161 return {
162 name: event.name,
166}
167
168async function mapLink(link: ILink) {
169 return {
170 trace_id: stringOrUintToString(link.traceId),
175}
176
177function stringOrUintToString(id: string | Uint8Array) {
178 return id instanceof Uint8Array
179 ? Buffer.from(id).toString("hex")
181}
182
183function mapStatus(status: IStatus) {
184 return {
185 code: status.code,
188}
189
190function statusCodeToString(statusCode: EStatusCode) {
191 switch (statusCode) {
192 case 0:
201}
202
203// Function to convert ESpanKind to SpanKind
204function convertToSpanKind(spanKind: ESpanKind): string {
205 switch (spanKind) {
206 case 1:

OpenTelemetryCollectorqueries.ts1 match

@synth•Updated 1 day ago
8 * @TODO - Need to implement `end_time` column for this query to work
9 */
10export function findTraces(db: DBType) {
11 const REFERENCE QUERY = `
12SELECT trace_id, MAX(end_time) as end_time

OpenTelemetryCollectoropenapi.ts1 match

@synth•Updated 1 day ago
3 * with a better experience
4 */
5export function getOpenAPISpec() {
6 return {
7 openapi: "3.0.0",

OpenTelemetryCollectorindex.ts2 matches

@synth•Updated 1 day ago
47
48/**
49 * Export a function that wraps the incoming request,
50 * then injects the Deno env vars into the Hono app befoe
51 * executing the api entrypoint (`app.fetch`)
52 */
53export default async function(req: Request): Promise<Response> {
54 const env = Deno.env.toObject();
55 // NOTE - Adding the entire env object will also expose the following values to your api handlers:
tuna

tuna9 file matches

@jxnblk•Updated 16 hours ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.