Skip to content

Instantly share code, notes, and snippets.

// 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');
$basicStep: 4px;
$stepsAmount: 12;
$gaps: ('m': 'margin', 'p': 'padding');
$directions: (
'l': 'left',
'r': 'right',
't': 'top',
'b': 'bottom',
'a': 'all',
$colsAmount: 9;
$colStep: 100% / $colsAmount;
@for $i from 1 through $colsAmount {
.col-#{$i} {
width: $colStep * $i;
}
}
const ignoringConditions = [
() => false,
() => false,
() => false,
]
const hiringConditions = [
() => true,
() => false,
() => false,
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,
import { useEffect, useReducer } from 'react';
/* Interfaces */
interface IResponse {
data?: any,
error?: Error,
}
interface IAction extends IResponse {
type: string,
function isObject(value) {
return typeof value === 'object';
}
function deepCopy(value, hash = new Map()) {
let newVal;
if (hash.has(value)) {
return hash.get(value);
}
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;
}