Skip to content

Instantly share code, notes, and snippets.

View milichev's full-sized avatar

Vadym Milichev milichev

View GitHub Profile
@milichev
milichev / eslint-ignore.js
Last active January 24, 2022 10:59
suppress react-hooks eslint warnings
/**
* Accepts eslint `stdout` and processes all error messages related to React Hooks, if any.
*
* Essentially, the "fix" is only about adding a respective `eslint-disable-line` comments to mute the error unless it is addressed appropriately.
*
* Requires the following modules available:
* - lodash
*
* Usage:
*
@milichev
milichev / Set-TextAnsiCodes.psm1
Last active April 24, 2020 23:55
ANSI Colors
<#
.SYNOPSIS
Provides possibility to colorize text in console using ANSI sequences.
#>
using namespace System.Drawing
function ToColor {
[CmdletBinding()]
param (
@milichev
milichev / InstallUtils.psm1
Created April 16, 2020 13:34
PowerShell utilities
#region Scripting
function Test-IsConsoleHost {
@('ConsoleHost', 'Visual Studio Code Host') -contains ($host.name)
}
function Get-PromptParam {
[CmdletBinding()]
param (
[string] $name,
const pipeData = function(fn) {
return function(data) {
return Promise.resolve(fn(data)).then(function(res) {
if (res === void 0) {
return data;
}
const keys = Object.keys(res).filter(function(prop) {
return res.hasOwnProperty(prop);
});
return Promise.all(keys.map(function(prop) {
@milichev
milichev / replaceAbsoluteImports.js
Created December 27, 2018 01:21
Traverses .ts source files in a project and replaces all absolute imports with aliases to relative ones, according to paths in tsconfig.json
const fs = require("fs");
const path = require("path");
const globby = require("globby");
const srcPath = fn("../src");
const aliases = getAliases();
(async () => {
const files = await findFiles();
files
@milichev
milichev / ReactComponent.tsx
Created May 17, 2018 12:16
WebStorm Templates
import * as React from 'react';
export interface ${NAME}Props {
}
interface ${NAME}State {
}
export class ${NAME} extends React.Component<${NAME}Props, ${NAME}State> {
@milichev
milichev / 1 source.json
Last active November 30, 2017 18:39
BIC surveys
[
{
"surveytype": "BICBD",
"surveyid": 173,
"bisid": 94,
"countryid": 1,
"countryname": "United States",
"countrycode": "US",
"industryid": 17,
"industryname": "Traditional Retail Banks",
@milichev
milichev / cassandra.yaml
Last active November 16, 2017 03:54
Connection problem with Cassandra datastax nodejs-driver
# Cassandra storage config YAML
# NOTE:
# See http://wiki.apache.org/cassandra/StorageConfiguration for
# full explanations of configuration directives
# /NOTE
# The name of the cluster. This is mainly used to prevent machines in
# one logical cluster from joining another.
cluster_name: 'Test Cluster'
@milichev
milichev / documents.json
Last active October 20, 2017 15:30
data.gov.ua sample
{
"count": 500,
"docs": [
{
"_id": "59ea1648027df13970ba4ab8",
"kind": 0,
"code": 54781853,
"causeNum": "640/21373/15-к",
"judgeName": "Божко В. В.",
"adjDate": "2015-12-29T22:00:00.000Z",
  1. Національний портал відкритих даних http://data.gov.ua
  2. Єдиний державний реєстр юридичних осіб та фізичних осіб-підприємців https://usr.minjust.gov.ua
  3. Реєстр платників ПДВ http://sfs.gov.ua/reestr
  4. Анульована реєстрація платників ПДВ http://sfs.gov.ua/anulir
  5. Єдиний ліцензійний реєстр http://irc.gov.ua/ua/Poshuk-v-YeLR.html
  6. Єдиний державний реєстр судових рішень http://www.reyestr.court.gov.ua
  7. Інформація з фондового ринку http://smida.gov.ua/db
  8. Система реалізації конфіскованого та арештованого майна https://trade.informjust.ua
  9. Реєстр громадських об’єднань http://rgo.informjust.ua
  10. Єдиний реєстр громадських формувань http://rgf.informjust.ua/home/index