Skip to content

Instantly share code, notes, and snippets.

Working from home

Khang Hoang khanghoang

Working from home
View GitHub Profile
khanghoang /
Last active Apr 21, 2020
Getting the PayPal's debug-id

For Chrome

1. Open Inspector

Right click on the page -> Select Inspect -> Select Network tab image

2. Looking for EC token

Click on the credit card icon to open Inline Guest.
Search for counter.cgi in the Network tab image


Enable CodeLens in coc.nvim

You'll also need to enable the code lens feature in coc (:CocConfig):

"codeLens.enable": true


Create a channel to communicate with NeoVim and its plugins
For example, you can execute a script from the plugin using

View grab.signal.js
/* @flow */
class Signal {
value: any;
fns: Array<Function>
constructor(value: any) {
this.value = value;
this.fns = [];
git init --bare $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
config config --local status.showUntrackedFiles no
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.zshrc
View mockFetchAction.js
import { ACTIONS } from 'redux-api-call';
export default (makeFetchAction, data) => (name, apiFn) => {
const {
} = makeFetchAction(name, apiFn);
khanghoang /
Last active Apr 21, 2017
Redux-api-call test utils

Pain point #1

Redux-api-call's makeFetchAction comes with its own dataSelector, but in real world, we can't just grab and use it. We may need to write our selector which bases on dataSelector.
Then when we write our unit test of that selector, we have to setup state which has api_calls property and the response. For example:

const state = {
  // some other properties
  api_calls: {
    fooApi: {
View fancy-utility-color-functions.js
// @flow
Validate Hex
@param {String} hex
1. remove hash if present
2. convert from 3 to 6 digit color code & ensure valid hex
khanghoang /
Last active Dec 13, 2016

class: middle, center, inverse

#You don't know React Native @khanght
Employment Hero


What is the purpose of this talk? Just one thing, when you buddy asks you "Hey, i just heard about React Native Native, do you know about it?" you can answer with confidence "Yes, I do"

khanghoang /
Created Aug 5, 2016 — forked from ryansch/
neovim + yadr