Skip to content

Instantly share code, notes, and snippets.

Mark Nottingham mnot

Block or report user

Report or block mnot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mnot
mnot / github.sh
Created Mar 15, 2014
Git alias handler for github
View github.sh
#!/bin/sh
# Github Handler
#
# Add to your .gitconfig like this:
#
# [alias]
# hub = !"github"
@mnot
mnot / gist:9660370
Created Mar 20, 2014
HTTP:// over TLS proposal
View gist:9660370
<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 Oct 24, 2014
Create some fake headers for HTTP/2 compression testing.
View fake_hdrs.py
#!/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',
View keybase.md

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:

View 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 Oct 29, 2009
libxslt_web.py: use XSLT on the "normal" Web
View libxslt_web.py
#!/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 Oct 29, 2009
sparkogram.py: Sparkline histogram generator
View sparkogram.py
#!/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 Nov 25, 2009
c_zlib.py: zlib for Python using ctypes
View c_zlib.py
#!/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 Dec 20, 2009
http_conn_timer.py: find out how long a HTTP server keeps connections open
View http_conn_timer.py
#!/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 Dec 27, 2009
xop_parser.py - A demonstration XOP Parser for SAX
View xop_parser.py
#!/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
You can’t perform that action at this time.