Skip to content

Instantly share code, notes, and snippets.

View anatooly's full-sized avatar

Anatolii B anatooly

View GitHub Profile
{
// Place your settings in this file to overwrite the default settings
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.detectIndentation": true,
"editor.lightbulb.enabled": false,
"editor.fontFamily": "'Dank Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": false,
"editor.rulers": [80],
"editor.snippetSuggestions": "top",
{
"editor.cursorStyle": "line-thin",
"editor.fontFamily": "'SF Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 13,
"editor.fontWeight": "500",
"editor.lineHeight": 17,
"terminal.integrated.fontSize": 12,
"terminal.integrated.lineHeight": 1.23,
"editor.minimap.enabled": false,
@anatooly
anatooly / .vimrc
Created February 10, 2021 16:32
2021 vimrc
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
set expandtab
set number
set nowrap
set showbreak=+++
set textwidth=100
set showmatch
set visualbell
set hlsearch
@anatooly
anatooly / complete-zsh
Created December 1, 2020 13:44
Complete for terminal zsh
#
# Sets completion options.
#
# Authors:
# Robby Russell <[email protected]>
# Sorin Ionescu <[email protected]>
#
# Return if requirements are not found.
if [[ "$TERM" == 'dumb' ]]; then
@anatooly
anatooly / .zshrc
Last active November 20, 2020 11:48
ZSH project node_modules bin file run
# Adds node_modules/.bin to the PATH
# vi -c ":set nobomb" -c ":wq" ~/.zshrc macOs utf-8 char problem
npm_chpwd_hook() {
if [ -n "${PRENPMPATH+x}" ]; then
PATH=$PRENPMPATH
unset PRENPMPATH
fi
if [ -f package.json ]; then
PRENPMPATH=$PATH
PATH=$(npm bin):$PATH
@anatooly
anatooly / bemTool.js
Created November 8, 2020 12:13
BEM tool className
export default (block, element, modifier) => {
let prefix, ret;
if (!element) {
prefix = block;
} else {
prefix = block + '__' + element;
}
if (modifier) {
if (modifier instanceof Array) {
@anatooly
anatooly / abort.js
Created November 2, 2020 16:13
Fetch abort
/**
* @docs https://dev.to/ruheni/fetch-is-all-you-need-e8f
*/
const controller = new AbortController();
const signal = controller.signal;
let url = 'https://jsonplaceholder.typicode.com/todos/1'
setTimeout(() => controller.abort(), 100);
[alias]
co = checkout
br = branch
ci = commit
di = diff
st = status --short --branch
pullhead = "!git pull origin $(git rev-parse --abbrev-ref HEAD)"