Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dimazest
dimazest / list.txt
Created October 11, 2016 15:31
Macports
Xft2
android
aspell
aspell-dict-en
auctex
autoconf
automake
bash
bash-completion
bzip2
@dimazest
dimazest / bug.ipynb
Last active October 9, 2015 20:59
pytables index, nan values
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dimazest
dimazest / similarity.py
Created April 11, 2015 15:46
Semantic similarity
import pandas as pd
from gensim.models.word2vec import Word2Vec
words = pd.read_csv('wordsim.txt', header=None, names=('word1', 'word2', 'phonetic similarity'))
model = Word2Vec.load_word2vec_format('/GoogleNews-vectors-negative300.bin', binary=True)
def similarity(r):
try:
@dimazest
dimazest / gist:2717e2c2730fc44bf450
Created January 31, 2015 15:11
random, yet matching colors
from colorsys import rgb_to_hls, hls_to_rgb
import random
def colors():
r, g, b = 1, 0, 0
h, l, s = rgb_to_hls(r, g, b)
while True:
@dimazest
dimazest / produce.ini
Created September 25, 2014 20:26
Produce playground
[]
bin = ../../bin
corpora = %{bin}/corpora
fowler_corpora_py = %{bin}/fowler.corpora-py
bnc_corpus = bnc+ccg://${PWD}/CCG_BNC_v1
# Get the wordsim353 similarity dataset
[data/wordsim353.csv]
recipe =
@dimazest
dimazest / bigo.py
Last active August 29, 2015 14:06
Big-O Hands-on: Prolific Words
def words(path):
with open(path) as f:
for line in f:
for word in line.strip().split():
yield ''.join(filter(str.isalpha, word.lower()))
def recursive(word, dictionary):
if not word:
return
p = nltk.parse.malt.MaltParser(
bin='/Users/dimazest/qmul/tools/parts/malt-1.7.2/dist/maltparser-1.7.2/maltparser-1.7.2.jar',
mco='engmalt.linear-1.7',
working_dir='/Users/dimazest/qmul/tools/sw/',
additional_java_args=['-Xmx512m'],
)
p.parse('a man runs'.split()).tree(
@dimazest
dimazest / circus.ini
Created July 9, 2014 11:33
poultry deployment
[circus]
statsd = True
httpd = True
httpd_host = localhost
httpd_port = 8081
[watcher:poultry]
cmd = ./poultry filter -c poultry.cfg -s twitter://filter -v
singleton = True
stop_children = True
[rewrites]
github =
url ~ ^https://github.com/
git@github.com:
kind = git
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the