Skip to content

Instantly share code, notes, and snippets.

View ivoflipse's full-sized avatar

Ivo Flipse ivoflipse

View GitHub Profile
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
@andrewbunday
andrewbunday / gist:1358794
Created November 11, 2011 18:30
Greenlet based PyQt and Flask application
#!/usr/bin/env python
import sys
import time
from flask import Flask
from PyQt4 import QtCore, QtGui, QtWebKit
import gevent.wsgi
@kohlmeier
kohlmeier / ka_bnet_pandas.py
Created March 26, 2012 22:32
Bayes net example (Pandas version)
#!/usr/bin/env python
from pandas import DataFrame, Series
import numpy as np
import math
import random
import copy
NaN_Flag = -1 # pandas uses np.nan, but that coerces ints to floats :(
@schlamar
schlamar / processify.py
Last active June 11, 2024 12:46
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value
@mbostock
mbostock / .block
Last active January 8, 2024 14:38
Heatmap
license: gpl-3.0
height: 673
@dmeliza
dmeliza / scalebars.py
Last active February 7, 2023 00:33
matplotlib: add scale bars to axes
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# Adapted from mpl_toolkits.axes_grid1
# LICENSE: Python Software Foundation (http://docs.python.org/license.html)
from matplotlib.offsetbox import AnchoredOffsetbox
class AnchoredScaleBar(AnchoredOffsetbox):
def __init__(self, transform, sizex=0, sizey=0, labelx=None, labely=None, loc=4,
pad=0.1, borderpad=0.1, sep=2, prop=None, barcolor="black", barwidth=None,
**kwargs):
@socrateslee
socrateslee / python-dtw.py
Created August 5, 2012 16:25
Simple DTW(Dynamic time wrapping) in python
# -*- coding: utf-8 -*-
# An pure python implemetation of Dynamic Time Warpping
# http://en.wikipedia.org/wiki/Dynamic_time_warping
class Dtw(object):
def __init__(self, seq1, seq2, distance_func=None):
'''
seq1, seq2 are two lists,
distance_func is a function for calculating
@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@z-m-k
z-m-k / LICENSE
Last active October 30, 2016 22:37
A Python class that allows to incorporate d3js and Python (IPython notebook mainly). See at: http://nbviewer.ipython.org/4484816/ipyD3sample.ipynb
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active January 22, 2024 11:18
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time