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 React, {PropTypes} from 'react'; | |
import cx from 'classnames'; | |
import cs from './Text.scss'; | |
/** | |
* Material-UI doesn't expose the Material Design typography in the | |
* current stable version, but the upcoming major version does so | |
* (https://github.com/callemall/material-ui/blob/next/src/Text/Text.js). | |
* As the upcoming relase is currently in alpha version, this | |
* component is back-ported so its API can already be used. |
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
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
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
""" | |
Dependencies: | |
pip install tabulate simplejson ujson yajl msgpack | |
""" | |
from timeit import timeit | |
from tabulate import tabulate | |
setup = '''d = { | |
'words': """ |
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 python | |
""" | |
===================================== | |
PEP 20 (The Zen of Python) by example | |
===================================== | |
Usage: %prog | |
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com |
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 python | |
# -*- coding: utf-8 -*- | |
"""[application description here]""" | |
__appname__ = "[application name here]" | |
__author__ = "Stephan Sokolow (deitarion/SSokolow)" | |
__version__ = "0.0pre0" | |
__license__ = "GNU GPL 3.0 or later" | |
import logging |