This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#According to Apple, | |
#zsh (Z shell) is the default shell for all newly created user accounts, starting with macOS Catalina. | |
#Run the command 'echo $SHELL' to find your default shell. | |
#If result is '/bin/bash', then bash is the default shell else if result is '/bin/zsh', then it's zsh | |
#Copy the code mentioned below, | |
#in '~/.bashrc' if bash is your default shell | |
#in '~/.zshrc' if zsh is your default shell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Search and replace across multiple lines : | |
:%s/<SearchString>/<ReplaceString>/g | |
Eg: :%s/Vijay/Thalapathy/g | |
* Delete multiple lines based on SearchString : | |
:g/<SearchString>/d | |
Eg: :g/^Garbage.*$/d | |
* Delete multiple lines based on range : | |
:<StartRange>,<EndRange>d | |
Eg: :1,13d | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Rename your local branch. | |
If you are on the branch you want to rename: | |
git branch -m new-name | |
If you are on a different branch: | |
git branch -m old-name new-name | |
2. Delete the old-name remote branch and push the new-name local branch. | |
git push origin :old-name new-name | |
3. Reset the upstream branch for the new-name local branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Show all tables under a schema | |
SELECT table_name FROM information_schema.tables WHERE table_schema = '%SchemaName%'; | |
2. Describe table information | |
SELECT | |
a.attname AS "Column Name", | |
format_type(a.atttypid, a.atttypmod) AS "Data Type", | |
CASE | |
WHEN a.attnotnull THEN 'YES' |