NEVER use
🚫 "git reset --hard".
If you want to clean out your modifications, ALWAYS use
✅️ "git stash -u"
I've been saying this for over a decade. It sucks to see people suffer. Git reset is the only common command that does not have the usual git safety net of the reflog.
Didn't need JavaScript for this one 🤙
The 3D exploded view is powered by CSS :has() && custom properties 😎
:root:has(#explode:checked) { --explode: 1; }
.slides {
scale: calc(1 - (var(--explode) * 0.55));
transform: rotateX(calc(var(--explode) * -24deg))...;
}
Use scope ⭐️
Most APIs on the web that take an object, immediately access all the keys they're interested in, then discard the object.
One weird exception is addEventListener:
What if I told you this demo right here is powered by nothing but HTML and CSS?
Yep that’s right, not a single line of JavaScript (*) in sight! 🤩
Demo on @CodePen: https://t.co/WRiCSNlyhe
(*) Except for a polyfill that’s being loaded
🎥 This episode's a long one, but you'll come out the other side knowing how pinch-zoom, scrolling, browser UI, and software keyboards change layout & viewports.
⬇️ Here's @bramus with the details ⬇️
https://t.co/FOwHydmkX0
I loooove signals in SolidJS. It's like hooks done right.
And now preact has them, where i can use all my deeper understanding of preact. Amazing!
FYI: This library even works with React (now the name finally makes sense lol)
Introducing Nuxt Icon, a simple <Icon> component that let you use:
· Any icon from Iconify
· A Custom Vue component
· An emoji
https://t.co/ZgN9VjAjY2
Lil JavaScript Tip 🤏
Use Object.assign to create new elements in vanilla JavaScript land 🧱
const EL = Object.assign(
document.createElement('button'),
{
className: 'fab',
}
)
You may find this visually easier to comprehend and contain things 😎