A blog focused on programming, debugging, and refactoring real-world code

// Dev notes

function deploySafely()

if (isFriday()) {

console.warn(“Do not touch production.”);

return;

}

deploy();

}

Dev notes

Code is like a joke. If you have to explain it, it’s bad.


Practical code

Quick coding tips

Level Up Your Arrays with .map()

You can use .map() to instantly transform every item in an array into something new — without mutating the original one.

const labels = numbers.map(n => `Item: ${n}`);

.map() always returns a new array, making transformations clean and predictable.

Recovering a Deleted Git Branch

Did you know you can recover a deleted Git branch?

If you accidentally deleted a local branch, you can bring it back!

git reflog

Find the commit hash where your branch last pointed, then run:

git checkout -b <branch-name> <commit-hash>

Tip: git reflog keeps a record of all recent branch movements – even deleted ones!

GIT: See who changed a specific line

Want to know who last modified a line in a file?

git blame <file>

Perfect for tracking down when and why a change was made.

Blog

Latest posts

Category

JavaScript

Category

Front-end Developer Tools

Category

Linux

Category

CSS