This file contains hidden or 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
| @mixin placeholder() { | |
| &::-webkit-input-placeholder, | |
| &::-moz-placeholder, | |
| &:-ms-input-placeholder, | |
| &:-moz-placeholder, | |
| &::placeholder { | |
| @content; | |
| } | |
| } |
This file contains hidden or 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
| @mixin size($size) { | |
| height: $size; | |
| width: $size; | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 _ from 'lodash' | |
| import { createActions as createReduxActions } from 'redux-actions' | |
| // That is simple functions (getFromStorage -> (key, fromSession) => window[fromSession ? 'sessionStorage' : 'localStorage'].getItem(key) | |
| import { getFromStorage, saveToStorage } from './storage' | |
| const convertStringToReduxPath = str => _.upperCase(str).replace(/ /g, '_') | |
| export const createReducer = (map, name, modificator) => | |
| _.reduce( | |
| map, |
This file contains hidden or 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 const generatePassword = ( | |
| length = 16, | |
| stringWithChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890' | |
| ) => { | |
| var pass = '' | |
| const chars = stringWithChars.split('') | |
| for (var j = 0; j < length; j++) { | |
| pass = pass + chars[Math.floor(Math.random() * (chars.length - 1 + 1))] | |
| } | |
| return pass |
This file contains hidden or 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 function uuid(a) { | |
| return a ? (a ^ Math.random() * 16 >> a / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid); | |
| } |
This file contains hidden or 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
| // MIXIN | |
| .make-sub-colors(@colors, @prefix) { | |
| .sub-color(@index) when (@index =< length(@colors)) { | |
| @value: extract(@colors, @index); | |
| @item: ~".@{prefix}-@{index}"; | |
| &@{item} { | |
| color: @value !important; | |
| } | |
| .sub-color(@index + 1); |
This file contains hidden or 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 _ from 'lodash' | |
| const dom = (query, asArray) => | |
| document[`querySelector${asArray ? 'All' : ''}`](query) | |
| /* | |
| dom.new('a', { | |
| text: 'Click me!', | |
| attrs: { |
This file contains hidden or 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
| console.logObject = function(...args) { | |
| const log = args.reduce((logs, object, index) => { | |
| if (typeof object === 'object' && !(object instanceof Array)) { | |
| logs.push(`\r\n{ `) | |
| logs.push.apply( | |
| logs, | |
| Object.keys(object).reduce((values, key) => { | |
| values.push( | |
| `\r\n ${key}:`, | |
| typeof object[key] === 'function' ? '[function]' : object[key], |
This file contains hidden or 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 { BASE_URL } from 'api' | |
| let abortableRequests = {} | |
| const createRequest = ( | |
| method, | |
| path, | |
| { body, successStatus, abortableKey } = {} | |
| ) => { | |
| let request = new XMLHttpRequest() |