Skip to content

Instantly share code, notes, and snippets.

View var-bin's full-sized avatar
🤙
Preprocessors do not output bad code. Bad developers do.

Vitalii Rybka var-bin

🤙
Preprocessors do not output bad code. Bad developers do.
View GitHub Profile
@var-bin
var-bin / .zshrc
Created August 22, 2019 19:02
zsh config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/var-bin/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@var-bin
var-bin / .tmux.conf
Created August 22, 2019 19:00
tmux config
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
@var-bin
var-bin / FastTrackToReact_final.md
Last active May 15, 2019 19:25
New project in React.js (Chrome Only) #react #reactjs
@var-bin
var-bin / FastTrackToReact_ v1.md
Last active May 15, 2019 19:06
New project in React.js (Chrome Only) #react #reactjs
@var-bin
var-bin / home.module.js
Last active January 16, 2019 14:13
lazyLoad modules in AngularJS
// home.module.js
"use strict";
import angular from "angular";
import { homeRouting } from "./home.module.routing";
import { BlogService } from "../blog/blog.service";
const HOME_MODULE = angular
@var-bin
var-bin / _bind.md
Last active July 19, 2018 13:39
A simple `.bind` polyfill fo JavaScript

Modern JavaScript

const obj1 = {
  a: 'hello',
  say() {
    console.log(this.a, ...arguments);
  }
};

const obj2 = {
project-root
├── src
│ ├── core
│ │ ├── bootstrap.js
│ ├── pages
│ │ ├── blog
│ │ │ ├── blog.module.js
│ │ │ ├── blog.service.js
│ │ │ ├── blog.view.html
│ │ ├── home
project-root
├── src
│ ├── core
│ │ ├── bootstrap.js
│ ├── pages
│ │ ├── home
│ │ │ ├── about
│ │ │ │ ├── about.module.js
│ │ │ │ ├── about.view.html
│ │ │ ├── index
{
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": false
}
},
@var-bin
var-bin / appBlog.js
Last active December 22, 2017 18:19
const appBlog = {
name: "blog",
url: "/blog",
component: "blogComponent",
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get("$ocLazyLoad");
// !!! Dynamic import !!!
return import(/* webpackChunkName: "blog.module" */ "./pages/blog/blog.module")
.then(mod => $ocLazyLoad.load(mod.BLOG_MODULE))