Skip to content

Instantly share code, notes, and snippets.

View mnot's full-sized avatar

Mark Nottingham mnot

View GitHub Profile
@mnot
mnot / github.sh
Created March 15, 2014 21:51
Git alias handler for github
#!/bin/sh
# Github Handler
#
# Add to your .gitconfig like this:
#
# [alias]
# hub = !"github"
@mnot
mnot / gist:9660370
Created March 20, 2014 09:44
HTTP:// over TLS proposal
<section anchor="opportunistic" title="Discovering TLS Support for http:// URIs">
<t>
A server wishing to advertise support for HTTP/2 over TLS for http:// URIs MAY do so by
including an Alt-Svc (see <xref target="AltSvc"/>) response header with the "h2" protocol
identifier.
</t>
<t>
For example, a HTTP/1 connection could indicate support for HTTP/2 on port 443 for use
with future http:// URI requests with this Alt-Svc header:
@mnot
mnot / fake_hdrs.py
Created October 24, 2014 10:32
Create some fake headers for HTTP/2 compression testing.
#!/usr/bin/env python
from random import choice, sample, randrange
from string import lowercase
iterations = 10000
authorities = [
'www.foo.com',
'api1.backend.region.bar.com:8000',
@mnot
mnot / keybase.md
Last active August 29, 2015 14:08

Keybase proof

I hereby claim:

  • I am mnot on github.
  • I am mnot (https://keybase.io/mnot) on keybase.
  • I have a public key whose fingerprint is 1F25 A21D 3C2A 7F22 4C25 389F 4A67 D3E9 3BDE FDDE

To claim this, I am signing this object:

@mnot
mnot / cgmailstats.rb
Last active August 29, 2015 14:11 — forked from rubys/cgmailstats.rb
require 'nokogumbo'
require 'date'
require 'json'
start = Date.today - 105
results = {}
index = 'http://www.w3.org/community/groups/'
groups = Nokogiri::HTML5.get(index)
groups = groups.search('a.h3').map {|a| a['href'].sub(/^#/, '')}
@mnot
mnot / libxslt_web.py
Created October 29, 2009 12:47
libxslt_web.py: use XSLT on the "normal" Web
#!/usr/bin/env python2.4
"""
libxslt_web - XSLT Extension Functions for the HTML Web
This is a set of XSLT extension functions that give access to HTTP mechanisms and HTML
documents (even those that are invalid) on the Web.
In particular, it offers;
- GET and POST support, with control over the POST body and content-type
@mnot
mnot / sparkogram.py
Created October 29, 2009 12:49
sparkogram.py: Sparkline histogram generator
#!/usr/bin/env python
"""
sparkogram.py - Sparkline histogram generator
This is quick and dirty. Based on Joe Gregorio's sparkline thoughts;
<http://bitworking.org/news/Sparklines_in_data_URIs_in_Python>.
"""
__license__ = """
@mnot
mnot / c_zlib.py
Created November 25, 2009 04:03
c_zlib.py: zlib for Python using ctypes
#!/usr/bin/env python
"""
c_zlib - zlib for Python using ctypes.
This is a quick and nasty implementation of zlib using Python ctypes, in order to expose the ability
to set a compression dictionary (which isn't available in the zlib module).
"""
__license__ = """
@mnot
mnot / http_conn_timer.py
Created December 20, 2009 04:40
http_conn_timer.py: find out how long a HTTP server keeps connections open
#!/usr/bin/env python
"""
http_conn_timer.py
by Mark Nottingham <mnot@pobox.com>
How long does a given HTTP server hold persistent connections open?
Requires Twisted <http://twistedmatrix.com/>
"""
@mnot
mnot / xop_parser.py
Created December 27, 2009 10:33
xop_parser.py - A demonstration XOP Parser for SAX
#!/usr/bin/env python
"""
xop_parser.py - A demonstration XOP Parser for SAX
Based upon: http://www.w3.org/2000/xp/Group/3/06/Attachments/XOP.html
THIS SOFTWARE IS EXPERIMENTAL - INTERFACES MAY CHANGE AT ANY TIME.
CAVEATS / TODO:
- requires python 2.3 AFAIK