Skip to content

Instantly share code, notes, and snippets.

@iivanovw7
iivanovw7 / useMap.ts
Last active October 28, 2022 16:02
useMap.ts
import {
Dispatch,
SetStateAction,
useCallback,
useMemo,
useState,
} from "react";
export type TMapOrEntries<Key, Value> = Map<Key, Value> | [Key, Value][];
@iivanovw7
iivanovw7 / HttpStatusCode.ts
Created May 20, 2021 14:14 — forked from scokmen/HttpStatusCode.ts
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
import React from 'react'; // required to use JSX
export const CapitalizedReferenceComponentExternals = (props) => {
// get references to all possible components
// that this component might render
const { type, components: Components } = props;
// make a Capitalized reference to a specific component
// which we'll render
@iivanovw7
iivanovw7 / highcharts.js
Created March 18, 2021 06:00 — forked from alfonsomunozpomer/highcharts.js
A Highcharts mock for Jest (place it in yout __mocks__ directory) to test components that depend on React Highcharts
const highcharts = jest.genMockFromModule(`highcharts`)
// So that Boost and Exporting modules don’t complain when running tests
highcharts.getOptions = () => ({ plotOptions: {} })
module.exports = highcharts
@iivanovw7
iivanovw7 / README.md
Created January 21, 2021 12:19 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@iivanovw7
iivanovw7 / tsconfig.json
Created July 20, 2020 14:52 — forked from KRostyslav/tsconfig.json
tsconfig.json с комментариями.
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
/*
* a small mixin for easy use of rem with px as fallback
* usage: @include x-rem(font-size, 14px)
* usage: @include x-rem(marign, 0 12px 2 1.2)
* usage: @include x-rem(padding, 1.5 24px)
*
* thanks to Eric Meyer for https://github.com/ericam/susy
* and Hans Christian Reinl for http://drublic.de/blog/rem-fallback-sass-less/
*/
@mixin x-rem($property, $values) {