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=51&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 19491 results for "function"(1765ms)

a8b48747537_README.md2 matches

@vtTestLocal•Updated 2 days ago
4
5* `migrations.ts` - code to set up the database tables the app needs
6* `queries.ts` - functions to run queries against those tables, which are imported and used in the main Hono server in `/backend/index.ts`
7
8## Migrations
18The queries file is where running the migrations happen in this app. It'd also be reasonable for that to happen in index.ts, or as is said above, for that line to be commented out, and only run when actual changes are made to your database schema.
19
20The queries file exports functions to get and write data. It relies on shared types and data imported from the `/shared` directory.

a8b48747537_NotebookView.tsx1 match

@vtTestLocal•Updated 2 days ago
54}
55
56export function NotebookView({ onClose, avatarUrl }: NotebookViewProps) {
57 const [memories, setMemories] = useState<Memory[]>([]);
58 const [loading, setLoading] = useState(true);

a8b48747537_App.tsx2 matches

@vtTestLocal•Updated 2 days ago
62};
63
64export function App() {
65 const [memories, setMemories] = useState<Memory[]>([]);
66 const [loading, setLoading] = useState(true);
139 const data = await response.json();
140
141 // Change the sorting function to show memories in chronological order
142 const sortedMemories = [...data].sort((a, b) => {
143 const dateA = a.createdDate || 0;

resume-parserresumeParser.ts12 matches

@prashamtrivedi•Updated 2 days ago
16
17/**
18 * Helper function to create a confidence field with a value and confidence score
19 */
20function createConfidenceField<T>(
21 value: T,
22 confidence: number,
37 * @returns Structured resume data with confidence scores
38 */
39export async function extractResumeData(
40 resumeText: string,
41 options?: ResumeParserOptions
96 * @returns Finalized resume data
97 */
98function postProcessResumeData(data: any, confidenceThreshold: number = 0.3): ParsedResume {
99 try {
100 // Ensure we have all required sections with at least empty arrays
220 * Create a default personal info object with empty fields
221 */
222function createDefaultPersonalInfo(): PersonalInfo {
223 return {
224 name: createConfidenceField('', 0),
236 * Calculate months between two dates
237 */
238function calculateMonthsBetween(startDate: Date, endDate: Date): number {
239 return (endDate.getFullYear() - startDate.getFullYear()) * 12 +
240 (endDate.getMonth() - startDate.getMonth());
247 * @returns Validated and standardized resume data
248 */
249export function validateAndStandardize(data: ParsedResume): ParsedResume {
250 // This function is now deprecated in favor of the validateResumeWithAI function
251 // which uses OpenAI to validate and standardize the data
252 return data;
261 * @returns Confidence score between 0 and 1
262 */
263export function calculateConfidence(
264 value: any,
265 fieldType: string,
285 * @returns Standardized value and standardization notes
286 */
287export function standardizeTerminology(
288 value: string,
289 fieldType: 'degree' | 'jobTitle' | 'skill' | 'language' | string
302 * @returns Resume data with confidence scores added
303 */
304export function addConfidenceScores(data: any): ParsedResume {
305 // This function would iterate through the resume data and add
306 // confidence scores to each field based on various factors
307

MaxCareVizindex.html1 match

@kvey•Updated 2 days ago
941 let keepPoint, removePoint;
942
943 // Define helper functions to check point types
944 const isCode = (point) => point.codeType === 'cpt' || point.codeType === 'icd10';
945 const isReasoning = (point) => point.codeType === 'step';

sqlite-storage-sizemain.tsx1 match

@stevekrouse•Updated 2 days ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2
3async function getStorageSize() {
4 const bytes =
5 (await sqlite.execute(`SELECT page_size * page_count FROM pragma_page_size(), pragma_page_count()`)).rows[0][0];

untitled-7266new-file-6774.tsx1 match

@stevekrouse•Updated 2 days ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2
3async function getStorageSize() {
4 const bytes =
5 (await sqlite.execute(`SELECT page_size * page_count FROM pragma_page_size(), pragma_page_count()`)).rows[0][0];

sqliteAdminDashboardmain.tsx4 matches

@zylanera•Updated 2 days ago
1// This val creates a SQLite dashboard admin panel with a sidebar for table names
2// It uses React for the frontend and the Val Town SQLite API for database operations
3// Now includes functionality to edit rows, using rowid or all columns as identifiers
4// and the ability to add new rows to tables
5// Column types are displayed next to column names in the UI
10import { vtTokenSessionAuth } from "https://esm.town/v/stevekrouse/vtTokenSessionAuthSafe";
11
12function App() {
13 const [tables, setTables] = useState([]);
14 const [selectedTable, setSelectedTable] = useState(null);
195}
196
197function client() {
198 createRoot(document.getElementById("root")).render(<App />);
199}
203}
204
205async function server(request: Request): Promise<Response> {
206 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
207 const url = new URL(request.url);

templateTwitterAlertREADME.md2 matches

@poarox•Updated 2 days ago
46- Key: `mentionsDiscord`
47- Value: Your Discord webhook URL.
48Notifications will be sent using this function:
49
50```ts
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

templateTwitterAlertmain.tsx1 match

@poarox•Updated 2 days ago
12const isProd = false;
13
14export async function twitterAlert({ lastRunAt }: Interval) {
15 // If isProd, search for tweets since that last time this interval ran
16 // if not, search for tweets since 48 hours ago for testing

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.