Sharing pragmatic tech tips & exploring AI-powered development workflows.
Let's build better software together! 🚀
1. Add `maxWorkers=50%` to utilize available CPU
2. Implement `shard` to split and run tests in parallel across multiple jobs
The big challenge? Collecting coverage data from separate jobs. Solution below
1. Add `maxWorkers=50%` to utilize available CPU
2. Implement `shard` to split and run tests in parallel across multiple jobs
The big challenge? Collecting coverage data from separate jobs. Solution below
I spent time understanding how it's calculated, here's simple math:
- Token ≠ word
- 1 word ≈ 1.3token
- 1 tweet ≈ 35 tokens
- Emojis cost extra tokens
shorter words = fewer tokens = lower costs
I spent time understanding how it's calculated, here's simple math:
- Token ≠ word
- 1 word ≈ 1.3token
- 1 tweet ≈ 35 tokens
- Emojis cost extra tokens
shorter words = fewer tokens = lower costs
- Unit tests: mock DataService
- E2E: use TestDatabaseService with Fishery
- No need to mock individual repositories
- Clean, reusable test data
- Unit tests: mock DataService
- E2E: use TestDatabaseService with Fishery
- No need to mock individual repositories
- Clean, reusable test data
1. Base Repository - shared database operations
2. Entities - database structure
3. DataService - single entry point
4. Factories - test data generation
1. Base Repository - shared database operations
2. Entities - database structure
3. DataService - single entry point
4. Factories - test data generation
Create a data-access module that:
• Acts as a single source of truth
• Handles all database operations
• Provides clean testing interfaces
• Manages multiple databases
Create a data-access module that:
• Acts as a single source of truth
• Handles all database operations
• Provides clean testing interfaces
• Manages multiple databases
I faced this problem a few times:
• Duplicated database logic
• Multiple connection configurations
• Inconsistent testing patterns
• No clear structure
Let me explain how I fixed this with the Data-Access Pattern 🧵
#NestJS #nodejs #webdevb
Type-safe + clear errors = no more missing configs
#TypeScript #WebDev #nodejs
Type-safe + clear errors = no more missing configs
#TypeScript #WebDev #nodejs
Best practice: Use AI as a drafting tool, maintain atomic conversations, and own your code through meaningful review.
#AI #SoftwareDevelopment
Best practice: Use AI as a drafting tool, maintain atomic conversations, and own your code through meaningful review.
#AI #SoftwareDevelopment
Solution: Leader Election pattern!
- Tabs form a team
- Pick ONE leader tab
- Only leader makes API calls
- If leader closes, new one steps up
Used broadcast-channel lib. Now instead of 5 requests → just 1
#frontend #javascript
Solution: Leader Election pattern!
- Tabs form a team
- Pick ONE leader tab
- Only leader makes API calls
- If leader closes, new one steps up
Used broadcast-channel lib. Now instead of 5 requests → just 1
#frontend #javascript
Solution: Leader Election pattern!
- Tabs form a team
- Pick ONE leader tab
- Only leader makes API calls
- If leader closes, new one steps up
Used broadcast-channel lib. Now instead of 5 requests → just 1
#frontend #javascript
Solution: Leader Election pattern!
- Tabs form a team
- Pick ONE leader tab
- Only leader makes API calls
- If leader closes, new one steps up
Used broadcast-channel lib. Now instead of 5 requests → just 1
#frontend #javascript
Instead of juggling multiple docker-compose files for prod/dev/test, just add "profiles: [dev]" to your services and run:
docker compose --profile dev up
Perfect for managing different environments in a single file!
#docker
Instead of juggling multiple docker-compose files for prod/dev/test, just add "profiles: [dev]" to your services and run:
docker compose --profile dev up
Perfect for managing different environments in a single file!
#docker
When you filter out undefined, does TS still think they might be there?
🪄 Magic solution: Add "is" type check!
#typescript #webdev
When you filter out undefined, does TS still think they might be there?
🪄 Magic solution: Add "is" type check!
#typescript #webdev
With projects, you can create custom prompts with specific output requirements - perfect for recurring tasks like architecture planning or article title generation
With projects, you can create custom prompts with specific output requirements - perfect for recurring tasks like architecture planning or article title generation
Writing an article to share my complete setup! 📝
Writing an article to share my complete setup! 📝
- I send to server "devMode" flag and remove any restrictions (player count, for starting the game, etc.)
- Debug information, like "row state". It's helpful when you're testing release build
Here is an example of my debug panel:
- I send to server "devMode" flag and remove any restrictions (player count, for starting the game, etc.)
- Debug information, like "row state". It's helpful when you're testing release build
Here is an example of my debug panel:
2. Add hidden button on the bottom
3. Create logic that activate `isDevMode` flag when taped 10 times
4. Show indicator that dev mode enabled
Voilà ✨
2. Add hidden button on the bottom
3. Create logic that activate `isDevMode` flag when taped 10 times
4. Show indicator that dev mode enabled
Voilà ✨
Implement a secret tap combo in a corner, show a dev mode indicator, and add debug controls. Makes testing simple for reviewers, plus helps verify features work 🔍
Here is how I did this 🧵
#buildinpublic #swiftui
Implement a secret tap combo in a corner, show a dev mode indicator, and add debug controls. Makes testing simple for reviewers, plus helps verify features work 🔍
Here is how I did this 🧵
#buildinpublic #swiftui
Completed core features: lobbies, gameplay, scoring & real-time communication. All while working full-time!
Next stop: Bug fixing and App Store 🚀
#buildinpublic
Completed core features: lobbies, gameplay, scoring & real-time communication. All while working full-time!
Next stop: Bug fixing and App Store 🚀
#buildinpublic
Added new mechanics after testing:
The Stranger can now win by guessing the profession. Making Citizens think twice about their questions! Also, a new voting system is in place to catch the Stranger.
#buildinpublic
Added new mechanics after testing:
The Stranger can now win by guessing the profession. Making Citizens think twice about their questions! Also, a new voting system is in place to catch the Stranger.
#buildinpublic
Beautiful UI that lets you run commands without memorizing shortcuts.
Replaced my skhd + yabai setup, and it's as simple as installing from brew.
Beautiful UI that lets you run commands without memorizing shortcuts.
Replaced my skhd + yabai setup, and it's as simple as installing from brew.