Skip to content

Instantly share code, notes, and snippets.

View Keybase
### Keybase proof
I hereby claim:
* I am bbc2 on github.
* I am bertrandbc (https://keybase.io/bertrandbc) on keybase.
* I have a public key whose fingerprint is 9632 F322 CF0D 0BB6 9262 DA31 82ED DC1E 8CAB 3D73
To claim this, I am signing this object:
@bbc2
bbc2 / code_in_a_list.org
Last active Aug 29, 2015
GitHub org-mode markup list code bug
View code_in_a_list.org

The code block has an extra line at the end:

  • See:
    # some code
    print('hello world!')
        
@bbc2
bbc2 / begin.v
Created Dec 10, 2014
Proofs on addition and multiplication in Coq
View begin.v
Fixpoint add (x:nat) (y:nat) : nat :=
match x with
| 0 => y
| S z => S (add z y)
end.
Lemma add_0 : forall x, add x 0 = x.
intros x.
induction x.
- reflexivity.
@bbc2
bbc2 / json_parser.py
Created Dec 10, 2014
Naive JSON parser
View json_parser.py
#!/usr/bin/env python
import re
import sys
HEX_DIGITS = '0123456789abcdefABCDEF'
NUMBER_RE = re.compile(r'-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?')
class ParseError(Exception):
pass
@bbc2
bbc2 / client.py
Created Nov 30, 2014
CoAP server bug
View client.py
import asyncio
import aiocoap
@asyncio.coroutine
def observe(protocol, addr):
host, port = addr
request = aiocoap.Message(code=aiocoap.GET)
request.set_request_uri('coap://{}:{}/time'.format(host, port))
request.opt.observe = 0
requester = protocol.request(request)
You can’t perform that action at this time.