Skip to content

Instantly share code, notes, and snippets.

View millsp's full-sized avatar
🌴
🌞

pierre millsp

🌴
🌞
View GitHub Profile
#!/bin/bash
# Bridge two network interfaces together
ip_address="192.168.2.1"
netmask="255.255.255.0"
dhcp_range_start="192.168.2.2"
dhcp_range_end="192.168.2.100"
dhcp_time="12h"
ifaceA="eth0"
type Head<T extends any[]> =
T extends [any, ...any[]]
? T[0]
: never
type Tail<T extends any[]> =
((...t: T) => any) extends ((_: any, ...tail: infer TT) => any)
? TT
: []
type Head<T extends any[]> =
T extends [any, ...any[]]
? T[0]
: never
type Tail<T extends any[]> =
((...t: T) => any) extends ((_: any, ...tail: infer TT) => any)
? TT
: []
type Head<T extends any[]> =
T extends [any, ...any[]]
? T[0]
: never
type Tail<T extends any[]> =
((...t: T) => any) extends ((_: any, ...tail: infer TT) => any)
? TT
: []
type Head<T extends any[]> =
T extends [any, ...any[]]
? T[0]
: never
type Tail<T extends any[]> =
((...t: T) => any) extends ((_: any, ...tail: infer TT) => any)
? TT
: []
type Head<T extends any[]> =
T extends [any, ...any[]]
? T[0]
: never
type Tail<T extends any[]> =
((...t: T) => any) extends ((_: any, ...tail: infer TT) => any)
? TT
: []
type Head<T extends any[]> =
T extends [any, ...any[]]
? T[0]
: never
type Tail<T extends any[]> =
((...t: T) => any) extends ((_: any, ...tail: infer TT) => any)
? TT
: []
declare function curry<F extends (...args: any) => any>(f: F): void
class Test {
a?: string
b?: object
c?: number
d?: [string, Test]
e?: [object, Test]
f?: [number, Test]
@millsp
millsp / ts-toolbelt-heavy-test.ts
Last active April 17, 2020 16:59
512000 Minus Operations in 1.3 seconds
import {Any, Number} from 'ts-toolbelt'
/** 512000 Minus Operations
* 80 * 80 * 80 Operations
* ~ 10 240 000 Iterations
* ~ 1.30sec
* @ 3.80GHz
* [email protected]
*/
type test = NestNestTest<'-20'> // 1.3s
{"lastUpload":"2020-08-16T14:05:01.885Z","extensionVersion":"v3.4.3"}