Skip to content

Instantly share code, notes, and snippets.

View saloev's full-sized avatar
🎯
Focusing

Салоев Сади saloev

🎯
Focusing
View GitHub Profile
@saloev
saloev / publish-ghpages.md
Created February 29, 2020 16:57 — forked from tduarte/publish-ghpages.md
If you need to force push an subtree
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
@saloev
saloev / gh-pages-deploy.md
Created November 4, 2019 08:56 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

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.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@saloev
saloev / testing.js
Last active November 3, 2018 16:02
Testing function
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('');
@saloev
saloev / sumUpDiagonals.js
Last active October 30, 2018 18:25
Разработайте функцию sumUpDiagonals()
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;