This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
import aiohttp | |
import asyncio | |
async def get_body(url): | |
response = await aiohttp.request('GET', url) | |
raw_html = await response.read() | |
return raw_html | |
async def main(): | |
# run them sequentially (but the loop can do other stuff in the meanwhile) |
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() |