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
// 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
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
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
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, |
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
@mixin size($size) { | |
height: $size; | |
width: $size; | |
} |
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
/** | |
* @name unixTimeToDate | |
* | |
* @param {number} unixTimeStamp | |
* @param {boolean} fromNow = add current time to unix timestamp | |
* | |
* @returns {Date} JavaScript Date type | |
*/ | |
export const unixTimeToDate = (unixTimeStamp, fromNow = false) => |
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
// store.js | |
import { StonexStore } from 'stonex' | |
import modules from './modules' | |
const store = new StonexStore(modules) |