Skip to content

Instantly share code, notes, and snippets.

View vladimir-ivanov's full-sized avatar

vladimir ivanov vladimir-ivanov

View GitHub Profile
@vladimir-ivanov
vladimir-ivanov / test.js
Created September 22, 2024 10:28
proxy and method decorator sequence
function methodDecorator(target, name, descriptor) {
const method = descriptor.value;
descriptor.value = function (...args) {
method.apply(this, args);
return this;
};
}
class Person {
isSignedIn = false;
type Records<Keys extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements> = {
[P in Keys]: CSSProperties & JSX.IntrinsicElements[P] & { tag: P; };
}[Keys];
const Box: FC<Records> = ({tag, children, ...rest}): JSX.Element => {
const {styles, attributes} = splitProps(rest);
const Tag = tag as string;
return <Tag style={styles} {...attributes}>{children}</Tag>
}
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