These files are for the Code Warriors AI-Powered Adventure course.
- data.json - Story graph with 19 interconnected locations
- config.example.py - Configuration template
This guide demonstrates how to programmatically duplicate files with new names based on filename patterns using Zsh scripting.
Common use case: You're working with a codebase using .tsx files (React TypeScript) and need to quickly scaffold variants of each component — like *-skeleton.tsx and *-fallback.tsx files.
| // Based on Theo - t3․gg suggestion and ZOD | |
| // Youtube https://www.youtube.com/watch?v=Y6jT-IkV0VM&t=538s | |
| // and gist https://gist.github.com/t3dotgg/a486c4ae66d32bf17c09c73609dacc5b | |
| type Success<T> = { | |
| success: true | |
| data: T | |
| error?: never | |
| } |
Form handling in React can quickly become verbose and repetitive. The Dynamic Property Name pattern (sometimes called the "single handler pattern") elegantly solves this problem by combining several modern JavaScript features. Let me walk you through several iterations of this powerful pattern, its benefits, and some enhancements.
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).Reverting changes in Git traditionally required using git checkout to restore files or git reset to adjust the branch HEAD. However, both commands carried risks if misused: git reset could shift the branch HEAD, while git checkout could either switch branches or load a different commit, potentially disrupting the current branch state.
git restore main.jsG'day mate! Welcome to the most fair dinkum date formatting library this side of the Southern Hemisphere!
Ever needed to format your dates in proper Australian style but got lost in the outback of date formatting? No worries! This little beauty's got you covered with all the date formats you'll ever need in the land down under.
| /** | |
| * A builder class for manipulating JavaScript Date objects in a chainable way. | |
| * @class | |
| * @example | |
| * const builder = new DateBuilder(); | |
| * const nextWeek = builder | |
| * .addDays(7) | |
| * .build(); | |
| * | |
| * @example |
Because sometimes your promises are buried deeper than your ex's Instagram photos. This utility helps you resolve them all, no matter where they're hiding! 🕵️♂️
Promise.all but for objects (because objects deserve love too!)