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
| # list all avds | |
| emulator -list-avds | |
| emulator -avd Pixel_6_API_35 | |
| # Settings DNS server for emulator | |
| emulator -avd Pixel_5_API_31 -dns-server 8.8.8.8 | |
| # Lock and Unlock | |
| SLEEP = adb shell input keyevent 223 |
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
| curl ifconfig.me |
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
| USING NVM | |
| nvm install <version) | |
| - e.g nvm install 16 | |
| nvm list | |
| - list all node versions | |
| nvm use <verison> |
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
| npm ls -all | |
| - to see all the dependencies of the project | |
| npm ls <package-name> | |
| - to see the dependencies of a specific package | |
| npx depcheck | |
| - to see which dependencies are not used in the project |
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
| // useCallback and useMemo are used to memoize functions and values respectively. | |
| const onClick = useCallback(() => { | |
| }, []); | |
| <div onClick={onClick} /> |
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
| // memo in react is just render if props have changed, its not the traditional memoization | |
| // use only when computation is expensive | |
| // ************** Good **************** | |
| const value = useMemo(() => numbers.reduce((a, b) => a + b, 0), [numbers]); | |
| // ^ this is ok , because we are using useMemo to calculate a value based on an array of numbers |
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
| /* | |
| * ββββββββββββ Table of contents ββββββββββββ | |
| * | |
| * @1 - Get Props of element | |
| * @2 - Get Props of component | |
| * @3 - Strong typing of props | |
| * @4 - Props for a generic component | |
| * ββββββββββββ Table of contents ββββββββββββ | |
| */ |
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
| // Javascrip/Typescript note | |
| /* | |
| * ββββββββββββ Table of contents ββββββββββββ | |
| * | |
| * @1.0 - Sample1 | |
| * @2.0 - Sample2 | |
| * @3.0 - Sample3 | |
| * @4.0 - Sample4 |
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
| /* | |
| * | |
| * ββββββββββββ Table of contents ββββββββββββ | |
| * | |
| * @1.0 - Invoking Component Functions Directly | |
| * @2.0 - Rule of hooks | |
| * @3.0 - Conditional Rendering | |
| * ββββββββββββ Table of contents ββββββββββββ | |
| */ |
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
| iOS Simulator: | |
| - Cmd β + D (or Device > Shake) | |
| Android emulators: | |
| - Cmd β + M (macOS) or Ctrl + M (Windows and Linux) | |
| - adb shell input keyevent 82 |