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
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
| # Шпаргалка по консольным командам Git | |
| ## Общее | |
| Git — система контроля версий (файлов). Что-то вроде возможности сохраняться в компьютерных играх (в Git эквивалент игрового сохранения — коммит). | |
| Любой файл в папке существующего репозитория может находиться или не находиться под версионным контролем (отслеживаемые и неотслеживаемые). | |
| Неотслеживаемые файлы можно в любой момент сделать отслеживаемыми и наоборот. |
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
| Типы данных в JS | |
| string | |
| number | |
| bigint большие числа | |
| boolen | |
| symbol | |
| object | |
| null | |
| undefined |
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
| async function request(url, method = 'GET', data = null){ | |
| try { | |
| const headers = {}; | |
| let body; | |
| if(data){ | |
| headers['Content-Type'] = 'application/json'; | |
| let formData = new FormData(); | |
| for(let d of data.entries()){ | |
| formData.append(d[0], d[1]) |
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 getTimeCustom(date, opt=[], delimeterD = '-', delimeterH = ':', delimeterBetween = ' '){ | |
| if(!date && !date && opt.length == 0){ | |
| return null; | |
| } | |
| let d = new Date(date); | |
| let s = ''; | |
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
| <script> | |
| $(function() { | |
| var texts = $('.pi-body-wrap>div'), | |
| tabs = $('.tabs-nav a').click(function() { | |
| var $this = $(this), | |
| index = $this.parent().index(); | |
| $this.toggleClass('active'); | |