Skip to content

Instantly share code, notes, and snippets.

Will Frew willfrew

Block or report user

Report or block willfrew

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 keybase.md

Keybase proof

I hereby claim:

  • I am willfrew on github.
  • I am willfrew (https://keybase.io/willfrew) on keybase.
  • I have a public key ASBJjD93Mb1407x1aVeeirygx_feof8WOAsu8Rmlwanc1go

To claim this, I am signing this object:

@willfrew
willfrew / tuples.ts
Created Aug 15, 2018
Fun with tuple types in Typescript 3.0
View tuples.ts
type Head<T extends unknown[]> = T[0];
type FnWithArgs<T extends unknown[]> = (...args: T) => void;
type TailArgs<T> = T extends (x: unknown, ...args: infer T) => unknown ? T : never;
type Tail<T extends unknown[]> = TailArgs<FnWithArgs<T>>;
// Lol
type Decr<T extends number> =
T extends 10 ? 9 :
T extends 9 ? 8 :
@willfrew
willfrew / host.html
Created Jun 27, 2018
Iframe caching test
View host.html
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
(function() {
// 1 or 2
let i = Math.round(Math.random()) + 1
@willfrew
willfrew / example.ts
Last active Sep 6, 2017
Typescript 2.4.0+ Stack overflow
View example.ts
export interface Foo<T> {
(bar: Bar<T>): void;
}
export interface Bar<T> {
(foo: Foo<T>): Foo<T>;
}
function createBar<T>(): Bar<T> {
return (f) => f;
@willfrew
willfrew / ansible-aur-pkg-installer.md
Last active Dec 5, 2016 — forked from wrecker/ansible-aur-pkg-installer.md
download, build, and install aur packages with ansible
View ansible-aur-pkg-installer.md
You can’t perform that action at this time.