Tori retweeted
Desvanece texto o imágenes de forma progresiva.
Con una línea de CSS, sin elementos HTML extra...
Sólo tienes que usar mask-image así ↓

ALT Una demostración de cómo hacer un degradado a un texto o una imagen con una propiedad de CSS sin crear elementos extras con un div. Código CSS: p { mask-image: linear-gradient( to bottom, white 5%, transparent 95% ); } img { mask-image: linear-gradient( to bottom right, black 60%, transparent 90% ); }
Tori retweeted
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
🟩🟩⬜🟩🟩🟩🟩⬜🟩🟩
🟩🟩⬜⬜🟩🟩⬜⬜🟩🟩
🟩🟩⬜⬜⬜⬜⬜⬜🟩🟩
🟩⬜⬜⬜⬜⬜⬜⬜⬜🟩
🟩⬜⬜⬜⬜⬜⬜⬜⬜🟩
🟩⬜⬜⬜⬜⬜⬜⬜⬜🟩
🟩🟩⬜⬜⬜⬜⬜⬜🟩🟩
🟩🟩🟩⬜⬜⬜⬜🟩🟩🟩
🟩⬜🟩⬜⬜⬜⬜🟩🟩🟩
🟩🟩⬜⬜⬜⬜⬜⬜🟩🟩
🟩🟩⬜⬜⬜⬜⬜⬜🟩🟩
Tori retweeted
How does SQL execution order work, and why is it so important?
A SQL query executes its statements in the following order:
1. FROM / JOIN
2. WHERE
3. GROUP BY
4. HAVING
5. SELECT
6. DISTINCT
7. ORDER BY
8. LIMIT / OFFSET
𝗧𝗵𝗲 𝘁𝗲𝗰𝗵𝗻𝗶𝗾𝘂𝗲𝘀 𝘆𝗼𝘂 𝗶𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁 𝗮𝘁 𝗲𝗮𝗰𝗵 𝘀𝘁𝗲𝗽 𝗵𝗲𝗹𝗽 𝘀𝗽𝗲𝗲𝗱 𝘂𝗽 𝘁𝗵𝗲 𝗳𝗼𝗹𝗹𝗼𝘄𝗶𝗻𝗴 𝘀𝘁𝗲𝗽𝘀. This is why it's important to know their execution order.
𝗧𝗼 𝗺𝗮𝘅𝗶𝗺𝗶𝘇𝗲 𝗲𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝗰𝘆, 𝗳𝗼𝗰𝘂𝘀 𝗼𝗻 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗶𝗻𝗴 𝘁𝗵𝗲 𝘀𝘁𝗲𝗽𝘀 𝗲𝗮𝗿𝗹𝗶𝗲𝗿 𝗶𝗻 𝘁𝗵𝗲 𝗾𝘂𝗲𝗿𝘆.
With that in mind, let's take a look at some 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻 𝘁𝗶𝗽𝘀:
𝟭) 𝗠𝗮𝘅𝗶𝗺𝗶𝘇𝗲 𝘁𝗵𝗲 𝗪𝗛𝗘𝗥𝗘 𝗰𝗹𝗮𝘂𝘀𝗲
This clause is executed early, so it's a good opportunity to reduce the size of your data set before the rest of the query is processed.
𝟮) 𝗙𝗶𝗹𝘁𝗲𝗿 𝘆𝗼𝘂𝗿 𝗿𝗼𝘄𝘀 𝗯𝗲𝗳𝗼𝗿𝗲 𝗮 𝗝𝗢𝗜𝗡
Although the FROM/JOIN occurs first, you can still limit the rows. To limit the number of rows you are joining, use a subquery in the FROM statement instead of a table.
𝟯) 𝗨𝘀𝗲 𝗪𝗛𝗘𝗥𝗘 𝗼𝘃𝗲𝗿 𝗛𝗔𝗩𝗜𝗡𝗚
The HAVING clause is executed after WHERE & GROUP BY. This means you're better off moving any appropriate conditions to the WHERE clause when you can.
𝟰) 𝗗𝗼𝗻'𝘁 𝗰𝗼𝗻𝗳𝘂𝘀𝗲 𝗟𝗜𝗠𝗜𝗧, 𝗢𝗙𝗙𝗦𝗘𝗧, 𝗮𝗻𝗱 𝗗𝗜𝗦𝗧𝗜𝗡𝗖𝗧 𝗳𝗼𝗿 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻 𝘁𝗲𝗰𝗵𝗻𝗶𝗾𝘂𝗲𝘀
It's easy to assume that these would boost performance by minimizing the data set, but this isn’t the case. Because they occur at the end of the query, they make little to no impact on its performance.
If you want to create efficient queries, it's a good idea to understand how things work under the hood otherwise your efforts may be wasted. While these tips work best in most cases, you should consider your unique use case when choosing the best course of action.
~~~
A big thank you to our partner Postman who keeps our content free to the community.
You can now test API performance by simulating real-world traffic on your local machine with Postman. Check it out: drp.li/postman-api-performan…
📩 If you found this helpful, I write an email every Thursday to help you level up your engineering and system design skills. Sign up here: drp.li/luc-newsletter-z8lk
Tori retweeted
🚨 Breaking news:
Google just launched LUMIERE, and it's crazy.
This is going to transform the future of VIDEO forever
Here are 5 stunning examples you can't miss out on: 🧵
Tori retweeted
𝗪𝗵𝗮𝘁 𝗶𝘀 𝘁𝗵𝗲 𝗗𝗶𝗳𝗳𝗲𝗿𝗲𝗻𝗰𝗲 𝗕𝗲𝘁𝘄𝗲𝗲𝗻 𝗜𝗻𝗻𝗲𝗿, 𝗟𝗲𝗳𝘁, 𝗥𝗶𝗴𝗵𝘁, 𝗮𝗻𝗱 𝗙𝘂𝗹𝗹 𝗷𝗼𝗶𝗻?
🔹 (𝗜𝗡𝗡𝗘𝗥) 𝗝𝗢𝗜𝗡: return all rows with matching values in both tables.
🔹 𝗟𝗘𝗙𝗧 (𝗢𝗨𝗧𝗘𝗥) 𝗝𝗢𝗜𝗡: return all rows from the left table and those that meet the condition from the right table.
🔹 𝗥𝗜𝗚𝗛𝗧 (𝗢𝗨𝗧𝗘𝗥) 𝗝𝗢𝗜𝗡: return all rows from the right table and those that meet the condition from the left table.
🔹 𝗙𝗨𝗟𝗟 (𝗢𝗨𝗧𝗘𝗥) 𝗝𝗢𝗜𝗡: return all rows which either have a match in either table.
The diagram below illustrates how different types of joins work in the form of checkered flag diagrams. (Credits: Hadley Wickham & Garrett Grolemund in their book "R for Data Science," prepared as a cheatsheet by Andreas Martinson).
#sql
Tori retweeted
Programmer's life
Year 1:
"Oh crap, there is so much to learn"
Year 10:
"Oh crap, there is still so much to learn"
Year 20:
"Oh crap, I forgot half the stuff and there is still so much to learn"






























