Skip to content

Instantly share code, notes, and snippets.

Avatar
👁️
(>◕ᴗ◕)> ~ Function Is Not a Function

Ilya Komar0ff

👁️
(>◕ᴗ◕)> ~ Function Is Not a Function
View GitHub Profile
@Komar0ff
Komar0ff / .vimrc
Last active Nov 22, 2020
my vimrc
View .vimrc
" Base config
syntax on
let mapleader = " "
set nowrap
set noerrorbells
set tabstop=2 softtabstop=2
set shiftwidth=2
set expandtab
set smartindent
@Komar0ff
Komar0ff / gist:544f0899b82a4b7c00494ecaacdb5c03
Last active Jan 14, 2020
Keep your master branch pointing at the original repository and make pull requests from branches on your fork.
View gist:544f0899b82a4b7c00494ecaacdb5c03
git remote add upstream https://github.com/repo.git
git fetch upstream
git branch --set-upstream-to=upstream/master master
git pull
View regexp.js
let regexp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
@Komar0ff
Komar0ff / GodNooCode_5.js
Last active May 3, 2019
The very bad realizations I've seen at work
View GodNooCode_5.js
beers.sort((first, second) => {
if (queryParams.sorting === 'дороже') {
const firstBeerLittreMaxPrice = Math.max.apply(Math, first.products.map((p) => {
return Math.round(10.0 * p.price / p.boxingVolume) / 10.0;
}));
const secondBeerLittreMaxPrice = Math.max.apply(Math, second.products.map((p) => {
return Math.round(10.0 * p.price / p.boxingVolume) / 10.0;
}));
if (firstBeerLittreMaxPrice < secondBeerLittreMaxPrice) return 1;
if (firstBeerLittreMaxPrice > secondBeerLittreMaxPrice) return -1;
@Komar0ff
Komar0ff / GodNooCode_4.js
Last active May 3, 2019
The very bad realizations I've seen at work
View GodNooCode_4.js
getBasketItemsMap(){
return new Promise((resolve, reject) => {
let value = window.localStorage.getItem('basket');
if (value == undefined || value == '' || value == '[object Object]'){
value = {};
}else {
value = JSON.parse(value);
}
if (value == undefined){
value = {};
@Komar0ff
Komar0ff / GodNooCode_3.js
Last active May 3, 2019
The very bad realizations I've seen at work
View GodNooCode_3.js
export function deleteBasketItemsByIds(productIds){
return (dispatch, getState) => {
dispatch(deleteBasketItemsByIds_());
return BasketAPI.deleteBasketItemsByProductsIds(productIds).then(
() => dispatch(deleteBasketItemsByIdsSuccess(productIds)),
err => dispatch(deleteBasketItemsByIdsFail(err))
)
}
}
@Komar0ff
Komar0ff / GodNooCode_2.js
Last active May 3, 2019
The very bad realizations I've seen at work
View GodNooCode_2.js
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import styled from 'styled-components';
import validator from 'validator'
import Modal from '@atlaskit/modal-dialog'
import { Document, Page } from 'react-pdf';
@Komar0ff
Komar0ff / GodNooCode.js
Last active May 3, 2019
The very bad realizations I've seen at work
View GodNooCode.js
/**
*/
import React, {PropTypes} from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { Router, Route, browserHistory, useRouterHistory, hashHistory, IndexRoute } from 'react-router';
import { createHashHistory } from 'history'
You can’t perform that action at this time.