Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine

1.4K posts

Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine banner
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine

Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine

@codingaddict_lv

Web Developer • 🚀 Creator of https://t.co/ksVm1jofjS • Tweets about my dev journey

Beigetreten Mart 2018
102 Folgt8.9K Follower
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
🚨 New Course Alert! 🚨 Practical Git and GitHub: From Basics to Pro Workflows ✅ Hands-on Git commands ✅ Real-world workflows (merge, rebase, cherry-pick) ✅ Terminal + VSCode examples Perfect for devs who want to master Git without the fluff.
English
4
4
42
1.9K
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
The more time I spend in production code, the more I realize how out of touch many YouTube coding influencers are. Their takes on “clean code,” “best practices,” and what it means to be a senior dev often crumble in the face of real-world constraints, and legacy systems 😂
English
5
2
40
1.8K
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
Hot take 🔥 : in production, SourceTree ⏩ Git CLI. Look, I ❤️ terminal too, but when it’s time to rebase, merge, and cherry-pick in prod - most times clicking 🖱️ is faster than rewriting the same conflict 3 times—or summoning the Git gods with a ritual sacrifice. 🔥
English
0
0
13
729
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
Using a this hack in tests: 🔁 const resetSingleton = () => (HashingService as any).instance = undefined; 🔧 Calling this in beforeEach() to reset singleton state. 🕵️‍♂️ In general, (SomeClass as any) helps "cheat" TypeScript when tests need to bypass strict typing. #TypeScript#Jest
English
0
0
9
647
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
🧠 TypeScript fun fact! 🧠 The declare keyword only provides type information but NO runtime values! declare enum Colors { RED, BLUE } console.log(Colors.RED) // 💥 Crash! Remove declare if you need actual values at runtime 😀
English
1
0
5
608
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
🔍 Dev Tip: Lookup Tables FTW! 📚 Ditch long if/switch statements—use object mapping instead! 🚀 Examples: ✅ Convert status codes to messages ✅ Map country codes to names ✅ Translate enums 💡 const result = lookupTable[input] || defaultValue; Fast, and easy to maintain! ⚡
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine tweet mediaJānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine tweet mediaJānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine tweet media
English
2
6
30
1.6K
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
🚀 Generate minimal .d.ts files with dts-bundle-generator 📦 npm install --save-dev dts-bundle-generator 📂 mkdir -p types (if missing) ⚡ npx dts-bundle-generator -o types/utils.d.ts src/utils.ts 🔍 Extracts only needed types & dependencies!
English
0
0
21
880
Jānis Smilga 🇱🇻 🇺🇦 #StandWithUkraine
🧪 Jest Mocking Gotcha! 🔥 Issue: 👉 jest.mock('./myModule'); 🚨 Returns undefined for EVERYTHING! 🫥 ⚡ Your code: 👉 myModule.doStuff() 💥 Cannot read property 'doStuff' of undefined 🛠 Fix: jest.mock('./myModule', () => ({ doStuff: jest.fn() })); #JavaScript #Testing #Jest
English
1
1
11
669