Skip to content

Instantly share code, notes, and snippets.

View smutch's full-sized avatar

Simon Mutch smutch

View GitHub Profile
@smutch
smutch / gfm.py
Created December 10, 2011 01:23 — forked from Wilfred/gfm.py
Github flavoured markdown pre-processor
"""GitHub flavoured markdown: because normal markdown has some vicious
gotchas.
Further reading on the gotchas:
http://blog.stackoverflow.com/2009/10/markdown-one-year-later/
This is a Python port of GitHub code, taken from
https://gist.github.com/901706
To run the tests, install nose ($ easy_install nose) then:
@smutch
smutch / dummy_axis.py
Created July 18, 2012 06:41
Example usage of a dummy axis.
#!/usr/bin/env python
"""Script to illustrate use of dummy axis."""
import numpy as np
import pylab as plt
# Set up the plot
# The trick is to use a twinned dummy axis to plot on and to put that on the
# bottom. The top axis is just for the ticks and is see through...
@smutch
smutch / littleworkers_wrapper.py
Created August 15, 2012 08:58
Lite command line wrapper around littleworkers.
#!/usr/bin/env python
"""Lite command line wrapper around littleworkers."""
from littleworkers import Pool
import multiprocessing
from optparse import OptionParser
if __name__ == '__main__':
@smutch
smutch / matplotlibrc
Created September 28, 2012 11:23 — forked from huyng/matplotlibrc
Interactive matplotlibrc 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).
@smutch
smutch / leavein.py
Last active December 11, 2015 06:58
Present a popup/popups to remind me to leave...
#!/usr/bin/env python
"""Present a popup/popups to remind me to leave...
Usage:
leavein <time>
Format:
<time> should be given as e.g. 1h20m or 30m
"""
@smutch
smutch / index.html
Created February 14, 2013 10:31
Version control a la XKCD. (Made with the truly awesome Comix I/O)
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">
@smutch
smutch / matchparentoggle.vim
Created February 19, 2013 01:44
viml: matchparentoggle function
function! MatchParenToggle()
if g:loaded_matchparen==1
execute 'NoMatchParen'
let g:loaded_matchparen=0
else
execute 'DoMatchParen'
let g:loaded_matchparen=1
endif
endfun
map <leader>mp :call MatchParenToggle()<CR>
@smutch
smutch / virial_property_effects.ipynb
Created August 2, 2013 05:37
SAM virial property effects
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smutch
smutch / convert_tables.ipynb
Created September 2, 2013 05:08
ipn: Convert and investigate Chiara's ascii photometric tables.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smutch
smutch / ggplot play.ipynb
Created October 18, 2013 01:40
ipy: try to make mpl look like ggplot2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.