Using the pipenv for a clean Python environment
$ sudo apt-get install python3-pip
$ sudo pip3 install pipenv
| pip install jupyter jupyterthemes | |
| jt -t monokai -f sourcemed -fs 13 -tf sourcesans -tfs 16 -nf source -nfs 14 | |
| jupyter notebook |
| $color-primary: #55c57a; | |
| $color-primary-light: #7ed56f; | |
| $color-primary-dark: #28b485; | |
| .header { | |
| height: 95vh; | |
| background-image: linear-gradient( | |
| to right bottom, | |
| rgba($color-primary-light, 0.8), | |
| rgba($color-primary-dark, 0.8)), |
| // html code | |
| // <a href="#" class="btn btn--white">Button</a> | |
| $color-grey-dark: #777; | |
| $color-white: #fff; | |
| $color-black: #000; | |
| html { | |
| // Let 1rem = 10px | |
| font-size: 62.5%; |
| import time | |
| import hashlib | |
| serial = 'QQ0001' | |
| if __name__ == '__main__': | |
| now_time = time.time() | |
| print(now_time) | |
| h1 = hashlib.sha1() | |
| h1.update((str(now_time) + serial).encode('utf-8')) |
| import time | |
| from datetime import datetime, timedelta | |
| print('------------------------------------') | |
| # Get now timestamp & datetime | |
| now_dt = datetime.today() | |
| print('Now datetime is:', now_dt) |
sudo apt install vim git tig htop
| set nu | |
| set bg=dark | |
| if has("autocmd") | |
| au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif | |
| endif | |
| call plug#begin('~/.vim/plugged') |
| d = {'Bobson': 20, 'Bob': 22, 'Lin': 33} | |
| # filter by key | |
| d2 = {k : v for k,v in filter(lambda t: t[0] in ['Bobson', 'Lin'], d.items())} | |
| print('d2 = ', d2) | |
| # filter by value | |
| d3 = {k : v for k,v in d.items() if v in [22, 33]} | |
| print('d3 = ', d3) |
| import serial | |
| FLAG = 0x7E | |
| HEX_NUMBER = 0xFF | |
| HEX_NUMBERS = [0xFF, 0x15] | |
| # INT <---> STRING(hex) | |
| print(FLAG, type(FLAG)) # 126 <class 'int'> | |
| print(hex(FLAG), type(hex(FLAG))) # 0x7e <class 'str'> | |
| print(int(hex(FLAG), 16)) # 126 |