Need to run background jobs? Not writing Ruby On Rails and therefore not using Sidekiq
?
Check out trigger.dev
I can probably use this somewhere in the future but TBD 🤔!
We tried to use some CSS variables we defined inside of the :root
with our tailwind config and even though
tailwind let’s you do that, the outputted CSS isn’t actually valid 🤯! The media query declarations
are processed while our CSS is being parsed!
:root {
--mobile-breakpoint: 600px;
--tablet-breakpoint: 900px;
}
/* This gets processed before the CSS is parsed */
/* So the media query is invalid */
@media(max-width: var(--mobile-breakpoint)) {
.showMeGoing {
visibility: visible;
}
}
TIL that you can inject other non SVG XML into an SVG document. From our context, that means we can inject some HTML elements in the SVG. I’ve used it once at work and it was kind of nice 😃.
Read MoreTo gamble on yourself is to risk failure. To do it in public is to risk humiliation.
Our fear, like a self-indicating arrow, points to the things we ought to do.
Want to have some type hinting for a union but allow any string value?!
Use this hack bruh:
type color = 'red' | 'blue' | 'green' | (string & {})
function getColor(c: color) {
console.log(c)
}
getColor('red') // editor will code complete this for you
getColor('yolo') // this works!
Alright, I’m not the greatest at CSS, but I respect those people, such as Josh Comeau
that are! TIL (from reading his blog post)
the following about some CSS attributes and how they relate to grid:
justify
: deals with columnsalign
: deals with rowscontent
: deals with the grid strutureitems
: deals with the DOM nodes within the grid structureFor example, align-items: center
can loosely be translated into: In the context of the row, these DOM nodes, center them... bro
.
Seriously, go read his article.
It’s easy to judge. It’s hard to know. Until we know the reasons why a man acted the way he acted, we cannot say that he acted wrongly.
Waste not a moment questioning a man’s courage. Put the scrutiny solely on your own.
It’s okay to be scared, but, be not afraid. Being scared is a reaction to an event; it’s an ephemeral feeling. Be scared when something pops out of a haunted house, but, be not afraid of ghosts. Be scared when you are about to go give a presentation but be not afraid of speaking your mind.
It’s okay — being scared alerts you, wakes you up, and brings danger to your awareness. Being afraid though? This is a state of being. It weakens you, drags you down, and sometimes, paralyzes you.
Be not afraid.
Turns out you can not only transform JS into an AST, but even SQL statements! Pretty nifty.
Read MoreSee things for what they are. Do what you can. Endure and bear what you must.
If you’re ever having issues with neovim, it might help to clear out the cache. I recently was running into issues after switching from
packer
for my dependency management to lazy
and there was a sneaky little devil 😈 in the cache directory causing issues.
You can view the cache directory here: $HOME/.cache/nvim/
.
While working on my todo
app, written in go, htmx, and lit
, I forced myself to get a better idea of how
OAuth worked! I’ve used it before, but I never really understood the flow.
This youtube video really does a good job summarizing exactly what’s going on ❤️ !
Not gonna lie, I’ll probably never need to reach for this tool 😂, but I heard about it while watching
a video on Youtube and thought it was cool. react-reverse-portal
allows you to render a react node
and then take it out of the dom entirely and return it later, without having to unmount the component.
It’s pretty neat!
TIL about serve
by vercel. It lets you serve your SPA/static files, incredibly easily! We may or may not be using it at work
for some of our SPAs 😉.
TIL that golang allows for empty switch statements in the condition block. This is not possible in JavaScript! The reasoning behind this is that the switch statement in golang is not limited to only comparing values. Below you can see two versions of branching logic — one with the switch and one with else ifs 😊.
package main
import "fmt"
func main() {
i := 10
switch {
case i < 0:
fmt.Println("Negative number")
case i == 0:
fmt.Println("Zero")
case i > 0:
fmt.Println("Positive number")
}
}
package main
import "fmt"
func main() {
i := 10
if i < 0 {
fmt.Println("Negative number")
} else if i == 0 {
fmt.Println("Zero")
} else if i > 0 {
fmt.Println("Positive number")
}
}
TIL about Perplexity AI! It’s pretty slick and useful for web development and research 😊.