How to disable suggestion pop up while typing in VS Code

1. Open Settings.

Screen Shot 2019-07-12 at 8.44.01 AM.png

2. Search for “settings”.

Click “Edit in settings.json”

 

Screen Shot 2019-07-12 at 8.44.43 AM

3. Add these lines and save the file.

“editor.parameterHints.enabled”: false,
// Controls if quick suggestions should show up while typing
“editor.quickSuggestions”: {
    “other”: false,
    “comments”: false,
    “strings”: false
 }

Screen Shot 2019-07-12 at 8.45.13 AM.png

How to zip a folder excluding hidden files on Mac from the command line

  1. Open terminal.
  2. Browse to one folder above the folder you want to zip.
  3. Type the following command, replace <zipfile_name> and <folder_name> with your required names.
zip -r <zipfile_name> <folder_name> -x "*/\.*"

4. Press enter

The Road to Learn React

Today I have completed the book The Road to Learn React by Robin Wieruch. I highly recommend this book to absolute beginners. It is concise and very well explained. It will give you solid foundation knowledge of React.

Screen Shot 2019-02-02 at 3.09.12 PM.png

Aging

The beautiful chariots of kings wear out,
This body too undergoes decay.
မင္းစီးရထား လြန္ဆန္းျပား အိုသြားၾကေလသည္
ခႏၶာကိုယ္လည္း နည္းတူပဲ မလြဲအိုရမည္

Reorder list in React Redux App

I don’t know if this is a recommended pattern but I did as follows:

  1. User clicks Edit icon.
  2. Change the list to edit mode.
  3. User drag & drop an item.
  4. Make a whole new array with updated seq no’s.
  5. Update the Redux store.
  6. User clicks Done icon.
  7. Update the whole list on the database via REST API with Axios PUT request.
  8. MongoDB update() command is used so it’s faster than findOneAndUpdate() but no data is returned.

Setting the Preferred Domain in Google Search Console

Recently, I have been reading a WordPress SEO tutorial from Yoast. In one section, it says I should set the preferred URL for my site in Google Search Console. When I set according to the instructions, I got a warning message, which said

 “Part of the process of setting a preferred domain is to verify that you own https://www.ltcclock.com/. Please verify https://www.ltcclock.com/.”

I googled and found a discussion on Google forum. So, I added a new property in Search Console for www version and tried to set the preferred URL again. But I kept getting the error message.

My website is redirecting www to non-www URL. I checked .htaccess file to see this redirection rule but couldn’t find any. I was wondering what was doing this redirection. I also checked my site’s plugins to see if they were doing the redirection but didn’t see any.

Finally, I contacted my web host and they said this redirection was by default for all websites. They also gave me two URLs which show how to redirect from www to non-www and vice versa.

Next, I added redirection code (non-www to www) to .htaccess file and tried to access my site. It wasn’t working. I tried both www and non-www but no luck.

Screen Shot 2018-09-11 at 12.17.37 PM.png

I rolled back to previous htaccess file.

After that, I tried to set the preferred URL again in Google Search Console. This time, I notice that the warning message to verify my domain is showing http instead of https. I read somewhere that I need to verify all http, https, www, non-www versions of my site. So, I added more properties and verify them. It worked! I didn’t need to upload new HTML file again to verify, I just added a new property, clicked the not robot checking, and clicked Verify button.