Skip to content

Instantly share code, notes, and snippets.

View vladimir-ivanov's full-sized avatar

vladimir ivanov vladimir-ivanov

View GitHub Profile
This file has been truncated, but you can view the full file.
openssl-1.1.1/0000755000000000000000000000000013345734631011704 5ustar rootrootopenssl-1.1.1/CONTRIBUTING0000644000000000000000000000704313345734623013543 0ustar rootroot
import { useLayoutEffect } from 'react';
import { debounce } from 'lodash';
import { GridApi } from 'ag-grid-community';
const events = [
'firstDataRendered',
'gridSizeChanged',
'modelUpdated',
'viewportChanged',
];
@vladimir-ivanov
vladimir-ivanov / scan-reset-pause.ts
Last active June 23, 2021 23:09
rxjs reset scan stream and pause/ start
import { BehaviorSubject, Observable } from 'rxjs';
import {
combineLatest, filter, map, scan, tap,
} from 'rxjs/operators';
const scanResetPause = ($isBusy: Observable<boolean>) => {
return interval(2000).pipe(
scan((acc, value) => {
if (!isBusy$.getValue()) {
return { prevIsBusy: false, value };
@vladimir-ivanov
vladimir-ivanov / transactionalCache.ts
Last active February 3, 2022 09:03
transactional list cache
interface WithId {
id: string | number;
}
type Transaction<T extends WithId = WithId> = T[];
export class TransactionalCache<T extends WithId = WithId> {
private remove: T[];
private update: T[];
private add: T[];
@vladimir-ivanov
vladimir-ivanov / getSignalRStreamRx.ts
Last active June 5, 2021 07:54
microsoft signalr stream converted to rxjs stream for greater flexibility
import {HubConnection} from '@microsoft/signalr';
//payload can be a one off payload or a Subject
export const getSignalRStreamRx = (hubConnection: HubConnection, operation: string, payload: any) => new Observable(observer => {
const subscription = hubConnection.stream(observer, operation, payload);
return {
unsubscribe: () => {
subscription.unsubscribe();
}
@vladimir-ivanov
vladimir-ivanov / git-release.js
Last active April 25, 2021 19:10
release branch
const {Repository, Branch, Enums, Cred} = require('nodegit');
const {version} = require('./package.json');
const branchName = `release-${version}`;
const run = async () => {
try {
const repo = await Repository.open('./');
await repo.checkoutBranch('master');
write-host "`n ## ONBOARDING SCRIPTS ## `n"
$nodeJsVersion = "12.14.0"
$projectName = 'alpha';
$gitUrl = "https://github.com/vladimir-ivanov/$projectName.git"
$installNode = $FALSE;
### CONFIGURATION
$rootDir = "C:\Development"
---
- name: This is a hello-world example
vars:
latest_version: "{{ version }}"
hosts: localhost
tasks:
- name: Create a file called '/tmp/testfile.txt' with the content 'hello world'.
copy:
content: hello worldn
dest: /tmp/text.txt
const greatestCommonDivisor(a: number, b: number): number => (b === 0) ? a : greatestCommonDivisor(b, a % b);
const result = [];
const traverse = (obj, path = '', parentRow = {}) => {
let row = { ...parentRow };
Object.entries(obj).forEach(([key, val]) => {
const currentPath = path ? `${path}.${key}` : key;
if (Array.isArray(val) && val.length > 0) {