A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| web: gunicorn -w4 -b0.0.0.0:$PORT app:app |
| application: <app-engine-id> | |
| version: 1 | |
| runtime: python27 | |
| threadsafe: yes | |
| api_version: 1 | |
| handlers: | |
| - url: / | |
| static_files: _build/html/index.html | |
| upload: _build/html/index.html |
| from django.forms import ModelForm | |
| from django.forms.models import inlineformset_factory | |
| from models import Sponsor, Sponsorship | |
| class SponsorForm(ModelForm): | |
| class Meta: | |
| model = Sponsor |
| export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pip-cache | |
| export AQUIPAGO_ENVIRONMENT=testing | |
| make | |
| env/bin/pip install -r requirements/base.txt --download-cache=/var/lib/jenkins/pip-cache --use-mirrors --timeout 1 | |
| env/bin/pip install -r requirements/project.txt --download-cache=/var/lib/jenkins/pip-cache --use-mirrors --timeout 1 | |
| env/bin/python runtests.py || : | |
| env/bin/pylint --rcfile=.pylintrc aquipago --ignore=test > reports/pylint.txt || : |
| #!/usr/bin/env python | |
| import os | |
| import zipfile | |
| """ | |
| Helper class that lets one add whole directory contents. | |
| License | |
| -------------------- |
| ============== | |
| git commands | |
| ============== | |
| To rename branch | |
| ================= | |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| // REQUIRED: Include "jQuery Query Parser" plugin here or before this point: | |
| // https://github.com/mattsnider/jquery-plugin-query-parser | |
| $(document).ready(function(){ | |
| // BOOTSTRAP 3.0 - Open YouTube Video Dynamicaly in Modal Window | |
| // Modal Window for dynamically opening videos | |
| $('a[href^="http://www.youtube.com"]').on('click', function(e){ | |
| // Store the query string variables and values | |
| // Uses "jQuery Query Parser" plugin, to allow for various URL formats (could have extra parameters) |
| <iframe id="tweet-button" allowtransparency="true" frameborder="0" scrolling="no" | |
| src="http://platform.twitter.com/widgets/tweet_button.html?via=marcus_christie&text=Replace%20Me&count=horizontal" | |
| style="width:110px; height:20px;"></iframe> |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats