Powerful Web Development Tips and Tricks

Last modified date

We learn a lot of new things every day. Here I add some of the tips and tricks that I myself use on a regular basis.


Edit your last commit:

Use git commit --amend to edit your last comment. It opens your last commit in a text editor in the console itself. You can edit the comment and save.


1. How to use autocomplete in a terminal?

Your terminal already have an autocomplete feature. You can get autocomplete suggestions for commands, folder/file names. etc.

Start typing initial characters for your command and then press tab, If there are multiple options available, your terminal will give you multiple options to choose from. Or if there is only one option it will be chosen as default command.

If you press tab on an empty terminal, it will give you list of all the commands that you can run.

2. Quick way to go the previous directory

Use cd -

This takes you to the previous directory you were in.


Replace all occurrences of a string

After learning how to replace all occurrences of a forward slash in javascript, I tried the same logic on simple strings. And I have found a better way to do that.

const str = 'let me find a and replace a with b' str1.replace(/a/g, 'b')
// "let me find b bnd replbce b with b"

Hey there, my name is Rajesh, and I'm a Javascript developer ( currently working with Vue and Nuxt) working full time at a job I love. I have been a full-stack developer for several years and have worked on complex backend and database stuff in the past. I am now more focused on the frontend, UI/UX and web accessibility. I am very new to writing content, but I want to write more so I can help students and budding developers start their dream careers.