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/image-url.jpg%20%22Image%20title%22?q=function&page=94&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 20286 results for "function"(1584ms)

JobsREADME.md1 match

@Fatimaโ€ขUpdated 2 days ago
25โ”‚ โ”œโ”€โ”€ database/
26โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
27โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # DB query functions
28โ”‚ โ”œโ”€โ”€ routes/ # Route modules
29โ”‚ โ”‚ โ”œโ”€โ”€ jobs.ts # Job posting endpoints

WaitTimeProxymain.tsx1 match

@raymondcamdenโ€ขUpdated 2 days ago
1export async function main() {
2 let res = await fetch("https://queue-times.com/parks.json");
3 let data = await res.json();

Landing-Pageindex.ts4 matches

@charmaineโ€ขUpdated 2 days ago
1export default async function (req: Request) {
2 const html = `<!DOCTYPE html>
3<html lang="en">
463 <script>
464 // Mobile menu toggle
465 document.getElementById('mobile-menu-button').addEventListener('click', function() {
466 const mobileMenu = document.getElementById('mobile-menu');
467 mobileMenu.classList.toggle('hidden');
470 // Smooth scrolling for anchor links
471 document.querySelectorAll('a[href^="#"]').forEach(anchor => {
472 anchor.addEventListener('click', function (e) {
473 e.preventDefault();
474
494 // Add to cart animation
495 document.querySelectorAll('.product-card button').forEach(button => {
496 button.addEventListener('click', function() {
497 this.innerHTML = '<i class="fas fa-check"></i>';
498 setTimeout(() => {

Demostripe-to-discord.ts8 matches

@charmaineโ€ขUpdated 2 days ago
35 * Main handler for Stripe webhook events
36 */
37export default async function(req: Request): Promise<Response> {
38 // Only allow POST requests
39 if (req.method !== 'POST') {
96 * Format a Stripe event into a Discord message
97 */
98function formatStripeEventForDiscord(event: Stripe.Event): any {
99 // Base embed structure
100 const embed: any = {
162 * Send a formatted message to Discord
163 */
164async function sendToDiscord(webhookUrl: string, message: any): Promise<void> {
165 const response = await fetch(webhookUrl, {
166 method: 'POST',
180 * Format a human-readable title from an event type
181 */
182function formatEventTitle(eventType: string): string {
183 const parts = eventType.split('.');
184 const entity = parts[0];
211 * Get the appropriate color for an event type
212 */
213function getColorForEvent(eventType: string): number {
214 if (eventType.includes('succeeded') || eventType.includes('created') || eventType.includes('paid')) {
215 return COLORS.success;
228 * Format a currency amount
229 */
230function formatAmount(amount: number, currency: string): string {
231 const formatter = new Intl.NumberFormat('en-US', {
232 style: 'currency',
242 * Format a date range
243 */
244function formatDateRange(startTimestamp: number, endTimestamp: number): string {
245 const start = new Date(startTimestamp * 1000);
246 const end = new Date(endTimestamp * 1000);
260 * Get subscription plan name
261 */
262function getSubscriptionPlanName(subscription: Stripe.Subscription): string {
263 if (!subscription.items?.data?.length) {
264 return 'N/A';

automate-workflowsREADME.md1 match

@charmaineโ€ขUpdated 2 days ago
6
7- `types.ts` - TypeScript interfaces and types
8- `utils.ts` - Utility functions for parsing commits and generating markdown
9
10## Key Components

automate-workflowsREADME.md1 match

@charmaineโ€ขUpdated 2 days ago
12- Form for entering repository details and commit range
13- Preview of generated release notes in Markdown format
14- Copy to clipboard functionality
15- Download as Markdown file
16- Error handling and loading states

automate-workflowsindex.js1 match

@charmaineโ€ขUpdated 2 days ago
16});
17
18function setupFormHandling() {
19 const form = document.getElementById('release-form');
20 const generateBtn = document.getElementById('generate-btn');

automate-workflowsutils.ts4 matches

@charmaineโ€ขUpdated 2 days ago
3// Parse a commit message according to conventional commit format
4// https://www.conventionalcommits.org/
5export function parseCommitMessage(commit: GitHubCommit): { type: CommitType; message: string } {
6 const { message } = commit.commit;
7
26
27// Group commits by type for release notes
28export function groupCommitsByType(commits: GitHubCommit[]): ReleaseNoteSection[] {
29 const sections: Record<CommitType, ReleaseNoteItem[]> = {} as Record<CommitType, ReleaseNoteItem[]>;
30
56
57// Generate markdown for release notes
58export function generateMarkdown(title: string, date: string, sections: ReleaseNoteSection[]): string {
59 let markdown = `# ${title}\n\n`;
60 markdown += `*Released on ${date}*\n\n`;
74
75// Format date to YYYY-MM-DD
76export function formatDate(date: Date): string {
77 return date.toISOString().split('T')[0];
78}

Towniestyles.css2 matches

@valdottownโ€ขUpdated 2 days ago
162 transition-property: background-color;
163 transition-duration: 400ms;
164 transition-timing-function: linear;
165}
166
840 transition-property: color, background-color, border-color, opacity;
841 transition-duration: 200ms;
842 transition-timing-function: ease-in-out;
843}
844

automate-workflowsmain.tsx1 match

@charmaineโ€ขUpdated 2 days ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

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.