Skip to content

Instantly share code, notes, and snippets.

View jamescasbon's full-sized avatar

James Casbon jamescasbon

View GitHub Profile
@jamescasbon
jamescasbon / attr_np_mp.py
Created March 31, 2019 11:20
Evil monkeypatch for numpy cmp with attrs
import attr
import numpy as np
import attr._make
original_make_cmp = attr._make._make_cmp
@jamescasbon
jamescasbon / gist:8707177
Last active August 29, 2015 13:55
difference between xdress clang and clang++
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
(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
(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 January 2, 2016 15:09
xdress clang build against llvm3.4 built from source
(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 February 15, 2013 12:35
pyvcf proposal to use funcparserlib to clarify parsing
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 February 26, 2018 02:03
VCF pandas demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jamescasbon
jamescasbon / foo.html
Created June 24, 2012 12:49
Test edit
<html>
<body>
<h1>hi</h1>
</body>
</html>
@jamescasbon
jamescasbon / example.py
Created June 20, 2012 21:27
Tornado github API client
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 April 18, 2012 20:02
Backbone.js handler for tornado and mongodb backed handler
"""
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