Skip to content

Instantly share code, notes, and snippets.

@jbaez
jbaez / TypeScript globals.md
Last active February 2, 2022 20:39
Useful Typescript global types

global.d.ts

// Returns the optional keys of T as a union of string literals
declare type OptionalKeys<T> = Exclude<
  {
    [K in keyof T]: T extends Record<K, T[K]> ? never : K;
  }[keyof T],
  undefined
>;
@jbaez
jbaez / git-useful-commands.md
Last active November 15, 2021 16:50
Git useful commands

Git useful commands

For all the examples we will use origin as the remote name, but this applies to other remotes as well.

Create a new local branch based from the current branch

git checkout -b {new-branch-name}

Checkout a remote branch

git checkout {branch-name}

Move current local branch to a different commit (SHA)

PHPUnit API reference

  • version 3.6