oauth grant types

Recently we need to integrate our frontend spa with oauth(call third party apis), Need to figure out which grand type fit which use case. The specification describes five grants for acquiring an access token: Authorization code grant Implicit grant Resource owner credentials grant Client credentials grant Refresh token grant So most common is 1 and…

work with multiple files in vim

When working with multi files in vim, there are several options. Netrw Was first trying to use the netrw which comes with vim installation. However it is not quite easy to use. :e. is to open the file explore, or :Exp, or : Vex, or :Sex. NERDTree Nerdtree is the de facto file explore. After the frustration…

javascript statement completion value

We all know how painful it is to write long and tedious cloud formation json templates. Cloudform is a nice little library to write cloud formation template in typescript and will compile it into json. Its types are all from amazon’s own library so it is easy to keep up to date without the maintainer…

package json bin field

We can define some executable js file in the bin section of the package json so that during installation, npm will symlink that file into prefix/bin for global installs, or ./node_modules/.bin/ for local installs. The file js need to start with the node flavor hash ban : #!/usr/bin/env node,  where the env will file the path of node in the system for us. And npm…