doc
add some useful code snippet