MHD's Avatar

MHD

@mhd.codes

certified typescript lover boy πŸ§™β€β™‚οΈ | maintainer @codiume

72
Followers
127
Following
65
Posts
08.09.2023
Joined
Posts Following

Latest posts by MHD @mhd.codes

Preview
Wallpapers | Astro Elevate your style with our stellar designs.

astro.build/wallpapers/

18.01.2025 15:17 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

Look me in the eyes and tell me this code isn't beautiful.

09.01.2025 22:16 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

Arrays are like standard JavaScript arrays. a bag of elements that can grow or shrink.

Tuples, on the other hand, are fixed in length and type. They know exactly how many elements they contain and the specific types of elements at each position.

03.01.2025 12:49 πŸ‘ 4 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

In #TypeScript, Arrays and Tuples are not the same, So how do we differentiate between the two at the type level? The following type does exactly that using a clever trick (explained in the replies):

03.01.2025 12:49 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Post image

By the way, here’s the usual way to get the last element of a tuple:

30.12.2024 17:46 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Here’s what’s happening in this code: we’ve created a tuple that’s one element longer than the original T. Now, the length of the original tuple (T["length"] == 4) becomes our index, pointing to the last element of the newly created tuple.

30.12.2024 17:46 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

I stumbled upon this piece of #TypeScript art, a type helper that cleverly gets the last element of any tuple type. (explanation in the replies)

30.12.2024 17:46 πŸ‘ 1 πŸ” 0 πŸ’¬ 2 πŸ“Œ 0
Preview
Advent of TypeScript Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...

I've completed πŸŽ„πŸŽ‰πŸŽ… Thank You! - Advent of TypeScript 2024 adventofts.com/events/2024/25

25.12.2024 11:22 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

tsup

22.12.2024 21:45 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Advent of TypeScript Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...

I've completed 🎩Bernard's New Demands 2: Electric Boogaloo - Advent of TypeScript 2024 adventofts.com/events/2024/21

21.12.2024 09:22 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I imagine you saying the same thing about bsky

20.12.2024 14:49 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image
18.12.2024 09:44 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Advent of TypeScript Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...

I've completed Day 18 - Advent of TypeScript 2024 adventofts.com/events/2024/18

18.12.2024 09:38 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Yeah, today’s challenge is much easier. 16 was tough, and the incorrect tests made it worse, I spent almost three hours trying to make it work.

17.12.2024 11:02 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

even with the help of all LLM's I'm not able to pass test 4

16.12.2024 14:36 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

15 was hard, tbh. I got to the final solution through brute force only.

16.12.2024 10:12 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Advent of Typescript 2024: Day 15 Solution

Advent of Typescript 2024: Day 15 Solution

I've completed Day 15 - Advent of Typescript 2024 adventofts.com/events/2024/15

16.12.2024 09:13 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

Advent of Typescript: Day 14

14.12.2024 21:13 πŸ‘ 4 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Advent of TypeScript Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...

I've completed 🎩Bernard's Long List Of Names - Advent of TypeScript 2024 adventofts.com/events/2024/12

12.12.2024 17:31 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

The astro schema package is reaching a nice milestone, so I thought I’d share it with you, go
@astro.build πŸš€

09.12.2024 10:53 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

I've completed πŸŽ…Santa Refuses To Use Threads - Advent of TypeScript 2024 adventofts.com/events/2024/6

06.12.2024 12:49 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
React v19 – React The library for web and native user interfaces

React v19 is now stable!

react.dev/blog/2024/12...

05.12.2024 19:05 πŸ‘ 1282 πŸ” 342 πŸ’¬ 32 πŸ“Œ 93
Post image

React 18 is a thing of the past, hail the new king, React 19!

06.12.2024 06:13 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image Post image

features i’m excited about in react 19

05.12.2024 22:13 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I've completed Drafting This Year's Routes - Advent of TypeScript 2024 adventofts.com/events/2024/5

05.12.2024 12:34 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Astro 5.0 | Astro Astro 5.0 brings exciting new features like the Astro Content Layer for seamless content loading from any source, and Server Islands for effortlessly combining static and dynamic personalized content.

Astro 5.0 is here.
Content layer, server islands, simplified prerendering, type-safe env, @vite.dev v6. All stable.

Go see what you can do πŸ‘‡
astro.build/blog/astro-5/

03.12.2024 18:20 πŸ‘ 585 πŸ” 159 πŸ’¬ 24 πŸ“Œ 47

Ready for @astro.build v5 πŸš€πŸ’ͺ

astro-svg-loaders@5.0.0
astro-seo-schema@5.0.0
astro-useragent@5.0.0
astro-purgecss@5.0.0
astro-seo-meta@5.0.0

03.12.2024 15:44 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Advent of TypeScript Advent of TypeScript

I've completed ⚑Blitzen Fixes The Mess #AdventOfTypescript adventofts.com/events/2024/2

02.12.2024 11:07 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I've completed The Reindeer Have Had Enough - Advent of TypeScript 2024 adventofts.com/events/2024/1

01.12.2024 14:50 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
TryPHP - Effortlessly set up PHP on Linux with a simple curl command Effortlessly set up PHP on Linux with a simple curl command

With the release of php8.4, i’m excited to share a tool i’ve been working on, which I think is the easiest way to set up the latest version of php on any apt-based linux system!

πŸ‘‰ give it a try: tryphp.dev
#php #linux #devtools

21.11.2024 14:31 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0