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/$%7BsvgDataUrl%7D?q=function&page=50&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 31502 results for "function"(5325ms)

Glancer_TeststartSession.ts3 matches

@charmaine•Updated 3 days ago
1export async function startSession() {
2 GLANCE.Cobrowse.Visitor.startSession("GLANCE_KEYTYPE_RANDOM");
3}
4// If you forget to add functions called by events
5// to the global scope (e.g., `onclick="startSession();"`),
6// then those functions won't be in the global scope,
7// and the onclick will fail with Uncaught ReferenceError.
8window.startSession = startSession;

Glancer_TestsetPageID.ts1 match

@charmaine•Updated 3 days ago
6});
7
8export async function setPageID(data: any) {
9 try {
10 const page = await notion.pages.update({

Glancer_TestsetPageIcon.ts1 match

@charmaine•Updated 3 days ago
6});
7
8export async function setPageIcon(id: string, iconURL: string) {
9 try {
10 const page = await notion.pages.update({

Glancer_TestsetDemoURL.ts1 match

@charmaine•Updated 3 days ago
6});
7
8export async function setDemoURL(id: string, url: string) {
9 try {
10 const page = await notion.pages.update({

Glancer_TestsetCobrowse.ts1 match

@charmaine•Updated 3 days ago
6});
7
8export async function setCobrowse(id: string, cobrowse: boolean) {
9 try {
10 const page = await notion.pages.update({

Glancer_TestsetAction.ts1 match

@charmaine•Updated 3 days ago
6});
7
8export async function setAction(data: any) {
9 try {
10 const page = await notion.pages.create({

Glancer_TestrecordClick.ts1 match

@charmaine•Updated 3 days ago
1export async function recordClick(action: string) {
2 // Create data to store
3 const clickData = {

Glancer_TestREADME.md6 matches

@charmaine•Updated 3 days ago
86```typescript
87// Client-side event recording
88window.recordClick = function (action) {
89 fetch(`/api/setAction`, {
90 method: "POST",
116│ └── index.tsx # Frontend JavaScript entry point
117└── shared/ # Utilities used by both frontend and backend
118 └── utils/ # Shared helper functions
119```
120
129### Shared (`/shared`)
130
131Contains utilities and functions that work in both browser and server environments, ensuring code reusability across the application.
132
133## Framework and Technology Stack
189### Shared Utilities (`/shared`)
190
191Contains helper functions that work in both frontend and backend environments:
192
193```typescript
220
221```typescript
222export default async function (interval: Interval) {
223 const pages = await notion.databases.query({
224 database_id: Deno.env.get("GLANCE_DEMOS_DB_ID"),
280| Aspect | Controller | Utility |
281| ------------ | --------------------------------------------- | ------------------------------------------------- |
282| Purpose | Orchestrates business logic and workflows | Provides small, stateless helper functions |
283| Scope | High-level, involves services or side effects | Low-level, narrow focus (string, date operations) |
284| State | Works with application or user-specific data | Stateless - input in, output out |

Glancer_TestREADME.md1 match

@charmaine•Updated 3 days ago
6| Aspect | **Controller** | **Util** |
7| ----------------- | --------------------------------------------------- | --------------------------------------------------- |
8| **Purpose** | Orchestrates business logic and workflows | Provides small, stateless helper functions |
9| **Scope** | High-level, often involves services or side effects | Low-level, narrow in focus (e.g., string, date ops) |
10| **State** | Works with application or user-specific data | Stateless – input in, output out |

Glancer_TestREADME.md4 matches

@charmaine•Updated 3 days ago
7### Task endpoints use /controllers to get and save data
8
9In order to keep the API easy to look and work with, the routes in /tasks handle routing but do not get data from or save data to Notion. The functions that connect to Notion live in the /controllers directory, and are _called_ from the endpoints in /tasks.
10
11### Naming convention for routes and controllers
25 Note that the export in the controller follows the same convention; it's also called `setDemoURL`.
26
271. Once the controller is imported, pass data to the exported function so that it can do its thing:
28
29 ```
31 ```
32
33 Note the function call is the exported function in the import object at the top of the route; i.e., `{ setDemoURL }`. The `setDemoURL.ts` controller exports it like this:
34
35 ```
36 // /controllers/setDemoURL.ts
37 export async function setDemoURL(data: any) {
38 try {
39 ...
tuna

tuna9 file matches

@jxnblk•Updated 2 weeks 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.