src
|__ assets
| |__ images
| |__ styles (global styles)
|
|__ components (shared components)
|
|__ features
|__ Photo
This file contains 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
<?php register_nav_menus( [ 'primary' => __( 'Primary Menu' ) ] ); ?> |
This file contains 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
let arr1 = ["it's Sunny in", "", "California"]; | |
arr1.map(x => x.split(" ")); | |
// [["it's","Sunny","in"],[""],["California"]] | |
arr1.flatMap(x => x.split(" ")); | |
// ["it's","Sunny","in", "", "California"] |
This file contains 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
# use $(pwd) instead of $PWD because $PWD is just a variable for display purpose | |
# not actually change (cd) current working directory | |
~/dev/MyRepo$ PWD=~/dev/ | |
~/dev$ | |
~/dev$ $PWD | |
bash: /home/Nashu/dev/: Is a directory | |
~/dev$ pwd |
This file contains 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
Show the last N commits from a certain author: | |
$ git log -n number --author=author | |
For example: | |
# (changes in latest commit) | |
$ git log --stat -n 1 | |
# git-whatchanged show little more detail of all changes happened | |
$ git whatchanged |
This file contains 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
$ git reset --merge | |
https://stackoverflow.com/a/60444590 |
This file contains 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
componentDidMount() { | |
} | |
componentDidUpdate() { | |
} | |
componentWillUnmount() { |
This file contains 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 catch in promise-based | |
await step1().catch(fun); | |
async function gettingBetter() { | |
const a = await step1().catch(err => handle(err)); | |
const b = await step2().catch(err => handle(err)); | |
const c = await step3().catch(err => handle(err)); | |
} | |
// #2 create a function handle try catch => [data, error] | |
async function awesome() { |
This file contains 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
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "es6", | |
"target": "es6", | |
"baseUrl": "src", | |
"moduleResolution": "node" | |
}, | |
"include": ["src/**/*"] | |
} |
This file contains 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
const LEN = 1000; | |
// First choice | |
[...Array(12).keys()] | |
// Another choice | |
Array.from({length: LEN}) | |
Array.from(Array(LEN)) | |
OlderNewer