Articles

Setting up Visual Studio Code for Web Development — For Beginners and Intermediate Developers

Published on:

The coding environment is one of the most important things for a developer.

If you set up your coding environment with the right Linters and Formatters, coding will be very simple. If you don't, coding will be a nightmare. Why? Because linters and formatters help you catch many errors and speed up the development process (and also, remove a lot of headache you will face from your constant typos)!

Now you know the importance of the environment, the next step is to configure this environment such that it works for you. This is a difficult task because there are so many options available today.

The good news is: You don't have to do any of that difficult work because I've narrowed down the best configuration possible (in my opinion) for you.

I'm going to tell you what the configuration is and how to set it up.

Never let anyone stop you from pursuing your dreams

Published on:

Whatever you yearn to be — be it a developer, a writer, a designer or anything else in the world — never let anyone stop you from pursuing your dreams.

Your dream is something precious to you. It directs the way you want to manifest in this lifetime. And you will continue to want to manifest your dreams even if the whole world is against you.

Understanding the color-scheme property

Published on:

You would have heard of the CSS color-scheme property if you are interested in adding a dark theme to your website. Here's what it looks like:

:root {
  color-scheme: light dark;
}

Using npm packages in the frontend without any bundlers

Published on: , Updated on:

It's possible to use npm packages on your frontend without any bundlers today.

This is amazing because we don't need to create complicated workflows to reuse code — we can simply retrieve the library from npm. This makes our projects simpler, more straightforward, and more welcoming for newcomers in our industry!

In this article I'm going to show you two ways to include npm packages without any bundlers. They are:

  1. Import the library from a CDN
  2. Serve up your node_modules folder

Understanding CSRF Attacks

Published on:

I researched web security recently as I was writing Understanding Asynchronous JavaScript — I wanted to make sure my recommendations were secure and that I'm not doing any of my students a disservice with my recommendations.

Unfortunately, articles in the security space were pretty hard to understand. Many words trigger lots of fear, uncertainty, and doubt in the articles. I get emotionally panicky when I read these articles — and I worry I may end up doing something wrong — even though the intention of these articles was good!

Many articles also don't disclose full details CSRF, how to set up a CSRF Attack, and how to prevent a CSRF Attack, which leaves me doubtful about what I learned. I end up having to figure things out on my own.

I want to make it easier for you to understand CSRF, so I took a stab at writing an article with complete (and step-by-step) information about CSRF Attacks. I hope this article gives you the clarity and confidence you need to build secure web applications.

How to find a tag id in Convertkit

Published on:

Finding a tag ID in convertkit is simple. You don't need to use the API. Using the API is a roundabout way if you want to find a specific tag ID.

Here are the steps:

  1. Click the tag in Convertkit
  2. Look at the URL.
  3. Find the subscribable_ids parameter

Here's an example:

https://app.convertkit.com/subscribers?subscribable_ids=3061839&subscribable_type=tag

In this case, the tag ID is 3061839.

A library to make localStorage easier to use

Published on:

One of the problems with localStorage is it takes in only string values. If you want to save an object, you have to convert it into JSON with JSON.stringify.

When you retrieve objects from localStorage, you need to convert the JSON value back into JavaScript with JSON.parse

New CSS Color syntax — rgb instead of rgba

Published on:

If you want to support transparency in a CSS rgb or hsl function, there's no need to write rgba or hsla anymore. You can simply write rgb or hsl with a / to indicate the alpha.

No need for commas too!

Don't be ashamed of tutorial hell

Published on:

Many people are trapped in tutorial hell — they hop from one tutorial to another, to another, to another, never building something on their own. And they're ashamed of it.

Don't be ashamed of tutorial hell.

Getting a cookie's expiry value on a server

Published on:

Browsers handle cookie expiry so they don't pass the cookie's expiry value to the server. You have to make some adjustments if you want to get the cookie's expiry value on the server.

There are two methods:

  • You can create a cookie with a JSON value
  • You can use another cookie to signify the expiry

Rsync with a custom port

Published on:

You can rsync with a different port by adding -e "ssh --port" into the rsync command.

Why I stopped using Operator Mono

Published on:

I bought Operator Mono two years ago. If you don’t know, Operator Mono is this fancy code font that was in the rage back then.

It’s nice. It has a unique serif feel to it. And it has real italics on a code font. Real italics

It’s pricey too — it costs $200. It took me a long time to contemplate and I finally bought it.

<Image src="/assets/2022/operator-mono/operator_ide2.png" alt="Operator mono used for some code." loading="lazy" />

Fast forward two years, I decided to stop using Operator Mono and switch back to a free font.

Using async/await in Express

Published on:

Have you noticed you write a lot of asynchronous code in Express request handlers? This is normal because you need to communicate with the database, the file system, and other APIs.

When you have so much asynchronous code, it helps to use async/await. It makes your code easier to understand.

Today, I want to share how to use async/await in an Express request handler.

Serving HTTPS locally with Node

Published on:

You won't need to serve up HTTPS when developing locally because localhost is treated like a secure context.

But you need to use a HTTPS scheme even on localhost in some cases — like when you're trying to work with Facebook's API.

We're going to talk about how to serve up a HTTPS website on localhost. It's quite simple. Really.

Get good at the hiring game

Published on:

You may be frustrated with how the industry uses "wrong" practices to filter out candidates — most companies focus on data structure, algorithm and the Big O notation as interview questions when hiring.

It's wrong! Why? Because it's not like developers deal with data structures and algorithm everyday, right? Shouldn't they focus on letting someone show their project and explain their logic?! Why do they use leet code or give you a data structure for you to solve and explain when you don't care about them?

Year end review — 2021

Published on:

Hello! It's a tradition for me to write a review for the year. I'm going to do it again this year even though I haven't been blogging for a couple of months.

Many things happened last year so it's easier for me to split this review up into 4 sections:

  • Work
  • Non Work
  • What I learned
  • What's for 2022

Dealing with anxiety during job interviews

Published on:

It's normal to feel anxious when applying for a job. After all, you're trying to present your best self in hopes of getting the job. Today's article will help you learn to control or work with this anxiousness.

I propose four ways to work through your anxiousness

  • Be pessimistic about the interview
  • Don't care about the results
  • Face the anxiousness head-on and work through it
  • Bring your real self instead of your best self