Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| in upload handler | |
| in file close | |
| .. | |
| ---------------------------------------------------------------------- | |
| Ran 2 tests in 0.021s | |
| OK |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # Ensure we're in a virtualenv. | |
| if [ "$VIRTUAL_ENV" == "" ] | |
| then | |
| echo "ERROR: not in a virtual environment." | |
| exit -1 | |
| fi | |
| # Setup variables. | |
| CACHE="/tmp/install-pygtk-$$" |
| {% comment %} | |
| This is for widgets that share content on Twitter. | |
| Twitter developer info: https://dev.twitter.com/docs/cards | |
| Brought to you by Viralica http://viralica.com | |
| {% endcomment %} | |
| {% if template contains 'product' %} | |
| <meta name="twitter:card" content="product"> | |
| <meta name="twitter:title" content="{{ product.title }}" /> | |
| <meta name="twitter:description" content="{{ product.description | strip_html | strip_newlines | truncatewords: 160, '' | escape }}" /> |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
To open SQLite Things.app database run this command in Terminal.app:
$ sqlite3 ~/Library/Containers/com.culturedcode.things/Data/Library/Application\ Support/Cultured\ Code/Things/ThingsLibrary.db
In SQLite command-line type this query to get your tasks stats:
sqlite> .mode column
sqlite> .header on
sqlite> select zscheduler, zstatus, ztrashed, count(*) from ZTHING where z_ent = 13 group by zstatus,ztrashed order by Z_pk desc;
ZSCHEDULER ZSTATUS ZTRASHED count(*)
| from abc import ABCMeta, abstractmethod | |
| class AbstractModelMeta(ABCMeta, type(models.Model)): | |
| pass | |
| class ABCModel(models.Model): | |
| __metaclass__ = AbstractModelMeta | |
| class Meta: |
| // Determine if an element is in the visible viewport | |
| function isInViewport(element) { | |
| var rect = element.getBoundingClientRect(); | |
| var html = document.documentElement; | |
| return ( | |
| rect.top >= 0 && | |
| rect.left >= 0 && | |
| rect.bottom <= (window.innerHeight || html.clientHeight) && | |
| rect.right <= (window.innerWidth || html.clientWidth) | |
| ); |