Posts in category “Tips”

Outputing human friendly JSON string with JSON.stringify

method 1:

JSON.stringify(obj, null, '\t');

This "pretty-prints" your JSON string, using a tab for indentation.

method 2:

If you prefer to use spaces instead of tabs, you could also use a number for the number of spaces you'd like :

JSON.stringify(obj, null, 2);

Reference

Rider tips: Don't add bom when creating utf-8 files!

BOM is annoying. Especially when I am creating a SQL script file.

Default ASP.NET Core port changed from 80 to 8080 in .NET8 => API project deployment / health check failure

This change has wasted my DevOps Colleague a lot of time. I hope this information could help more people.

How to change package name in flutter? (it is not easy!)

IMHO, using a tool should be the solution.

How to: move the cursor to the first non-whitespace (non-blank) character on the current line in Vim

  1. use:^ (shift + 6)

This moves the cursor to the first non-blank character of the current line.

  1. _ (underscore)

This also moves the cursor to the first non-blank character on the same line the cursor is on.

By the way, the 0 command moves to the absolute start of the line, including any leading whitespace.