Articles

How and when to use Async and Defer attributes

Both async and defer attributes look like they do the same thing at first glance, but there are nuances to async and defer. Most of the time, you’d want to use defer instead of async, even though async sounds sexier.

But why?

I’d like to walk you through the differences and why you should use them (and also why you don’t have to use them).

Trying Your Best is really bad advice (and strategy)

For a while I’ve been telling myself that it’s okay as long as I tried my best. It’s been a decent strategy for a long time, but it’s not working for me anymore.

I want to explain why it doesn’t work and what pitfalls you might want to watch out for if you use the same strategy in your life.

Rapid Mac Setup for Frontend Development

My Macbook broke down after using it for a year — the logic board got fried. I got this Mac repaired and it broke down a month later. The logic board got fried again 🤦‍♂️.

Long story short, Apple agreed to repair the Mac again for free. They also agreed to send me a new Macbook as a replacement since my current one gave me so many problems.

In the meantime, I’ve gotten pretty good at setting up my Mac and I’d like to share how I do this with you.

Using Gulp with Dart Sass

I’m playing around with Sass again recently and I noticed newer features (like @use and @forward) are only available on Dart Sass. Upon further inspection, I noticed that LibSass is now deprecated.

This article aims to help you get started with Dart Sass if you’re using Gulp.

Prettier and Standard in VSCode

Prettier is an opinionated tool that helps you format code. I love Prettier, but I don’t like its opinions with JavaScript. I prefer using Standard for JavaScript because it doesn’t have semicolons (which makes the code cleaner to read).

It used to be complicated to use Prettier and Standard together. We had to disable Prettier for specific languages. Thankfully, there’s a simpler way now.

Disabling languages for Prettier (in VScode)

It used to be straightforward to disable languages for Prettier in VSCode. You just added a prettier.disableLanguages setting and you were done.

// In settings.json
[
"prettier.disableLanguages": [
"javascript",
"javascriptreact",
"json",
"markdown"
],
]

Unfortunately, prettier.disableLanguages is deprecated so we can’t do this anymore. Here’s what we can do instead.

How to remember JavaScript

JavaScript contains many things — lots of different methods and ways to do things. How do you remember them all?

If you ask around the web, many people will say you don’t have to remember everything since you can always google. But this answer doesn’t help — you can’t always Google everything, every time. If you forget absolutely everything and Google everything all the time, you’re going to be real slow when you code!

So what’s the alternative? What must you remember? What can you forget? That’s what this article is for.

How to debug a Github Actions’ secret

One irritating thing about Github Actions is you can’t debug secrets. If you try to debug secrets you’ll get *** in the log.

run echo

This makes sense because Github is trying to help us keep the secret secret (ha!). But it doesn’t help when we’re trying to figure out whether there’s something wrong with the secret we provided.

Hold on while i sign you up…

🤗
Woohoo! You’re in!
Now, hold on while I redirect you.