Code embed component in React / Next?

  So one of my colleagues came to me with this requirement. He wanted to create a code embed component in the React (NextJS) app that he was working on. Initially, he had used the dangerouslySetInnerHTML  attribute to set the inner HTML to the embed code (unsanitized!!)....

Exit Shell script with error if any command fails

   I wrote a Bash script today to automate my code review process and I noticed that even when certain commands in the workflow fail, the script still executes the remaining commands. For example, let's say I have two commands that run synchronously: git...

Mac OS List directory in tree view using find command.

In mac (also in a Linux systems) you will have to install an additonal package called `tree` to display the content of folder in a tree view.    But what if you are like me; someone who doesn't like to install additional packages just for a simple task? Well,...

Clear scroll back buffer in zsh

In bash you can use ctrl + L to clear the scroll back in the terminal. However in zsh, it doesn't work. So here is a workaround. You can use a control sequence to clear it, and set an alias for that.  Open your  .zshrc file in the editor.$ vim ~/.zshrc And add this...