Grilled Cheese

ExploreLog inSign up
Terms of UsePrivacy PolicyCommunity StandardsHelpGet the app

Grilled Cheese is a product of Village Compute

Version devBuilt at: 2026-12-03 22:42:33 EST

PhotosVideosAllPeople
LatestRanked
Card reading: Anything the browser can read, a user can read. A diagram shows the browser sending input to your server, which checks the user, holds the key and calls the model. Prototype to production, part 4 of 9. kevinhorek.com
The code viewer starts with Greeting.cs selected.
Black text on yellow background:
The Index #205
Angular code in export.ts. A component with selector 'app-export' and the template: <button (click)="start$.next()">Export report</button>, then @let job = exportJob(); @if (job?.status === 'running') shows <progress [value]="job.progress" max="100">, @else if (job?.status === 'done') shows <a [href]="job.fileUrl">Download report</a>. In class Export: private readonly http = inject(HttpClient); readonly start$ = new Subject<void>(); readonly exportJob = toSignal(this.start$.pipe(switchMap(() => this.http.post<{ id: string }>('/api/exports', {})), switchMap(({ id }) => timer(0, 2000).pipe(switchMap(() => this.http.get<ExportJob>(`/api/exports/${id}`)), takeWhile((job) => job.status === 'running', true))))). The takeWhile line is highlighted.
Photo, no description
Black and white photo of two hands on a white background, each holding a jigsaw puzzle piece, the two pieces almost touching but not joined. Over it, in blue monospace text, TypeScript code: type Theme = 'light' | 'dark'; const config = { theme: 'dark', fontSize: 14 } satisfies Record<string, Theme | number>; config.theme; // 'dark', not Theme | number. config.fontSize; // number, .toFixed() just works. Photo via Rawpixel (CC0).
Photo, no description
JavaScript code in time-ago.js. const formatter = new Intl.RelativeTimeFormat('en', { numeric: 'auto' }). const UNITS = new Map([['year', 31_536_000], ['month', 2_592_000], ['day', 86_400], ['hour', 3_600], ['minute', 60], ['second', 1]]). function timeAgo(date) { const seconds = (date - Date.now()) / 1000; for (const [unit, size] of UNITS) { if (Math.abs(seconds) >= size || unit === 'second') { return formatter.format(Math.round(seconds / size), unit); } } }. Then: timeAgo(new Date()) gives "now", timeAgo(new Date(Date.now() - 86_400_000)) gives "yesterday", timeAgo(new Date(Date.now() + 3 * 86_400_000)) gives "in 3 days". The formatter line and the return line are highlighted.
Angular code in chat.ts. A component with selector 'app-chat' and the template: a div with class "messages" and the reference #list, holding @for (message of messages(); track message.id) { <p [class]="message.role">{{ message.content }}</p> }, then <input #prompt (keydown.enter)="send(prompt.value); prompt.value = ''" />. In class Chat: private readonly agent = new HttpAgent({ url: '/api/agent' }); private readonly list = viewChild.required<ElementRef<HTMLElement>>('list'); readonly messages = signal<Message[]>([]). The constructor calls this.agent.subscribe({ onMessagesChanged: ({ messages }) => this.messages.set([...messages]) }), then afterRenderEffect(() => { this.messages(); const element = this.list().nativeElement; element.scrollTop = element.scrollHeight; }). The method send(content: string) calls this.agent.addMessage({ id: crypto.randomUUID(), role: 'user', content }) and this.agent.runAgent(). The afterRenderEffect line and the scrollTop line are highlighted.
Angular code in signup.ts, in three parts. "Reactive Forms": readonly signupForm = new FormGroup({ isBusiness: new FormControl(false), company: new FormControl('') }); then a constructor that subscribes to this.signupForm.controls.isBusiness.valueChanges.pipe(takeUntilDestroyed()) and, for each value, takes const company = this.signupForm.controls.company, calls company.setValidators(isBusiness ? Validators.required : null) and company.updateValueAndValidity(). "Signal Forms": readonly model = signal({ isBusiness: false, company: '' }); readonly signupForm = form(this.model, (path) => { hidden(path.company, { when: ({ valueOf }) => !valueOf(path.isBusiness) }); required(path.company); }). "Template": @if (!signupForm.company().hidden()) { <input [formField]="signupForm.company" /> }. The hidden and required lines are highlighted.
Photo, no description
Photo, no description
Angular code in editor.ts. A component with selector 'app-editor', imports: [DatePipe], and host: { '(document:keydown.control.s)': 'save($event)', '(document:keydown.meta.s)': 'save($event)' }. The template: <textarea #area [value]="draft()" (input)="draft.set(area.value)"></textarea>, then @if (savedAt(); as time) { <small>Saved at {{ time | date: 'shortTime' }}</small> }. In class Editor: readonly draft = signal(localStorage.getItem('draft') ?? ''); readonly savedAt = signal<Date | null>(null). The method save(event: Event) calls event.preventDefault(), localStorage.setItem('draft', this.draft()) and this.savedAt.set(new Date()). The two host listener lines are highlighted.
Photo, no description
Screenshot of the Can I Use website. It shows browser compatibility for the CSS selector where. Modern browsers like Chrome, Firefox, Safari, and Edge support this feature with over 94 percent global coverage.
Illustration: a browser window with a question mark, three answer cards below it, and a tick on the middle one
Login screen of my todo app.
In Melbourne, Australia, a large pixel styles artwork covers the side of a dark high-rise beneath the heading “Scratch News Australia”.
Across the top are two small gold symbols and a white score display. Below, a crowned figure in pink stands near two barrels, a monkey faces right on a middle platform, and a figure in a orange cap, red shirt and blue overalls stands on a lower ledge.
The image is promoting Scratch News, scratchnews.io
Photo, no description
Day 023: Utility types - Part 2
Load more