Skip to content

Instantly share code, notes, and snippets.

@brutus
brutus / wtf-html5.py
Created November 8, 2012 11:58
HTML5 in WTForms
# -*- coding: UTF-8 -*-
"""
WTForms HTML5 Widgets
~~~~~~~~~~~~~~~~~~~~~
This modul adds HTML5 widgets to WTForms_.
It supports the new INPUT types for fields and also sets some of the
new INPUT attributes automatically (based on widget type and what kind of
@brutus
brutus / decode_13.py
Created August 6, 2012 13:28
tsw decode
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import string
trans = string.maketrans(
string.lowercase,
string.lowercase[13:] + string.lowercase[:13]
``ab -r -n 200 -c 200 http://localhost:8080/``
* pure sockets (max 5 connections, sleeptime=0.25ms)
Time taken for tests: 16.932 seconds
Requests per second: 11.81 [#/sec] (mean)
Failed requests: 507
* pure sockets (max 500 connections, sleeptime=0.25ms)
Time taken for tests: 50.088 seconds
Requests per second: 3.99 [#/sec] (mean)
Failed requests: 0
* threads (max 500 connections, sleeptime=0.25ms)
@brutus
brutus / servbench.py
Created July 24, 2012 13:23
Very basic test server to try some stuff.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Serv Bench
Very basic test server to try some stuff.
"""
import sys