Skip to content

Instantly share code, notes, and snippets.

Paul dagda1

Block or report user

Report or block dagda1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View react-move.d.ts
import * as React from 'react';
import { Config } from 'kapellmeister';
import { GetInterpolator } from '..';
export type MakeState<T> = { [P in keyof T]: T[P] extends number | string ? T[P] | T[P][] : MakeState<T[P]> };
export interface INodeGroupProps<T = any, State = any> {
data: T[];
keyAccessor: (data: T, index: number) => string | number;
start: (data: T, index: number) => State & Partial<Config>;
View fetch-hook.ts
import { useState, useEffect } from 'react';
export interface UseFetchData<TData> {
data: TData;
isLoading: boolean;
error?: string;
}
export const useFetchData = <TData>(fetchUrl: string, defaultValue: TData): UseFetchData<TData> => {
const [data, setData] = useState<TData>(defaultValue);
View d.ts
type Constructor<T> = { new(...args: any[]): T };
interface Decorate<T, Decorated>{
(clazz: Constructor<T>): Constructor<T & Decorated> { }
}
View omit.ts
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
View useIncreaseAnimation.ts
import { EasingName, easing } from './easingMap';
import { useLayoutEffect, useState, useRef } from 'react';
export interface AnimationIncreaseProps {
easingName?: EasingName;
duration?: number;
diff: number;
}
export const useIncreaseAnimation = ({
View cond.ts
export interface Tab<TProps = unknown> {
title: string;
content: TProps extends React.HTMLAttributes<TProps>
? React.ReactNode
: React.ReactElement<TProps & { viewMode: ViewMode }>;
popout?: boolean;
}
View recursive.ts
type PartialDeep<T> = {
[ P in keyof T ]?: PartialDeep<T[ P ]>;
}
type PartialRestoreArrays<K> = {
[ P in keyof K ]?: K[ P ];
}
View t.js
'use strict';
const fs = require('fs');
const path = require('path');
/* const input = '#1 @ 1,3: 4x4\n#2 @ 3,1: 4x4\n#3 @ 5,5: 2x2\n'; */
const input = fs.readFileSync(path.join(__dirname, 'day3.txt')).toString();
const lines = input.split('\n').slice(0, -1);
View deeppartial.ts
export type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> };
View .zshrc
plugins=(
zsh-nvm
git
iterm2
colored-man-pages
yarn
vscode
frontend-search
zsh-autosuggestions
zsh-history-substring-search
You can’t perform that action at this time.