Skip to content

Instantly share code, notes, and snippets.


Mark Nottingham mnot

View GitHub Profile
View cgmailstats.rb
require 'nokogumbo'
require 'date'
require 'json'
start = - 105
results = {}
index = ''
groups = Nokogiri::HTML5.get(index)
groups ='a.h3').map {|a| a['href'].sub(/^#/, '')}

Keybase proof

I hereby claim:

  • I am mnot on github.
  • I am 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 /
Created Oct 24, 2014
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 = [
mnot / apple_pipeline
Last active Jun 29, 2017
Apple doing HTTP pipeline testing
View apple_pipeline GET /configurations/pep/pipeline/pipeline0.html HTTP/1.1
Connection: Keep-Alive
GET /configurations/pep/pipeline/pipeline1.html HTTP/1.1
Connection: Keep-Alive
GET /configurations/pep/pipeline/pipeline2.html HTTP/1.1
mnot / gist:9660370
Created Mar 20, 2014
HTTP:// over TLS proposal
View gist:9660370
<section anchor="opportunistic" title="Discovering TLS Support for http:// URIs">
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
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 /
Created Mar 15, 2014
Git alias handler for github
# Github Handler
# Add to your .gitconfig like this:
# [alias]
# hub = !"github"
mnot / ietf_flying_times.js
Created Jun 4, 2013
Figure out how long it takes to get to a set of airports from a "home" location.
View ietf_flying_times.js
#!/usr/bin/env node
var argv = require('optimist').argv
var http = require('http');
var $ = require('jquery');
var ietf_airports = {
IETF_airports: [
mnot /
Last active Dec 16, 2015
Summarise how a list of HTTP servers handles a particular request to a set of URLs.
Summarise how a list of HTTP servers handles a particular request to a
set of URLs.
You can modify the request by either:
* Adding headers with the -a flag; e.g.,
mnot /
Last active Jul 9, 2019
Update all projects in a directory from their master repositories.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for PROJECT in $DIR/*
if [ -d $PROJECT ] ; then
# Git
mnot /
Created Jan 20, 2013
Convert an IRI to a URI
import urllib
import urlparse
def iri_to_uri(iri, encoding='Latin-1'):
"Takes a Unicode string that can contain an IRI and emits a URI."
scheme, authority, path, query, frag = urlparse.urlsplit(iri)
scheme = scheme.encode(encoding)
if ":" in authority:
host, port = authority.split(":", 1)
authority = host.encode('idna') + ":%s" % port