자신의 git 프로젝트 폴더 안 .git/hooks/pre-commit 파일에 아래 내용을 넣으세요.
#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
if [ -n "$FILES" ]; then
flake8 $FILES
fi
mkdir ~/vim | |
cd ~/vim | |
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim | |
# Compiled on Jul 20 2017 | |
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz | |
export VIMRUNTIME="$HOME/vim/runtime" | |
export PATH="$HOME/vim:$PATH" | |
cd - |
[uwsgi] | |
# Django-related settings | |
# the base directory (full path) | |
chdir = /home/ubuntu/(project-dir) | |
# Django's wsgi file | |
module = (project-name).wsgi:application | |
# the virtualenv (full path) | |
home = /home/ubuntu/.venv/(venv-name)/ |
자신의 git 프로젝트 폴더 안 .git/hooks/pre-commit 파일에 아래 내용을 넣으세요.
#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
if [ -n "$FILES" ]; then
flake8 $FILES
fi
# Pyenv 설치 (https://github.com/yyuu/pyenv-virtualenv)
brew install pyenv-virtualenv
# ~/.bash_profile 파일에 아래 내용 추가
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# 사용할 Python 버전을 미리 깔고 (최신버전을 쓰세요, 예로 3.6.1을 들겠습니다.)
pyenv install 3.6.1
This gist has been moved to its own Github repo, so it's easier to contribute with additions and corrections. Please open a PR there if you see any mistake, I don't track comments on here as there's no notification system for gists AFAIK. Thanks.
Function | Shortcut |
---|---|
Previous Tab | ⌘ + Left Arrow |
Next Tab | ⌘ + Right Arrow |
Go to Tab | ⌘ + Number |
#!/usr/bin/env python | |
""" | |
mocking requests calls | |
""" | |
import mock | |
import unittest | |
import requests | |
from requests.exceptions import HTTPError |
django 기본 테스트는 데이터베이스 마이그레이션 덕에 느리고 번거롭기 때문에 py.test와 model_mommy를 사용해서 빠르게 테스트를 하는 방법을 소개함.
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI 1.0.
If you are using the Circle CI 2.0, take a look at this article from ryansimms
On Project Settings > Environment Variables add this keys:
<html> | |
<head> | |
</head> | |
<script type="text/javascript"> | |
function makeShort() | |
{ | |
var longUrl=document.getElementById("longurl").value; | |
var request = gapi.client.urlshortener.url.insert({ | |
'resource': { | |
'longUrl': longUrl |