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/$%7Bart_info.art.src%7D?q=function&page=2394&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 27677 results for "function"(8388ms)

anthropicProxymain.tsx1 match

@mmrech•Updated 9 months ago
1import Anthropic from "npm:@anthropic-ai/sdk@0.24.3";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method === "OPTIONS") {
5 return new Response(null, {

password_authmain.tsx5 matches

@mrdrone•Updated 9 months ago
11};
12
13async function createSessionTable(tableName: string) {
14 await sqlite.execute(`CREATE TABLE ${tableName} (
15 id TEXT NOT NULL PRIMARY KEY,
19}
20
21async function createSession(tableName: string, valSlug: string): Promise<Session> {
22 try {
23 const expires_at = new Date();
39}
40
41async function getSession(tableName: string, sessionID: string, valSlug: string): Promise<Session> {
42 try {
43 const { rows, columns } = await sqlite.execute({
80</html>`;
81
82export function redirect(location: string): Response {
83 return new Response(null, {
84 headers: {
98const cookieName = "auth_session";
99
100export function passwordAuth(next, options?: PasswordAuthOptions) {
101 const sessionTable = options?.sessionTable || "password_auth_session";
102 return async (req: Request) => {

resumeDetailsmain.tsx2 matches

@siygle•Updated 9 months ago
1export default async function handler(req: Request): Promise<Response> {
2 const resumeDetails = {
3 "basics": {
129 "highlights": [
130 "Developed a straightforward request lifecycle, handling both static and dynamic content efficiently",
131 "Implemented a flexible plugin system, enhancing extensibility and allowing for custom functionality in generated websites",
132 "Implemented efficient caching techniques, including in-memory content caching and static file path caching, to boost performance",
133 "Designed a flexible content source system, allowing for intuitive content organization based on directory structure",

sqliteExplorerAppREADME.md1 match

@mrdrone•Updated 9 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

resumeHandlermain.tsx1 match

@siygle•Updated 9 months ago
4import { resumeConfig } from "https://esm.town/v/siygle/resumeConfig";
5
6export default async function resumeHandler(req: Request): Promise<Response> {
7 if (req.method === "GET") {
8 try {

lastloginREADME.md1 match

@yawnxyz•Updated 9 months ago
48```
49
50You can allow anyone to signup by returning a boolean from the verifyEmail function:
51
52```ts

lastloginmain.tsx4 matches

@yawnxyz•Updated 9 months ago
4import { deleteCookie, getCookies, setCookie } from "jsr:@std/http/cookie";
5
6async function createSession(email: string, hostname: string) {
7 const sessionID = crypto.randomUUID();
8 const expiresAt = new Date();
24}
25
26async function getSession(sessionID: string, hostname: string) {
27 try {
28 const res = await sqlite.execute({
50}
51
52async function deleteSession(sessionID: string) {
53 await sqlite.execute({
54 sql: `DELETE FROM lastlogin_session WHERE sessionID=?`,
65};
66
67export function lastlogin(
68 handler: (req: Request) => Response | Promise<Response>,
69 options: LastLoginOptions,

marineMoccasinLizardmain.tsx10 matches

@kaz•Updated 9 months ago
28 "Have the ability to murder anyone without any consequences",
29 "Have a tight knit and loyal friend group",
30 "Have another set of eyes in the back of your head (they are fully functional)",
31 "Have a very physically attractive romantic partner",
32 "Be able to spawn pizzas by snapping your fingers (max 2 per 12 hours)",
36];
37
38function App() {
39 const [user, setUser] = useState<User | null>(null);
40 const [answers, setAnswers] = useState<Answer[]>([]);
106}
107
108function SplashScreen({ onGetStarted }: { onGetStarted: () => void }) {
109 return (
110 <div className="splash-screen">
132}
133
134function TabBar() {
135 const location = useLocation();
136 const tabs = [
163}
164
165function Game({ user, saveAnswer }: { user: User | null; saveAnswer: (answer: Answer, losingAnswer: string) => void }) {
166 const getRandomQuestion = useCallback((): Question => {
167 const availableOptions = [...ANSWER_OPTIONS];
198}
199
200function Answers(
201 { user, answers, rankings, clearAnswers }: {
202 user: User | null;
237}
238
239function Profile({ user, setUser }: { user: User | null; setUser: (user: User | null) => void }) {
240 const [username, setUsername] = useState("");
241
277}
278
279function client() {
280 createRoot(document.getElementById("root")!).render(<App />);
281}
285}
286
287async function server(request: Request): Promise<Response> {
288 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
289 const KEY = "marineMoccasinLizard";
369}
370
371async function updateEloRankings(sqlite: any, KEY: string, winningAnswer: string, losingAnswer: string) {
372 const K = 32; // This is the maximum score change per match
373

RefiComparisonmain.tsx3 matches

@jbwinters•Updated 9 months ago
20}
21
22function App() {
23 const [offers, setOffers] = useState<Offer[]>([]);
24 const [newOffer, setNewOffer] = useState<Omit<Offer, 'id' | 'monthlyPayment' | 'totalInterest'>>({
354}
355
356function client() {
357 createRoot(document.getElementById("root")).render(<App />);
358}
362}
363
364async function server(request: Request): Promise<Response> {
365 const { blob } = await import("https://esm.town/v/std/blob");
366 const KEY = "RefiComparison";

extractTextmain.tsx1 match

@ttodosi•Updated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function extractText(data, name) {
4 const fileUrl =
5 "https://www.gcmgrosvenor.com/wp-content/uploads/Private-Credit-Co-investing-GCM-Grosvenor.pdf";

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

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