Skip to content

Instantly share code, notes, and snippets.

View rhizoome's full-sized avatar
💭
Gluing elephants to the ceiling

Jean-Louis Fuchs rhizoome

💭
Gluing elephants to the ceiling
View GitHub Profile
@rhizoome
rhizoome / ipython_tools.py
Created September 23, 2012 18:59
Prints tables and objects as html-tables / Hide input-boxes from notebooks.
This git got too large. I created a repo: https://github.com/adfinis-sygroup/adsy-python
@rhizoome
rhizoome / solarized.py
Created October 9, 2012 11:19
Solarized theme for IPython code mirror editor
from IPython.core.display import HTML
def solarized():
"""Solarized code mirror theme."""
html = """
<style type="text/css">
.cm-s-ipython { background-color: #002b36; color: #839496; }
.cm-s-ipython span.cm-keyword {color: #859900; font-weight: bold;}
.cm-s-ipython span.cm-number {color: #b58900;}
.cm-s-ipython span.cm-operator {color: #268bd2; font-weight: bold;}
@rhizoome
rhizoome / install.sh
Created October 14, 2012 11:51
Installing inspyred on python3
git clone https://github.com/rkruppe/paver.git
cd paver/
git checkout python3
cd ..
pip-3.2 install inspyred
cd build/inspyred
cp ../../paver/paver-minilib.zip .
python3 setup.py install
@rhizoome
rhizoome / DBpedia.py
Created December 5, 2012 09:14
DBpedia to sqlite
#/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import sqlite3
import re
import time
from dateutil import parser
c = sqlite3.connect("dbpedia.sqlite")
c.row_factory = sqlite3.Row
@rhizoome
rhizoome / webserver_stat_collector.py
Last active June 30, 2016 12:01
Monte Carlo Webserver Statistics Collector
#/usr/bin/env python3
# -*- coding: utf-8 -*-
# _______ _______ _ _________ _ _______
# |\ /|( ___ )( ____ )( ( /|\__ __/( ( /|( ____ \
# | ) ( || ( ) || ( )|| \ ( | ) ( | \ ( || ( \/
# | | _ | || (___) || (____)|| \ | | | | | \ | || |
# | |( )| || ___ || __)| (\ \) | | | | (\ \) || | ____
# | || || || ( ) || (\ ( | | \ | | | | | \ || | \_ )
# | () () || ) ( || ) \ \__| ) \ |___) (___| ) \ || (___) |
In [8]: df = pandas.DataFrame(['tree', 'water']); df
Out[8]:
0
0 tree
1 water
In [9]: df[0].str.match("(.*ree.*)")
Out[9]:
0 (tree)
1 []
ldapdb = collections.namedtuple("namespace", ['person', 'group', 'share', 'maillist'])
ldapdb.person = ldap_to_pandas(ldap.search(filter="(&(objectClass=univentionPerson))", base=common.ucs_access.base_dn()))
ldapdb.group = ldap_to_pandas(ldap.search(filter="(&(objectClass=univentionGroup))", base=common.ucs_access.base_dn()))
ldapdb.share = ldap_to_pandas(ldap.search(filter="(&(objectClass=univentionShare))", base=common.ucs_access.base_dn()))
ldapdb.maillist = ldap_to_pandas(ldap.search(filter="(&(objectClass=univentionMailList))", base=common.ucs_access.base_dn()))
@rhizoome
rhizoome / .vim
Last active December 19, 2015 05:09
Current vim config and bundles See also: https://github.com/ganwell/rmux
" Basic initialization for RMUX change if need, add your settings
set nocp
let &rtp .= expand(",$RMUXDIR/vim,$RMUXDIR/vim/after")
" let $PYTHONPATH .= expand(":$RMUXDIR/vim/jedi")
call pathogen#infect()
call pathogen#helptags()
syntax on
filetype plugin on
@rhizoome
rhizoome / gist:6892827
Created October 8, 2013 22:23
not my shader.. but I have to copy it
const float rmin = 0.414213562373095; // sqrt(2) - 1
const float rmax = 1.0;
const float pi = 3.14159265358979;
float circles_mask(vec2 uv, float phase){
float r = mix(rmin, rmax, phase);
float l = length(mod(uv, 1.0)*2.0 - 1.0) - r;
float fw = fwidth(l)*0.5;
@rhizoome
rhizoome / gist:7451514
Created November 13, 2013 16:01
extract_method plan
{
"metadata": {
"name": "deparse - explore jedi parse"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{