Intro

  1. Gmail 계정으로 Github 가입
  2. 요즘은 웹사이트보다 웹어플리케이션으로 많이 사용하는 추세
  3. 백엔드-서버 / 프론트-클라이언트

Shell basic

$ ls
$ ls -al

$ mkdir my_folder
$ touch my_file
$ mv my_file my_folder

상위 디렉토리에 copy
$ cp my_file ../

remove
$ rm my_file

r(디렉토리에 포함된 파일까지), f(조건 없이) remove
$ rm -rf my_folder

Shell Setting

iTerm, zsh, oh-my-zsh X Vim 설정

iTerm2 설치

  1. Solarized 테마 설정 : preferences > profiles > colors
  2. powerline fonts 설정 : preferences > profiles > text > change font
  3. Enable word jumps : preferences > profiles > keys
    • option + → / Send Escape Sequence / f
    • option + ← / Send Escape Sequence / b

oh-my-zsh 설치

$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
installing...
$ vi ~/.zshrc
".zshrc file
ZSH_THEME="agnoster"

Auto suggestions 설치

$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
installing...
$ vi ~/.zshrc
".zshrc file
plugins=(zsh-autosuggestions)

Syntax highlighting

$ brew install zsh-syntax-highlighting
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
$ echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
$ source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
$ vi ~/.zshrc
".zshrc file
plugins=(zsh-autosuggestions zsh-syntax-highlighting)

Shorter prompt style

$ vi ~/.zshrc
".zshrc file
DEFAULT_USER=`whoami`

Vim setting

$ cd ~/.vim/bundle
$ git clone git://github.com/altercation/vim-colors-solarized.git
$ vi ~/.vimrc
".vimrc file
set rtp+=~/.vim/bundle/vim-colors-solarized

syntax enable
set background=dark
colorscheme solarized

" line number
set nu
set ruler

" tab to space4
set smartindent
set tabstop=4
set expandtab
set shiftwidth=4

Vim basic

$ vi vim.py
  • esc - Normal Mode > u - undo
    • i - Insert Mode
    • v- Visual Mode > y - 복사, p - 붙여넣기, d - 잘라넣기 > o - New Line 생성하고 아래줄에 insert mode로 진입, shift+o - New Line 생성하고 윗줄에 insert mode로 진입
  • : - Quit
  • h, j, k, l - Cursor

Python

1. basic

python pep8

2. version management

pyenv repo

$ brew update
$ brew install pyenv

bash setting
.은 숨긴 파일
$ vi ~/.bash_profile
" .bash_profile 파일에 추가
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
$ pyenv install 3.5.2
$ pyenv shell 3.5.2
$ python --version

3. input

# 2.7에서 raw_input()과 동일
# string으로 값을 받음
input("How old are you? ")

# 2.7에서 input()과 동일
# 값을 평가한 후 타입을 결정하여 받음
eval(input("How old are you? "))

# 값을 출력할 때는 string으로 변환해서 출력하는 것이 좋음!

복습 문제 - HakerRank