Skip to content

Instantly share code, notes, and snippets.

James Casbon jamescasbon

  • Brighton, UK
Block or report user

Report or block jamescasbon

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
@jamescasbon
jamescasbon / attr_np_mp.py
Created Mar 31, 2019
Evil monkeypatch for numpy cmp with attrs
View attr_np_mp.py
import attr
import numpy as np
import attr._make
original_make_cmp = attr._make._make_cmp
@jamescasbon
jamescasbon / gist:8707177
Last active Aug 29, 2015
difference between xdress clang and clang++
View gist:8707177
Compiling with clang++ with the same options as cindex uses
❯ clang++ -v -std=c++11 -I. -c build/sodium_sodium.cpp-sodium_sodium.h.cpp
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.2
View build.log
(xdress)~/S/xdress git:clang ❯❯❯ python setup.py build ⬆ ✱
XXXXXXX XXXXXXXDDDDDDDDDDDDD
X:::::X X:::::XD::::::::::::DDD
X:::::X X:::::XD:::::::::::::::DD
X::::::X X::::::XDDD:::::DDDDD:::::D
XXX:::::X X:::::XXX D:::::D D:::::D
X:::::X X:::::X D:::::D D:::::D
X:::::X:::::X D:::::D D:::::D
X:::::::::X D:::::D D:::::D
View log.txt
(xdress)~/S/xdress git:clang ❯❯❯ python setup.py build ⬆
XXXXXXX XXXXXXXDDDDDDDDDDDDD
X:::::X X:::::XD::::::::::::DDD
X:::::X X:::::XD:::::::::::::::DD
X::::::X X::::::XDDD:::::DDDDD:::::D
XXX:::::X X:::::XXX D:::::D D:::::D
X:::::X X:::::X D:::::D D:::::D
X:::::X:::::X D:::::D D:::::D
X:::::::::X D:::::D D:::::D
@jamescasbon
jamescasbon / build-3.3.log
Last active Jan 2, 2016
xdress clang build against llvm3.4 built from source
View build-3.3.log
(xdress)~/S/xdress git:clang ❯❯❯ unset CPPFLAGS
(xdress)~/S/xdress git:clang ❯❯❯ unset LD_LIBRARY_PATH
(xdress)~/S/xdress git:clang ❯❯❯ python setup.py build
XXXXXXX XXXXXXXDDDDDDDDDDDDD
X:::::X X:::::XD::::::::::::DDD
X:::::X X:::::XD:::::::::::::::DD
X::::::X X::::::XDDD:::::DDDDD:::::D
XXX:::::X X:::::XXX D:::::D D:::::D
X:::::X X:::::X D:::::D D:::::D
@jamescasbon
jamescasbon / funcparserlib_vcf.py
Created Feb 15, 2013
pyvcf proposal to use funcparserlib to clarify parsing
View funcparserlib_vcf.py
import sys
import os
import re
import logging
import collections
import pprint
from funcparserlib.lexer import make_tokenizer, Spec
from funcparserlib.parser import (maybe, many, eof, skip, fwd, name_parser_vars, SyntaxError)
from funcparserlib.contrib.common import const, n, op, op_, sometok
@jamescasbon
jamescasbon / vcf.ipynb
Last active Feb 26, 2018
VCF pandas demo
View vcf.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View foo.html
<html>
<body>
<h1>hi</h1>
</body>
</html>
@jamescasbon
jamescasbon / example.py
Created Jun 20, 2012
Tornado github API client
View example.py
import tornado.ioloop
import tornado.web
import tornado.escape
import tornado.options
import tornado.httputil
import jinja2
import pyjade.compiler
import coffeescript
import markdown
@jamescasbon
jamescasbon / backbonehandler.py
Created Apr 18, 2012
Backbone.js handler for tornado and mongodb backed handler
View backbonehandler.py
"""
Backbone.js handler and mongodb based handler for Tornado.
`BackboneHandler` handles the sync protocol for Backbone.js. Inherit
from the class and implement the model methods:
* create_model
* update_model
* get_model
* delete_model
* get_collection
You can’t perform that action at this time.