Skip to content

Instantly share code, notes, and snippets.

@aGHz
aGHz / dothis.sh
Last active August 29, 2015 13:57
Install instructions for Python Text Analysis workshop
virtualenv --no-site-packages .
. bin/activate
pip install jinja2 tornado pyzmq ipython
pip install pattern
pip install numpy
sudo brew install gfortran
pip install scipy
### Keybase proof
I hereby claim:
* I am aGHz on github.
* I am aghz (https://keybase.io/aghz) on keybase.
* I have a public key whose fingerprint is 766F 087E 98A6 0413 734D A526 7C11 DD4F 7836 4FC0
To claim this, I am signing this object:
var fs = require('fs'),
zmq_sockets = require('./zmq_sockets'),
log4js = require('log4js');
log4js.loadAppender('file');
log4js.addAppender(log4js.appenders.file('/tmp/INode.log'));
var logger = log4js.getLogger("app");
function startKernel(configFile) {
@aGHz
aGHz / jira.css
Last active August 29, 2015 14:15
JIRA custom CSS
.ghx-issue-compact .ghx-end .ghx-statistic-badge {
margin-left: 34px;
}
.ghx-issue-compact .ghx-end .ghx-statistic-badge.ghx-spacer {
margin-left: 34px;
}
.ghx-issue-compact .ghx-end .ghx-avatar-img + .ghx-statistic-badge.ghx-spacer {
margin-left: 36px;
}
@aGHz
aGHz / jira.css
Created July 3, 2015 19:37
Jira skin
.ghx-issue-compact .ghx-end .ghx-statistic-badge {
margin-left: 34px;
}
.ghx-issue-compact .ghx-end .ghx-statistic-badge.ghx-spacer {
margin-left: 34px;
}
.ghx-issue-compact .ghx-end .ghx-avatar-img + .ghx-statistic-badge.ghx-spacer {
margin-left: 36px;
}
@aGHz
aGHz / gist:3758501
Created September 20, 2012 21:36
Compiling against Python.h installed by Homebrew

If compiling anything against a Python.h installed by homebrew install python raises the warning (promoted to an error) ‘PyArg_ParseTuple’ is an unrecognized format function type, review this Homebrew issue and then edit the appropriate pyconfig.h to comment out the line #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1.

@aGHz
aGHz / python_repr.md
Created October 30, 2012 14:48
Strange behaviour with repr() and __repr__ in Python

The Python builtin repr() doesn't seem to take into account the object's __repr__

class Foo(object):
    __repr__ = lambda self: "class"

    def __init__(self, a):
        self.__repr__ = lambda: "object"

foo = Foo('object')

print foo # "class"

table.prod-specs {
font-size: 12px;
width: 100%;
margin-bottom: 25px;
}
table.prod-specs thead {
border-bottom: 1px solid #000;
}
@aGHz
aGHz / gist:5781787
Last active December 18, 2015 12:19
A and Z are collections of closed segments defined by their 1-d endpoints.
Each is sorted according to the start position of the segment.
Place these segments on a line according to the following constraints:
- segments from Z must absolutely retain their position.
- if a segment from A starts before a segment from Z but overlaps with it,
split it in two. The part before the segment in Z retains its position, and
the second part comes after the segment from Z. This can happen multiple
times as needed.
- if a segment from A overlaps with a segment from Z but doesn't start
before, simply move it after the segment from Z.
@aGHz
aGHz / gist:6024190
Created July 17, 2013 20:32
Dat frequency
A = new webkitAudioContext();
vol = A.createGainNode(); vol.gain.value = 0.3; vol.connect(A.destination);
osc1 = A.createOscillator(); osc1.frequency.value = 40; osc1.noteOn(0); osc1.connect(vol);
osc2 = A.createOscillator(); osc2.frequency.value = 75; osc2.noteOn(0); osc2.connect(vol);