This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
py.test test_sample.py --collect-only # collects information test suite | |
py.test test_sample.py -v # outputs verbose messages | |
py.test -q test_sample.py # omit filename output | |
python -m pytest -q test_sample.py # calling pytest through python | |
py.test --markers # show available markers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo dpkg -i google-chrome-stable_current_amd64.deb; | |
sudo apt-get -f install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:webupd8team/sublime-text-3; | |
sudo apt-get update; | |
sudo apt-get install sublime-text-installer; | |
sudo ln -s /usr/lib/sublime-text-3/sublime_text /usr/local/bin/sublime; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://github.com/zhangshine/MdCharm/releases/download/1.2.0/mdcharm_1.2_amd64.deb; | |
sudo dpkg -i mdcharm_1.2_amd64.deb; | |
sudo apt-get -f install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:webupd8team/java; | |
sudo apt-get update; | |
sudo apt-get install oracle-java8-installer; | |
sudo update-alternatives --config java; | |
java -version; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git reset --hard HEAD~1 | |
$ git push -f # removes last commit. | |
$ git diff --staged # will show you the diff that you're about to commit. | |
$ git commit -am "First commit" # adds all changes to tracked files and uses the commit message from the command-line. | |
$ git diff -M # only considers a file that disappeared as the source of a rename. | |
$ git diff -b # the -b means ignore whitespace, useful since we've changed some html indenting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
class Form(forms.Form): | |
field = forms.TypedChoiceField(coerce=lambda x: x =='True', | |
choices=((False, 'No'), (True, 'Yes'))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
from Queue import Queue | |
fibo_dict = {} | |
shared_queue = Queue() | |
input_list = [3, 10, 5, 7] | |
queue_condition = threading.Condition() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
HG_COMMIT_MESSAGE="$(hg tip --template {desc})" | |
HG_BRANCH="$(hg identify -b)" | |
if [[ ${HG_COMMIT_MESSAGE=} = *${HG_BRANCH}* ]]; then | |
exit 0 | |
fi | |
exit 1 |
NewerOlder