Skip to content

Instantly share code, notes, and snippets.

mattions / matplotlibrc
Last active Oct 7, 2017 — forked from huyng/matplotlibrc
Matplotlib style to have a default similar to ggplot2. Inspired by
View matplotlibrc
# 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 overwritten in your next install.
# If you want to keep a permanent local copy that will not be
# overwritten, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
# Upgrade your requirements
# - Finds outdated package with pip
# - install latest stable version
# - Update the requirements with the latest
pip list --outdated | cut -d' ' -f1 | xargs pip install --upgrade
pip freeze > requirements.txt
View dockerfile
# blackkiwi - production app
FROM mattions/webber:1.0
MAINTAINER mattions ""
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -qy install\
python3 \
mattions /
Created Dec 18, 2013
quick embedded Gunicorn app
from import Application, Config
class GUnicornFlaskApplication(Application):
def __init__(self, app):
self.usage, self.callable, self.prog, = None, None, None, app
def run(self, **options):
self.cfg = Config()
[self.cfg.set(key, value) for key, value in options.items()]
View python_r_NGS
"metadata": {
"name": "reading stuff in"
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
"cells": [
mattions / NGS_notes.ipnb
Last active Dec 20, 2015
Notes on the NGS course
View NGS_notes.ipnb
"metadata": {
"name": "NGS"
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
"cells": [
mattions /
Last active Dec 19, 2015
Checking if a sentence goes away from a page.
import requests
import time
from datetime import datetime
from bs4 import BeautifulSoup
SENTENCE_WHICH_SHOULD_CHANGE="There were no results"
article_out = False
View postmkvirtualenv
# This hook is run after a new virtualenv is activated.
# ~/.virtualenvs/postmkvirtualenv
libs=( PyQt4 )
python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))")
var=( $(which -a $python_version) )
get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
mattions /
Last active Dec 15, 2015
a bunch of sin and cos
import numpy as np
import pylab as pl
from numpy import sin, cos
x = np.linspace(-10, 10, 500)
pl.plot(x, sin(x), label="sin")
pl.plot(x, cos(x), label="cos")
pl.plot(x, sin(x) + cos(x), label="sin + cos")
pl.plot(x, pow(sin(x), 2), label = "sin^2")
mattions /
Created Jan 10, 2013
Widgets to deal with time and dates, created putting together different solutions. Just storing them here if I ever need them.
import re
import django.forms
from django.forms.widgets import Widget, Select
from django.utils.safestring import mark_safe
from django.forms.widgets import MultiWidget
from django.forms.extras.widgets import SelectDateWidget
__all__ = ('SelectTimeWidget', 'SplitSelectDateTimeWidget')
You can’t perform that action at this time.