Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am chaosct on github.
  • I am chaosct (https://keybase.io/chaosct) on keybase.
  • I have a public key ASBOYTIlF3p0JYGSVxX1Nu21KJD39WP2s5q8ZBIGjmTWkgo

To claim this, I am signing this object:

@chaosct
chaosct / crashing_xmm.py
Last active March 8, 2016 16:30
replicating XMM crash
import xmm
import numpy as np
class GMM_regression(object):
def __init__(self):
self.clear(3,8)
def clear(self, idim = None, odim = None):
self.input_dimensions = idim or self.input_dimensions
@chaosct
chaosct / README.md
Created October 29, 2015 14:36
simple CORS flask server

Install

virtualenv env
. env/bin/enable
pip install -r requirements.txt
python upload_server.py
@chaosct
chaosct / mytest.py
Created October 20, 2015 22:34
Demo ofxPython presentation
#test
import random
from openframeworks import *
print "-"*30
class circle(object):
def __init__(self):
self.behavior = self.move()
@chaosct
chaosct / cleanbib.py
Last active September 26, 2016 17:08
Script to clean (and sort) the bibfile exported by Mendeley
# Script to clean (and sort) the bibfile exported by mendeley
# It is then apt for versioning
# Author: Carles F. Julià <carles.fernandez(AT)upf.edu>
# You will need bibtexparser package:
# $ pip install bibtexparser
# usage: cleanbib.py library.bib
# WARNING: it overwrites the original file
@chaosct
chaosct / ButtonFunction.h
Created April 26, 2014 23:08
ofxUI better buttons
template<typename F>
class ButtonFunction
{
ofxUIButton * widget;
F f;
public:
ButtonFunction(ofxUIButton * b, F _f):widget(b), f(_f)
{
ofxUICanvas * gui = static_cast<ofxUICanvas*>(widget->getCanvasParent());
ofAddListener(gui->newGUIEvent, this, &ButtonFunction::guiEvent);
@chaosct
chaosct / list.txt
Created October 17, 2013 14:32
parlamentarian data extraction scripts on github -Spain
Catalunya
https://github.com/codehead/OpenParlament
Galicia
https://github.com/jjelosua/ParlamentoGalicia
https://github.com/dpino/galparl
España
@chaosct
chaosct / log_class_members.py
Last active December 18, 2015 14:28
decorator to log calls on class members
def log(f):
def logme(self, *args, **kwargs):
sargs = ", ".join([repr(a) for a in args])
skwargs = ", ".join(["{}={}".format(k, v) for (k, v) in kwargs.iteritems()])
print "{}.{}({})".format(self, f.__name__, ", ".join([sargs, skwargs]))
return f(self, *args, **kwargs)
return logme
@chaosct
chaosct / soziframes.js
Created February 22, 2012 00:35
sozi frame generator using phantomjs
/*
soziframes.js : transforming sozi SVG animations
to a sequence of PNG images, so you can make
a proper video without capturing the screen.
author: Carles F. Julià < chaos.ct _AT_ gmail com >
You need phantomjs to run it!
*/
var page = require('webpage').create(),