git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).
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
| function isEven(number) { | |
| // Returns True if **number** is even or False if it is odd. | |
| return number % 2; | |
| } | |
| const test = (testName) => | |
| (actual, expected) => { | |
| if (actual === expected) { | |
| console.log(`PASSED [${testName}]`); | |
| console.log(''); |
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
| const isCorrectMatrix = (matrix) => { | |
| if (!Array.isArray(matrix)) return false; | |
| const isNotArray = matrix.some(elem => !Array.isArray(elem)); | |
| if (isNotArray) return false; | |
| const isContainEmptyArray = matrix.some(arr => arr.length === 0); | |
| if (isContainEmptyArray) return false; | |
| const rowLength = matrix[0].length; |