Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Polymorphic React Type

type AsProp<C extends React.ElementType> = {
  as?: C
}

type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P)

/**
@danilobjr
danilobjr / mongodb-atlas-terraform.md
Last active March 14, 2023 22:52
Deploying on MongoDB Atlas using Terraform
@danilobjr
danilobjr / type-safe-curried-function-with-typescript.md
Last active March 17, 2022 19:15
Type-safe curried function with TypeScript

Type-safe curried function with TypeScript

This content was inpired by two great talks. I've put the links for them in References section.

Table of Contents

  1. Types
  2. curry() function
  3. Usage
  4. References
@danilobjr
danilobjr / gist:0c36f15f879df0f43b1c874143530db0
Last active February 8, 2019 19:06
Git Commit Message Conventions

Git Commit Message Conventions

The reasons for these conventions:

  • automatic generating of the changelog
  • simple navigation through git history (e.g. ignoring style changes)

Format of the commit message:

<type>(<scope>): <subject>
@danilobjr
danilobjr / gist:23974e9641cfc03ebd7a23e4e5ca2830
Created August 3, 2018 01:15
Ubuntu Minimal 18.04 + i3-gaps
You only need to install xorg and lightdm if you have installed Ubuntu Minimal.
If you installed a regullar Ubuntu desktop, just skip to the i3-gaps section.
xorg
====
# Xorg provides a base for a graphical environment
sudo apt install xorg
lightdm
@danilobjr
danilobjr / zsh.md
Created July 24, 2018 17:44 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@danilobjr
danilobjr / gstep.ps1
Created March 22, 2017 20:57
git + presenter + powershell
param(
[switch]$autoclear
)
$options = @{}
$options.Add('next', "Next step")
$options.Add('prev', "Previous step")
$options.Add('reset', "Reset the current changes")
$options.Add('rebase', "Rebase all steps that follow the current")