- (under 18.04) amazon app4
- games (like sudoku...)
sudo apt update
sudo apt dist-upgrade && sudo apt autoremove && sudo apt autoclean| set nocompatible " be iMproved, required | |
| filetype off " required | |
| " set the runtime path to include Vundle and initialize | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| " alternatively, pass a path where Vundle should install plugins | |
| "call vundle#begin('~/some/path/here') | |
| " let Vundle manage Vundle, required |
| #! /bin/bash | |
| sudo apt-get install build-essential git | |
| git clone https://github.com/gnab/rtl8812au.git | |
| cd rtl8812au | |
| make | |
| sudo make install | |
| sudo modprobe 8812au |
| # edit the ~/.gitconfig | |
| # it's from https://stackoverflow.com/questions/1838873/visualizing-branch-topology-in-git | |
| [alias] | |
| lg = !"git lg1" | |
| lg1 = !"git lg1-specific --all" | |
| lg2 = !"git lg2-specific --all" | |
| lg3 = !"git lg3-specific --all" | |
| lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' |
| #!/bin/bash | |
| sudo sed -i -- 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=-1/g' /etc/default/grub | |
| cat /etc/default/grub | grep GRUB_TIMEOUT | |
| sudo update-grub |
| # aliases for system | |
| alias apt_upgrade_sequence="sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo apt autoclean" | |
| alias swapfree="sudo swapoff -a; sudo swapon -a" | |
| # aliases for git | |
| alias gits="git status" | |
| alias gitf="git fetch --all --prune" | |
| alias gitsave="git config credential.helper store" | |
| alias gitreload="git fetch --all && git rev-parse --abbrev-ref HEAD | xargs -I {} git reset origin/{} --hard" | |
| alias gitwip="git add . && git rev-parse --abbrev-ref HEAD | xargs -I {} git commit --no-verify -m \"{}-WIP\"" |
| const winston = require('winston'); | |
| require('winston-daily-rotate-file'); | |
| // can replace with values on configuration | |
| const LOG_CONSOLE_LEVEL = 'debug'; | |
| const LOG_CONSOLE_JSON = true; | |
| const LOG_FILE_LEVEL = 'info'; | |
| const LOG_FILE_NAME = 'VirtualWorkers-%DATE%.log'; | |
| // Winston Daily Rotate File : https://github.com/winstonjs/winston-daily-rotate-file |
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment | |
| class TestClass { | |
| constructor({a = 1, b = 2, c, d, ...extra} = {d: 4}) { | |
| this.data = {a, b, c, d}; | |
| this.extra = extra; | |
| } | |
| toString() { | |
| console.log(`a = ${this.data.a}, b = ${this.data.b}, c = ${this.data.c}, d = ${this.data.d}, extra = ${this.extra}`) | |
| } |
| #!/bin/bash | |
| backend_path="/home/username/project/admin/my-project-backend" | |
| frontend_path="/home/username/project/admin/my-project-frontend" | |
| terminator --working-directory=$backend_path -T ADMIN_BACKEND && | |
| until wmctrl -l | grep -q "ADMIN_BACKEND"; | |
| do | |
| sleep 0.1 | |
| done | |
| wmctrl -r ADMIN_BACKEND -t 2 |
| function ReactPage(props) { | |
| const printingTarget = useRef(null); | |
| const iframe4print = useRef(null); | |
| function onPrintButtonClick() { | |
| let content = printingTarget.current; | |
| let pri = iframe4print.current.contentWindow; | |
| pri.document.open(); | |
| pri.document.write(`<html lang="ko">${document.head.innerHTML}<body>${content.innerHTML}</body></html>`); | |
| pri.document.close(); |