Skip to content

Instantly share code, notes, and snippets.

View mnot's full-sized avatar

Mark Nottingham mnot

View GitHub Profile
@mnot
mnot / example.py
Created March 22, 2017 04:30
This dies in a fire on 3.5.2, works on 3.6.
#!/usr/bin/env python
from typing import Optional, Type
class Foo(object):
pass
class Bar(Foo):
pass
@mnot
mnot / structured-fields.blab
Created July 9, 2020 11:08
structured fields blab
sf {
sf-string = DQUOTE chr* DQUOTE
sf-list = list-member ( OWS "," OWS list-member )*
list-member = sf-item
| inner-list
inner-list = "(" SP* ( sf-item ( SP+ sf-item )* SP* )? ")" parameters
@mnot
mnot / link_header.py
Created October 15, 2009 00:41
link_header.py: HTTP Link header parsing
@mnot
mnot / urlnorm.py
Created December 1, 2009 05:29
urlnorm.py: URL normalisation
#!/usr/bin/env python
"""
urlnorm.py - URL normalisation routines
urlnorm normalises a URL by;
* lowercasing the scheme and hostname
* taking out default port if present (e.g., http://www.foo.com:80/)
* collapsing the path (./, ../, etc)
* removing the last character in the hostname if it is '.'
@mnot
mnot / rename with date.applescript
Last active January 27, 2021 06:39
Applescript to rename a selected file, appending the current date
(*
Rename with Date 0.1
Copyright 2004 Mark Nottingham <mnot@mnot.net>
THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
AND ACKNOWLEDGEMENT OF AUTHORSHIP REMAIN.
*)
@mnot
mnot / http.rrtext
Last active November 11, 2019 03:22
Railroad diagrams of HTTP semantics
# Generated from the ABNF at <https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#collected.abnf>
# using <https://github.com/katef/kgt>
Accept:
,---------------------------------------------------------------------------------------------------------------------------.
| |
||--^--v----------------- "," ------------------>--v------------------------------------------------------------------------->-->--||
| | | |
| ,-------------------. | | ,-----------------------------------------------. |
| | | | | | | |
@mnot
mnot / json_form.js
Created May 30, 2010 05:21
json_form.js - JSON Form Submission
/*
json_form.js -- JSON Form Submission (version 0.5)
Copyright (c) 2006 Mark Nottingham <mnot@pobox.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@mnot
mnot / template_form.js
Created May 30, 2010 05:20
template_form.js - Templated form submission
/*
template_form.js -- Templated Form Submission (version 0.1)
Copyright (c) 2006 Mark Nottingham <mnot@pobox.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@mnot
mnot / update.sh
Last active July 9, 2019 04:55
Update all projects in a directory from their master repositories.
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for PROJECT in $DIR/*
do
if [ -d $PROJECT ] ; then
cd $PROJECT
# Git

In response to the Call for Proposals to HTTP/2, PHK published a draft with a number of suggested requirements.

This is a summary of those requirements, indicating those that have been met.

  • 3.3 Avoid header field encodings/transformations in intermediaries
  • 3.3 and 9 Envelope / content header field distinction
  • 3.3 Add session as "flow-label"
  • 3.3 Use prefix coding for length
  • 3.3 Indicate presence of body clearly
  • 4 Support legitimate cryptography