Skip to content

Instantly share code, notes, and snippets.

View Nayteruz's full-sized avatar

Aleksandr Nayteruz

  • Russia/Barnaul
View GitHub Profile
# Шпаргалка по консольным командам Git
## Общее
Git — система контроля версий (файлов). Что-то вроде возможности сохраняться в компьютерных играх (в Git эквивалент игрового сохранения — коммит).
Любой файл в папке существующего репозитория может находиться или не находиться под версионным контролем (отслеживаемые и неотслеживаемые).
Неотслеживаемые файлы можно в любой момент сделать отслеживаемыми и наоборот.
@Nayteruz
Nayteruz / gist:045518f5b965e22287ccf2a6128ccd2c
Created January 24, 2023 08:34
Шпаргалка по js
Типы данных в JS
string
number
bigint большие числа
boolen
symbol
object
null
undefined
@Nayteruz
Nayteruz / publish-ghpages.md
Created August 2, 2022 19:22 — 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
@Nayteruz
Nayteruz / gh-pages-deploy.md
Created April 17, 2022 16:07 — 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).

@Nayteruz
Nayteruz / Fetch request
Last active January 6, 2022 19:49
Пример правильной функции запроса
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])
@Nayteruz
Nayteruz / getTimeCustomString
Last active August 6, 2021 07:20
Date string constructor
function getTimeCustom(date, opt=[], delimeterD = '-', delimeterH = ':', delimeterBetween = ' '){
if(!date && !date && opt.length == 0){
return null;
}
let d = new Date(date);
let s = '';
@Nayteruz
Nayteruz / README.md
Created October 31, 2020 05:18 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@Nayteruz
Nayteruz / tabs
Created August 29, 2020 12:52
табы
<script>
$(function() {
var texts = $('.pi-body-wrap>div'),
tabs = $('.tabs-nav a').click(function() {
var $this = $(this),
index = $this.parent().index();
$this.toggleClass('active');