Skip to content

Instantly share code, notes, and snippets.

@dohaivu
dohaivu / keyboard.java
Created June 23, 2017 08:44
#android keyboard
// hide keyboard
View view = this.getCurrentFocus();
if (view != null) {
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
// show keyboard
if (view.requestFocus()) {
InputMethodManager imm = (InputMethodManager)
@dohaivu
dohaivu / git.md
Last active December 14, 2018 08:45
[git common commands] #git
@dohaivu
dohaivu / npm.md
Last active May 26, 2018 02:24
[npm commands] #nodejs

Install node gyp

https://github.com/mafintosh/node-gyp-install
npm install -g node-gyp-install
node-gyp-install

Version

version Must match version exactly
@dohaivu
dohaivu / bash.md
Last active April 20, 2023 12:06
[bash command] common bash command #bash
@dohaivu
dohaivu / gcloud.md
Last active February 13, 2019 04:27
[gcloud command] gcloud and kubectl command #gcloud

Zone

zone: asia-southeast1-b
region: asia-southeast1

Commands

gcloud auth login
gcloud auth application-default login
gcloud auth activate-service-account --key-file credentials.json
@dohaivu
dohaivu / oauth.md
Last active May 25, 2018 07:11
[OAuth] OAuth2, keycloak server oauth, jwt, openid connect
@dohaivu
dohaivu / nano.md
Last active May 26, 2018 02:26
[nano command] #tool

^G nano help

Starting nano

To edit a file called filename, type nano filename.
In nano, you can insert another file:
^R read an existing file into nano (inserted at the current cursor position)
^T opens a browser that allows you to select a file name from a list of files and directories

Navigation

^A move to beginning of line

@dohaivu
dohaivu / hugo.md
Created June 24, 2017 03:14
[hugo site generator] static site generator

Commands

brew update && brew install hugo

hugo new site bookshelf
hugo new post/good-to-great.md

mkdir themes && cd themes
hugo server --theme=hugo_theme_robust --buildDrafts
@dohaivu
dohaivu / ux.md
Created June 24, 2017 03:16
[ux term] user experience term and definition #ux

Style guides

Document that explain how a brand is constructed

- Logo: Positioning, variations, with and without slogans, sub-brands…
- Colours: Primary palette, accent colours, usage… 
- Copy: Tone of voice, product names, capitalisation…
- Illustration: Illustrative style, iconography…
- Photography: Photographic style, cropping, positioning…
- Grids: Columns, baseline, key divisions…
@dohaivu
dohaivu / library.md
Last active June 12, 2018 00:11
[Android library] A collection of #android library: image, annimation