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=16&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 30462 results for "function"(2824ms)

web_duvEzKTNhvmain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

test-apns-voip-notimain.tsx6 matches

@rafaelortizzableh•Updated 1 day ago
1import * as jose from "https://deno.land/x/jose@v4.14.4/index.ts";
2
3// --- Main function to send a VoIP push directly to APNs ---
4export default async function sendDirectVoipPush(req: Request): Promise<Response> {
5 // Get the target device's VoIP token from the request URL.
6 // Example: ?token=DEVICE_VOIP_TOKEN_HERE
85}
86
87// --- Helper function to create the JWT ---
88async function createJwt(keyId: string, teamId: string, p8key: string): Promise<string> {
89 const privateKey = await jose.importPKCS8(p8key, "ES256");
90 return await new jose.SignJWT({})
96}
97
98// --- Helper function to load and validate credentials ---
99function getAppleCredentials() {
100 const p8key = Deno.env.get("APPLE_P8_KEY");
101 const keyId = Deno.env.get("APPLE_KEY_ID");
1import * as jose from "https://deno.land/x/jose@v4.14.4/index.ts";
2
3// --- Main function to send a VoIP push directly to APNs ---
4export default async function sendDirectVoipPush(req: Request): Promise<Response> {
5 // Get the target device's VoIP token from the request URL.
6 // Example: ?token=DEVICE_VOIP_TOKEN_HERE
80}
81
82// --- Helper function to create the JWT ---
83async function createJwt(keyId: string, teamId: string, p8key: string): Promise<string> {
84 const privateKey = await jose.importPKCS8(p8key, "ES256");
85 return await new jose.SignJWT({})
91}
92
93// --- Helper function to load and validate credentials ---
94function getAppleCredentials() {
95 const p8key = Deno.env.get("APPLE_P8_KEY");
96 const keyId = Deno.env.get("APPLE_KEY_ID");

web_wEyhtOXb5jmain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

web_XhAr70WlfYmain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

web_veDL8achh8main.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

web_eEimFIGrWJmain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }

chatExampleApp.tsx3 matches

@laurynas•Updated 1 day ago
5import { useMessages } from "../lib/queries.ts";
6
7export function App(
8 { initialMessages = [], thisProjectURL }: { initialMessages?: Message[]; thisProjectURL?: string },
9) {
75}
76
77function MessageList({ messages }: { messages: Message[] }) {
78 const displayedMessages = messages.slice(0, MESSAGE_LIMIT);
79 return (
84}
85
86function MessageItem({ message }: { message: Message }) {
87 const isUser = message.role === 'user';
88 const formattedDate = message.createdAt

chatExamplerouter.tsx1 match

@laurynas•Updated 1 day ago
60
61// Export the RouterProvider component with QueryClient
62export function RouterApp() {
63 return (
64 <QueryClientProvider client={queryClient}>

web_iFSIroaOdKmain.tsx1 match

@dhvanil•Updated 1 day ago
1
2export default async function(req) {
3 return new Response(`undefined`, {
4 headers: { 'Content-Type': 'text/html' }
tuna

tuna9 file matches

@jxnblk•Updated 1 week 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.