React Styleguidist uses external markdown files to store usage examples. We wanted to use typescript for examples because reasons and we managed to do this with horrible solution. It includes custom webpack loader that parses typescript file with regular expressions and converts it to markdown. You could find parts of our code below.

Imagine you have two groups of date ranges and you want to determine whether they overlap.

Nah, let's make it harder. Imagine you have two groups of include date ranges and two groups of exclude date ranges. Your task is to determine, whether there's a date that is present in both include groups and not present in exclude groups. How to do that?

Imagine a wooden ship. It's a quite famous ship - Theseus himself used it to return to Athens from Crete. After that Athenians tried to preserve it by replacing decayed planks with new ones. Many years passed and now we can say for sure that every part of the ship was replaced at least once. Is it still the same ship?

I had to fix performance issues of one API endpoint. A pretty Symfony endpoint that gathers some data from database, assembling it to some structure and returns it as json.

Performance started being an issue when major part of that "some data" started to be 60000 entities. In worst case response time was almost 20 seconds. "Ok", I thought, "60k is a big enough number to make it slow". But trace showed that retrieving data from DB isn't a slowest part. There were things taking almost 1/3 of request time each. And these things were easy to fix.

Junior dev's life is hard an full of dangers. You come to technical interview and think "at least I'll learn something new from guys that know it better than me". Well, not really. Threre are some things that are ok in interviews and are totally wrong in real life. Here are some examples.

I've heard about composer long before I started using it. I couldn't understand why it's so much cooler than downloading dependencies manually. I couldn't understand why it's worth running composer install after every code fetch.

This article is for guys like me in the past. If you're already using composer you can stop reading.

Copy-pasting two functions between projects is boring so I've created a GIANT COMPOSER PACKAGE with class with these two functions. It can convert relative urls to absolute and to add get parameters to urls. It's called urmaul/url.