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
| " copy all this into a vim buffer, save it, then... | |
| " source the file by typing :so % | |
| " Now the vim buffer acts like a specialized application for mastering vim | |
| " There are two queues, Study and Known. Depending how confident you feel | |
| " about the item you are currently learning, you can move it down several | |
| " positions, all the way to the end of the Study queue, or to the Known | |
| " queue. | |
| " type ,, (that's comma comma) |
| attrdict==2.0.0 | |
| backports.shutil-get-terminal-size==1.0.0 | |
| cffi==1.7.0 | |
| cryptography==1.4 | |
| decorator==4.0.10 | |
| Django==1.9.7 | |
| djangorestframework==3.3.3 | |
| enum34==1.1.6 | |
| idna==2.1 | |
| ipaddress==1.0.16 |
| import six | |
| class ChoiceMeta(type): | |
| def __new__(mcs, name, bases, attrs): | |
| choices = [] | |
| values = [] | |
| labels = [] |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.
# pulling one User object
user = User.query.get(1)
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| class Node(object): | |
| def __init__(self, value, left=None, right=None): | |
| self.value = value | |
| self.left = left |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| class Node(object): | |
| def __init__(self, value, next=None): | |
| self.value = value | |
| self.next = next |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import array | |
| def reverse_array(letters, start, end): | |
| while start < end: |