Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Khang Hoang khanghoang

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

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

View writing-the-plugin.md

Enable CodeLens in coc.nvim

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

"codeLens.enable": true

Neovim-client

Create a channel to communicate with NeoVim and its plugins https://github.com/chemzqm/node-client.
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 = [];
}
View config-init.sh
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 {
dataSelector,
actionCreator,
isFetchingSelector,
errorSelector,
updater,
} = makeFetchAction(name, apiFn);
@khanghoang
khanghoang / redux-api-call.md
Last active Apr 21, 2017
Redux-api-call test utils
View redux-api-call.md

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
khanghoang / You-dont-know-React-Native.md
Last active Dec 13, 2016
You-dont-know-React-Native
View You-dont-know-React-Native.md

class: middle, center, inverse

#You don't know React Native @khanght
Employment Hero
facebook.vn/groups/reactvn/

???

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
khanghoang / README.md
Created Aug 5, 2016 — forked from ryansch/README.md
neovim + yadr
View README.md