Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active May 9, 2025 01:58
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@ShawnMilo
ShawnMilo / validate_uuid4.py
Created December 3, 2013 20:55
Validating a uuid4 with Python.
from uuid import UUID
def validate_uuid4(uuid_string):
"""
Validate that a UUID string is in
fact a valid uuid4.
Happily, the uuid module does the actual
checking for us.
@ulope
ulope / gist:1935894
Created February 28, 2012 23:06
Python: super(ClassName, self) vs. super(self.__class__, self)
"""Simple example showing why using super(self.__class__, self) is a BAD IDEA (tm)"""
class A(object):
def x(self):
print "A.x"
class B(A):
def x(self):
print "B.x"
super(B, self).x()