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 default class LocalStorage { | |
static get(name) { | |
return localStorage[name] ? JSON.parse(localStorage[name]) : undefined; | |
} | |
static set(name, value) { | |
localStorage[name] = JSON.stringify(value); | |
} | |
static delete(name) { |
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
import React from 'react'; | |
import classnames from 'classnames/bind'; | |
import PropTypes from 'prop-types'; | |
import style from './style.less'; | |
const cn = classnames.bind(style); | |
class ElementsGroup extends React.Component { | |
getStyle = (i) => { |
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
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import classnames from 'classnames/bind'; | |
import FirmFlagService from './../../services/FirmFlagServiсe'; | |
import style from './style..less'; | |
const cn = classnames.bind(style); | |
class UserVoiceBubble extends Component { | |
constructor(props) { |
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
import { observable, action } from 'mobx'; | |
import OperationTablesService from '../services/OperationTablesService'; | |
import storage from '../helpers/storage'; | |
class SuccessTableStore { | |
filter = storage.get('filter'); | |
pageCount = 20; | |
@observable operations = []; | |
@observable totalCount = 0; | |
@observable tableCount = 0; |
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
import React, {Component} from 'react'; | |
import SearchIcon from '../../icons/search-icon'; | |
import { | |
SearchInputView, | |
IconContainer, | |
InputView, | |
StyledInput, | |
StyledText | |
} from './styles'; |
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
import React, { Component } from 'react'; | |
import { reduxForm, Field } from 'redux-form'; | |
import PropTypes from 'prop-types'; | |
import {Title, Input, Button} from '../../../elements'; | |
import { | |
Description, | |
StyledTitle, | |
DescriptionWrapper, | |
Container |
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
import React, { PureComponent } from 'react'; | |
import { Grid } from 'styled-css-grid'; | |
import styled from 'styled-components'; | |
import { theme } from 'utils'; | |
import { Header, Content } from 'components'; | |
const Container = styled.div` | |
padding: ${({ padding }) => padding ? `${padding}px` : '0'} 200px; | |
`; |
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
/* The function takes some set of data (preferable structural types), and assuming some | |
* default expectations of output (in my case, fields to be 'text' and 'value - returns back adapter structure */ | |
/* Used GOF Patterns - Adapter and Strategy */ | |
export default function adaptToList(data = [], textField = '', valueField = '') { | |
if (!data.length) { | |
return []; | |
} |
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
fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> { | |
let mut map: HashMap<i32, i32> = HashMap::new(); | |
for (i, num) in nums.iter().enumerate() { | |
let complement: i32 = target - nums[i]; | |
let i_i32 = i as i32; | |
if map.contains_key(&complement) { | |
let map_complement = *map.get(&complement).unwrap(); |
OlderNewer