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?q=function&page=14&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 28831 results for "function"(2207ms)

thirdTimertimer-actions.ts6 matches

@nbbaier•Updated 18 hours ago
18 * a success notification, and the current timestamp
19 */
20export function startWork(currentState: TimerState): TimerActionResult {
21 const now = Date.now();
22
44 * or unchanged state if not currently working
45 */
46export function takeBreak(currentState: TimerState): TimerActionResult {
47 if (!currentState.workStartTime) {
48 return { newState: currentState };
81 * and notification about remaining break time
82 */
83export function resumeWork(currentState: TimerState): TimerActionResult {
84 if (!currentState.breakStartTime) {
85 return { newState: currentState, currentTime: Date.now() };
128 * or unchanged state if not currently working
129 */
130export function handleInterruption(
131 currentState: TimerState,
132): TimerActionResult {
163 * @returns A TimerActionResult with break mode activated and all saved break time consumed
164 */
165export function takeBigBreak(currentState: TimerState): TimerActionResult {
166 const now = Date.now();
167 const newState = { ...currentState };
195 * @returns A TimerActionResult with the timer reset to idle state and all timing data cleared
196 */
197export function resetSession(currentState: TimerState): TimerActionResult {
198 return {
199 newState: {

thirdTimerTimerContainer.tsx1 match

@nbbaier•Updated 18 hours ago
26}
27
28export const TimerContainer = React.memo(function TimerContainer({
29 state,
30 setState,

thirdTimerutils.ts2 matches

@nbbaier•Updated 18 hours ago
1export function formatTime(seconds: number): string {
2 const hours = Math.floor(seconds / 3600);
3 const minutes = Math.floor((seconds % 3600) / 60);
12}
13
14export function formatMinutes(minutes: number): string {
15 if (minutes < 1) return `${Math.round(minutes * 60)}s`;
16 if (minutes < 60) return `${Math.round(minutes)}m`;

thirdTimerStatsGrid.tsx1 match

@nbbaier•Updated 18 hours ago
12}
13
14export function StatsGrid({ stats, columns = 3 }: StatsGridProps) {
15 const colorClasses = {
16 green: "text-green-500",

thirdTimerSessionStats.tsx1 match

@nbbaier•Updated 18 hours ago
10}
11
12export function SessionStatsDisplay({
13 stats,
14 formatMinutes,

thirdTimerHelpText.tsx1 match

@nbbaier•Updated 18 hours ago
9);
10
11export const HelpText = React.memo(function HelpText() {
12 return (
13 <Card>

thirdTimerFooter.tsx1 match

@nbbaier•Updated 18 hours ago
6export const SOURCE_URL = "https://val.town/x/nbbaier/thirdTimer";
7
8export const Footer = React.memo(function Footer() {
9 return (
10 <footer className="flex gap-2 items-center p-4 mx-auto my-0 max-w-5xl text-xs">

thirdTimerCard.tsx2 matches

@nbbaier•Updated 18 hours ago
5 className?: string;
6}
7export function CardHeader({ children, className = "" }: CardProps) {
8 return (
9 <div className={`mb-3 text-lg font-semibold ${className}`}>
13}
14
15export function Card({ children, className = "" }: CardProps) {
16 return (
17 <div

thirdTimerButton.tsx1 match

@nbbaier•Updated 18 hours ago
19}
20
21export function Button({
22 children,
23 onClick,

thirdTimerBreakFractionSettings.tsx1 match

@nbbaier•Updated 18 hours ago
19}
20
21export const BreakFractionSettings = React.memo(function BreakFractionSettings({
22 currentBreakFraction,
23 onBreakFractionChange,
tuna

tuna9 file matches

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