This file contains 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
export const curry = func => { | |
return function curried(...args) { | |
if (args.length >= func.length) { | |
return func.apply(this, args); | |
} | |
return (...subArgs) => curried.apply(this, args.concat(subArgs)); | |
}; | |
}; |
This file contains 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
1. Crease an organization scope on with link https://www.npmjs.com/org/create (somescope) | |
2. Init scoped package `npm init --scope=somescope` | |
``` | |
{ | |
"name": "@somescope/somepackage" | |
} | |
``` | |
3. Publish package `npm publich --access public` |
This file contains 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 pipe = (...fns) => (param) => fns.reduce((result, func) => func(result), param) | |
// Создаем pipe для обработки значения из поля формы | |
const value = pipe(trim, limit, shield)('some value') | |
| | | | |
обрезать пробелы - - | - - - экранировать символы | |
ограничить значение по длине | |
trim, limit, shield типовые функции имеющие следующий интерфейс fn(value) => value |
This file contains 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 fs = require('fs'); | |
const bmp = require('bmp-js'); | |
const FILE_NAME = 'photo.bmp'; | |
const SAVE_NAME = 'new-photo.bmp'; | |
const MAX_VALUE = 255; | |
const BR = 70; // коэффециент осветления | |
const CST = 0.6; // коэффециент увеличения контрастности | |
const NOISE = 0.2;// интенсивность шума |
This file contains 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
:root { | |
font-size: 12px; | |
} | |
@media (min-width: 768px) { | |
:root { | |
font-size: 14px; | |
} | |
} | |
@media (min-width: 992px) { | |
:root { |
This file contains 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 func run one by one | |
function wait(callback) { | |
var queue = []; | |
function _next() { | |
var cb = queue.shift(), | |
args = [].slice.call(arguments); | |
if (cb) { |
This file contains 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
# specify additional headers (this one is useful for development) | |
static -H '{"Cache-Control": "no-cache, must-revalidate"}' | |
serving "." at http://127.0.0.1:8080 |
This file contains 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 guid() { | |
function gen4() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return gen4() + gen4() + '-' + gen4() + '-' + gen4() + '-' + gen4() + '-' + gen4() + gen4() + gen4(); | |
} |
This file contains 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
Установка vim-plug на windows x64 | |
1. Скачать файл plug.vim и поместить его в папку Vim/vimfiles/autoload | |
2. Добавить в переменную окружения путь до ядра системы контроля версий Git | |
Так как он его использует для загрузки модулей. Например G:\ProgrammFiles\Git\mingw64\libexec\git-core | |
3. Ну и добавить соответственно конфиг, команда PlugInstall должна появиться. | |
Добавление цветовой схемы | |
1. Скачать файл с схемой | |
2. Поместить её в папку Vim/vimfiles/colors |
This file contains 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
# adding | |
git config --global alias.hist "..." or git config --global alias.hist log | |
## great log commit | |
log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |