Skip to content

Instantly share code, notes, and snippets.

View Pasi-D's full-sized avatar
🤖
Dreaming Big 🌠

Pasindu Dilshan Pasi-D

🤖
Dreaming Big 🌠
View GitHub Profile
////////////////////////////////////////////////////////////// Array utilities
type Length<T extends any[]> = T["length"];
type Head<T extends any[]> = T[0];
type Tail<T extends any[]> = ((...xs: T) => any) extends ((_x: any, ...xs: infer R) => any) ? R : [];
type AllTrue<Ts extends any[]> = {
0: true,
1: false,
2: AllTrue<Tail<Ts>>
}[Length<Ts> extends 0 ? 0 : Head<Ts> extends false ? 1 : 2]
@Pasi-D
Pasi-D / UploadFileComponent.tsx
Created March 26, 2020 12:52 — forked from vdelacou/UploadFileComponent.tsx
React / Typescript / Material UI / Upload file / Custom Button / Async /
// import .....
const inputUploadFile: CSSProperties = {
display: 'none',
};
const buttonUploadFile: CSSProperties = {
margin: 8,
};
class Vertex:
def __init__(self, value):
self.value = value
self.adjacents = []
self.state = 0
class Graph:
def __init__(self):
self.vertices = []
# self.edges = []