Skip to content

Instantly share code, notes, and snippets.

View neyasbltb88's full-sized avatar
🥉
Javascript developer

Denis Mashkov neyasbltb88

🥉
Javascript developer
View GitHub Profile
@neyasbltb88
neyasbltb88 / git-submodules.md
Created July 4, 2022 18:45 — forked from slavafomin/git-submodules.md
Git submodules best practices

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive [email protected]:name/repo.git

— Initialize submodules after regular cloning:

@neyasbltb88
neyasbltb88 / rescue-from-git-push-force.md
Created July 1, 2022 13:54 — forked from Envek/rescue-from-git-push-force.md
Откат ошибочной команды git push --force

Откат ошибочной команды git push --force

Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force в не тот remote и/или не в ту ветку.

Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend по запарке вместо git push deis master --force делается просто git push --force. Упс.

Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…

Но это git, а значит всё можно починить!

@neyasbltb88
neyasbltb88 / gist:0b55746d565eb6205449e55addbc9644
Created February 10, 2021 11:38 — forked from realmyst/gist:1262561
Склонение числительных в javascript
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
use:
declOfNum(count, ['найдена', 'найдено', 'найдены']);
@neyasbltb88
neyasbltb88 / nginx_nodejs.md
Created November 19, 2019 19:12 — forked from tomasevich/nginx_nodejs.md
Сервер в связке Nginx + NodeJs

Сервер в связке Nginx + NodeJs

Данная пошаговая инструкция поможет освоить основы на простом примере

Для справки

Сервер поднимался на Debian 8 c характеристиками:

CPU - 1 ядро x 500 МГц

@neyasbltb88
neyasbltb88 / review.md
Created August 7, 2019 21:12 — forked from m12sl/review.md
Speech APIs small review

[TOC]

Speech to text

Небольшое пояснение про данные:

$ soxi mix_<...>.mp3

Input File     : 'mix_<...>.mp3'
@neyasbltb88
neyasbltb88 / easing.js
Created May 4, 2019 14:24 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@neyasbltb88
neyasbltb88 / baseConverter.js
Created April 5, 2019 12:51 — forked from faisalman/baseConverter.js
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <[email protected]>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
@neyasbltb88
neyasbltb88 / russia
Created April 3, 2019 18:40 — forked from gorborukov/russia
Регионы и города россии в формате JSON
[
{
"region": "Москва и Московская обл.",
"city": "Москва"
},
{
"region": "Москва и Московская обл.",
"city": "Абрамцево"
},
@neyasbltb88
neyasbltb88 / concat.array.buffers.js
Created March 24, 2019 01:37 — forked from 72lions/concat.array.buffers.js
Concatenates two ArrayBuffers
/**
* Creates a new Uint8Array based on two different ArrayBuffers
*
* @private
* @param {ArrayBuffers} buffer1 The first buffer.
* @param {ArrayBuffers} buffer2 The second buffer.
* @return {ArrayBuffers} The new ArrayBuffer created out of the two.
*/
var _appendBuffer = function(buffer1, buffer2) {
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
@neyasbltb88
neyasbltb88 / gulpfile.js
Created February 26, 2019 11:46 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));