Skip to content

Instantly share code, notes, and snippets.

🚀
(>◕ᴗ◕)> ~ Function Is Not a Function

Ilya Komar0ff

🚀
(>◕ᴗ◕)> ~ Function Is Not a Function
  • Saint Petersburg, Russia
Block or report user

Report or block Komar0ff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View regexp.js
let regexp = /(?<=\().*(?=\))/;
let _variable = regexp.exec(data.name);
_variable? _variable = '' : _variable .toString()
.charAt(0)
.toUpperCase()
@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.