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
| // Usage: node createComponent button - Creates folder Button with set of files with extensions from json | |
| const path = require('path'); | |
| const { | |
| promises: { | |
| writeFile, | |
| }, | |
| stat, | |
| mkdir, | |
| } = require('fs'); |
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
| $basicStep: 4px; | |
| $stepsAmount: 12; | |
| $gaps: ('m': 'margin', 'p': 'padding'); | |
| $directions: ( | |
| 'l': 'left', | |
| 'r': 'right', | |
| 't': 'top', | |
| 'b': 'bottom', | |
| 'a': 'all', |
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
| $colsAmount: 9; | |
| $colStep: 100% / $colsAmount; | |
| @for $i from 1 through $colsAmount { | |
| .col-#{$i} { | |
| width: $colStep * $i; | |
| } | |
| } |
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
| const ignoringConditions = [ | |
| () => false, | |
| () => false, | |
| () => false, | |
| ] | |
| const hiringConditions = [ | |
| () => true, | |
| () => false, | |
| () => 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
| module.exports = { | |
| //First 8 bites of any original PNG Image | |
| PNG_SIGNATURE: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], | |
| RGBA_DIMENSIONS_AMOUNT: 4, //1 for each letter in RGBA; | |
| TYPE_IHDR: 0x49484452, | |
| TYPE_IEND: 0x49454e44, | |
| TYPE_IDAT: 0x49444154, | |
| TYPE_PLTE: 0x504c5445, |
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 { useEffect, useReducer } from 'react'; | |
| /* Interfaces */ | |
| interface IResponse { | |
| data?: any, | |
| error?: Error, | |
| } | |
| interface IAction extends IResponse { | |
| type: string, |
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
| function isObject(value) { | |
| return typeof value === 'object'; | |
| } | |
| function deepCopy(value, hash = new Map()) { | |
| let newVal; | |
| if (hash.has(value)) { | |
| return hash.get(value); | |
| } |
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
| const events = ['click']; | |
| function onClickOutside({ event, el, handler, middleware }) { | |
| const isClickOutside = | |
| event.target !== el | |
| && !el.contains(event.target); | |
| if (!isClickOutside || !middleware(event, el)) { | |
| return null; | |
| } |