I hereby claim:
- I am graffic on github.
- I am graffic (https://keybase.io/graffic) on keybase.
- I have a public key whose fingerprint is D44E 1E92 061C 54D4 964F 4470 D075 45BC 53D6 9D57
To claim this, I am signing this object:
maze = """XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
XXX.XXXXX XXXXX XXXXXXXXXXX | |
XXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX | |
XXX XX XXXXXXXX XXX XXXX XXXXX XXXX | |
XXX XX XXXXXXXXXXXXXX XXXXXXXX XXX XXXX XXXXX XXXX | |
XXX XX XXXXXXXXXXXXXX XX X XXX XXX XXXX XXXXX XXXX | |
XXX XX XXX XXXXXX XX X XXX XXX XXXX XXXXX XXXX | |
XXX XX XXX XXX XXXXXX XX X XXX XXX XXXX XXXXX XXXX | |
XXX XX XXX XXX XXXXXX XX X XXX XXXXXXXXXX XXXXX XXXX | |
XXX XX XXX XXXXXX XX X XXX XXXXX XXXXX XXXX |
import aiohttp | |
import asyncio | |
async def get(index): | |
response = await aiohttp.get('http://httpbin.org/delay/%d' % index) | |
print(index, "Done") | |
response.close() | |
async def doMany(): | |
coros = [] |
I hereby claim:
To claim this, I am signing this object:
Uncle Bob 11 May 2014 Craftsmanship Frameworks are powerful tools. We'd be lost without them. But there's a cost to using them.
The relationship between a programmer and a framework is similar to the relationship between an executive and an administrative assistant. The framework takes care of all the necessary details, so that the executive can focus on high level decisions.
Think of Rails, or Spring, or JSF, or Hibernate. Think about what writing a web system would be like without these frameworks to help you. The idea is disheartening. There'd be so many little piddling details to deal with. It'd be like endeavoring to construct a mnemonic memory circuit using stone knives and bearskins[1].
And so we gleefully use those glittering frameworks. We joyously intermingle our code with the frameworks' in anticipation of all the benefits they promise. We make the mistake that so many executives have made before us. We marry our secretary.
""" | |
ZODB support in flask | |
Usage: `DB = FlaskZODB(APP)` | |
In your views use `DB.root` to get the database root dictionary. | |
""" | |
from flask import _app_ctx_stack as stack | |
import transaction | |
import zodburi |
def bootstrap(config_uri, options=None): | |
""" | |
Bootstraps a pyramid environment | |
Differences with the default pyramid bootstrap: | |
- It handles tasks.base_url | |
""" | |
app = get_app(config_uri, options=options) | |
registry = global_registries.last | |
base_url = registry.settings.get('tasks.base_url', None) |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: FastCGI servers for Django | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start FastCGI servers with Django. | |
# Description: Django, in order to operate with FastCGI, must be started | |
# in a very specific way with manage.py. This must be done |
server { | |
... | |
# This is a copy&paste snippet to put your server in maintenance mode | |
error_page 503 @maintenance; | |
location @maintenance { | |
rewrite ^(.*)$ /maint.html break; | |
} | |
return 503; |
if (type.IsMap()) | |
{ | |
Label work = il.DefineLabel(); | |
Label getNext = il.DefineLabel(); | |
Label end = il.DefineLabel(); | |
il.EmitLd(arg_writer); | |
// 1. Get length of the dictionary | |
il.EmitLd(arg_obj); |
#!/usr/bin/python | |
import httplib, time | |
from flights_pb2 import SearchRequest | |
class FlightsService(object): | |
"""Basic Flights service implementation with common methods""" | |
def __init__(self,host="10.0.0.210",port=80): | |
self.__ws = httplib.HTTPConnection(host,port) |