Skip to content

Instantly share code, notes, and snippets.

@jacquerie
jacquerie / mindfuck.py
Last active August 29, 2015 14:23
Explicit assignment and `+=` yield different results if the index produces side effects
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from itertools import count
a = [1, 10]
b = [1, 10]
c1 = count(0).next
c2 = count(0).next
@jacquerie
jacquerie / README.mdown
Last active February 8, 2016 12:55
Generate and use GROBID bindings with PyXB

Generate and use GROBID bindings with PyXB

  1. Install PyXB and IPython:

    $ pip install ipython pyxb
  2. Generate the bindings:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utility script to build the Invenio Status Dashboard."""
from __future__ import print_function
import sys
@jacquerie
jacquerie / grobid.py
Created October 30, 2015 15:46
Python-driven GROBID retraining
#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import grobid_core
import grobid_trainer
if __name__ == '__main__':
@jacquerie
jacquerie / 4gq25.txt
Created January 9, 2016 14:39
$ outguess -r 4gq25.jpg 4gq25.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello.
The path lies empty; epiphany seeks the devoted.
Liber Primus is the way. Its words are the map, their
meaning is the road, and their numbers are the direction.
@jacquerie
jacquerie / stdout.txt
Created January 9, 2016 22:39
$ mdls 23.jpg
kMDItemBitsPerSample = 32
kMDItemColorSpace = "RGB"
kMDItemContentCreationDate = 2016-01-09 13:02:34 +0000
kMDItemContentModificationDate = 2016-01-09 13:02:34 +0000
kMDItemContentType = "public.jpeg"
kMDItemContentTypeTree = (
"public.jpeg",
"public.image",
"public.data",
"public.item",
@jacquerie
jacquerie / 0_reuse_code.js
Created July 8, 2016 20:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console