Or how Static Code Analysis Tools make your life and prevent headaches

Welcome to issue #16 of One Minute Better Developer, where you become a more successful software developer by reading short nuggets of knowledge, one minute at a time.

⏮️ 🔛 ⏭️

Art by my buddy Loor Nicolas

THE PROBLEM

Take a moment to look at this snippet and try to figure out what it does.

Don’t scroll to the solution yet!

Really try to figure out the result, It’s not as easy as it seems…

What will be logged in line 4?

.

.

.

.

Don’t scroll anymore until you know the solution!

.

.

.

.

.

.

OK, ready?

.

.

.

.

Now, I bet you thought…


Let’s learn to use the power of this advanced tool for Git disaster‑saving

Welcome to issue #23 of One Minute To Become a Better Developer, where you become a more successful software developer by reading short nuggets of knowledge, one minute at a time.

⏮️ 🔛

Art by my buddy Loor Nicolas

THE PROBLEM

A local branch deleted by accident, squashed commits that we would like to be un-squashed… when a catastrophe occurs, wouldn’t it be great if we could time-travel in Git?

A SOLUTION

Let’s learn how to use git reflog. First, a bit of context.

Reference logs, or “reflogs”, record when the tips of branches and other references were updated in the local repository.

git reflog by default targets HEAD — a symbolic…


Photo by AltumCode on Unsplash

Let’s build a touch-triggered image slider with lazy loading, navigation, and pagination, in one minute.

Welcome to issue #3 One Minute, One NPM Package, where you discover cool NPM packages and how to use them in one minute.

⏮️ 🔛


Index to the OMBD series, where you become a more successful software developer by reading short nuggets of knowledge, one minute at a time.

See my other series


CODEX

A quick guide (with examples) on applying CSS to log messages in the browser’s console.

Welcome to issue #22 of One Minute Better Developer, where you become a more successful software developer by reading short nuggets of knowledge, one minute at a time.

⏮️ 🔛 ⏭️

Art by my buddy Loor Nicolas

THE PROBLEM

Our console messages don’t grab users’ attention.


Spot errors before pushing to save time while reviewing your own pull requests

Welcome to issue #21 of One Minute Better Developer, where you become a more successful software developer by reading short nuggets of knowledge, one minute at a time.

⏮️ 🔛 ⏭️

Art by my buddy Loor Nicolas

THE PROBLEM

You spend a lot of time reviewing your own pull request on Github before asking for a review and you always find stuff that needs to be changed. So you need to add/edit commits, losing lots of time.

A SOLUTION

Before committing, make good use of git diff, so you avoid having to change code later.

Here are some not-so-known git tips, sorted from more common to more uncommon:

Changes on staged or unstaged files

  1. Show all unstaged changes since…


CODEX

A quick introduction to a library that has better browser support than the loading=”lazy” attribute.

Welcome to issue #1 One Minute, One NPM Package, where you discover cool NPM packages and how to use them in one minute.

⏮️ 🔛

What we will build

THE PROBLEM

The images on our website load all at the same time, including the ones that are not in view, blocking other assets to be downloaded.

This makes our website take longer to load, and has a bad effect on our UX.

A SOLUTION

We are going to use a nice little package called LazySizes to make images load only when they are scrolled into view.

To do that we only need to:

  1. Replace the src attribute on images with…


Save refactor time with one character — Regular expressions on JavaScript or any other language made easier

Welcome to issue #19 of One Minute Better Developer, where you become a more successful software developer by reading short nuggets of knowledge, one minute at a time.

⏮️ 🔛 ⏭️

THE PROBLEM

We have a block of HTML code, including a set of images.

All of them have an alt tag, but we want to add a full stop to every tag, to make screen readers pause for a bit when reading the tag.

Jon Portella

Full-Stack Developer, Teacher, Maker, and general Things-Doer. https://www.linkedin.com/in/jonportella/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store