Skip to content

Instantly share code, notes, and snippets.

View ivoflipse's full-sized avatar

Ivo Flipse ivoflipse

View GitHub Profile
### Keybase proof
I hereby claim:
* I am ivoflipse on github.
* I am ivoflipse (https://keybase.io/ivoflipse) on keybase.
* I have a public key ASCreUlttRdEF64K8YpgFe7YmIcUA6Azy-IGT8UAXlC0rQo
To claim this, I am signing this object:
@ivoflipse
ivoflipse / scalebars.py
Created July 4, 2016 15:29 — forked from dmeliza/scalebars.py
matplotlib: add scale bars to axes
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# Adapted from mpl_toolkits.axes_grid2
# 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, **kwargs):
"""
# -*- coding: utf-8 -*-
"""
Flask-Login example
===================
This is a small application that provides a trivial demonstration of
Flask-Login, including remember me functionality.
:copyright: (C) 2011 by Matthew Frazier.
:license: MIT/X11, see LICENSE for more details.
"""
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.
{
"metadata": {
"name": "VTK"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@ivoflipse
ivoflipse / ivoflipse.manifest
Last active August 29, 2015 14:02
AngularJS [Review] for Flipse R&D
# 'title' should be 50 characters or less, as a rule of thumb
# 'summary' will be used as the article summary on some pages instead of the article text
# 'published' is an epoch timestamp. you can convert your timestamps here: http://www.epochconverter.com/
# 'type' can be one of ['post', 'guide', 'video'] and is used for routing articles to the correct pages
title: AngularJS [Review]
author: http://github.com/ivoflipse
summary: Review of the O'Reilly book about AngularJS
published: 1402662731
type: post
@ivoflipse
ivoflipse / ivoflipse.manifest
Last active September 10, 2015 15:51
A Walk Through Random Forests for Flipse R&D
# 'title' should be 50 characters or less, as a rule of thumb
# 'summary' will be used as the article summary on some pages instead of the article text
# 'published' is an epoch timestamp. you can convert your timestamps here: http://www.epochconverter.com/
# 'type' can be one of ['post', 'guide', 'video'] and is used for routing articles to the correct pages
title: A Walk Through Random Forests
author: http://github.com/ivoflipse
summary: Presentation for the Amsterdam Python Meetup about Random Forests in Python
published: 1402050216
type: post
@ivoflipse
ivoflipse / README.md
Last active December 21, 2015 02:09
Twitter Stream sample for Kronos without any keys

About twitterstream.py:

Used to fetch live stream data from twitter.

Requires oauth2, which is not part of the EnThought Python library.

usage: Open the program and replace access_token_key, access_token_secret, consumer_key, and consumer_secret with the appropriate values. Then run $ python twitterstream.py

To get credentials:

from PySide import QtGui, QtCore
import sys
class Dialog(QtGui.QDialog):
MESSAGE = QtCore.QT_TR_NOOP("<p>Message boxes have a caption, a text, and up to "
"three buttons, each with standard or custom texts.</p>"
"<p>Click a button or press Esc.</p>")
def __init__(self, parent=None):
QtGui.QDialog.__init__(self, parent)
@ivoflipse
ivoflipse / pyside_grid.py
Last active December 20, 2015 16:18
Small example of using a grid layout
from PySide import QtGui
import sys
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.input_widget = InputWidget(self)
self.layout = QtGui.QVBoxLayout()
self.layout.addWidget(self.input_widget)