Trending
Jonny Bits's Avatar

Jonny Bits

@optoelectro

Just some guy who writes code

36
Followers
441
Following
13
Posts
16.12.2023
Joined
Posts Following

Latest posts by Jonny Bits @optoelectro

That's fine, you just need to watch out if a little old lady invites you inside whilst you're nibbling on the house.

21.12.2024 07:54 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Hot patch or did you need to restart?

13.11.2024 22:04 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Easy to forget language features you don't use every day. I don't use "infer" enough and the real version of this I implemented this week also needs a type cast on the Object.fromEntries as we don't have 5.5 yet ๐Ÿ˜”

10.11.2024 13:35 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Updated example of a TypeScript function turning the properties from objects in an input array into keys of the return object.

Updated example of a TypeScript function turning the properties from objects in an input array into keys of the return object.

You're right, that works and is a big improvement, thanks!

10.11.2024 13:26 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

How do you bowl a pizza? Is that like bowling for soup?

10.11.2024 10:30 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

I don't think that's valid syntax but maybe I'm missing something..

10.11.2024 09:45 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Some Typescript code showing how to create a function which returns an Object type which is strongly typed based on one of the properties in the input array.

Some Typescript code showing how to create a function which returns an Object type which is strongly typed based on one of the properties in the input array.

This week I found myself needing to come up with a function returning an object which would be strongly typed based on a property from the objects from the input array.
This is what I ended up with, the only gotcha is needing 'as const' on the the input array. #TypeScript

09.11.2024 17:52 ๐Ÿ‘ 6 ๐Ÿ” 0 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 0

That had better be extra virgin JavaScript or I'm not touching it

01.11.2024 09:44 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

As a frontend platform engineer, my users are other engineers!
Which means I miss your grandma even more than you do.

31.10.2024 14:02 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

In what must surely be the world's greatest use of AI this week, I have created a Slack response template which successfully masks my sarcasm and derision.

31.10.2024 12:04 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

If I had a dollar for every time someone in my company asked me why we're not "just using GRPC" on the frontend...

Let's just say I'd have enough money to buy the company, and still have enough left over to get the professional help I need.

31.10.2024 08:43 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

It's 8am, the kids have got to get ready for school and I'm crying at Bluey again

31.10.2024 07:26 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Adding one to max safe integer in the JavaScript console

Adding one to max safe integer in the JavaScript console

Checkmate, JavaScript

30.10.2024 08:58 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0