Skip to content

Instantly share code, notes, and snippets.

View matthew-brett's full-sized avatar

Matthew Brett matthew-brett

View GitHub Profile
# Checkin from SVN - using a local copy I had to hand
cat > authors.txt << EOF
mcc = Michael Castelle <mcc@uchicago.edu>
jdh2358 = John Hunter <jdh2358@gmail.com>
michael.castelle = Michael Castelle <mcc@uchicago.edu>
jarrod.millman = Jarrod Millman <jarrod.millman@gmail.com>
EOF
git svn clone --authors-file=authors.txt file:///home/mb312/backups/nipy-svn/ni/pbrain/trunk pbrain-svn
# commit list from git log --pretty="%h"
# 51eacd2
#!/usr/bin/env python
''' Tiny script to do perl -p -i -e -type replace on text in files '''
import sys
import re
def perl_dash_pie(in_exp, out_str, filename):
in_reg = re.compile(in_exp)
in_txt = open(filename, 'rt').read(-1)
import os
from os.path import join as pjoin, isdir
import sys
import shutil
from subprocess import call
input_dir = '/Users/mb312/dev_trees'
output_dir = os.getcwd()
for dir in sorted(os.listdir(input_dir)):
if dir.startswith('.'):
# Script to investigate exp errors
from __future__ import print_function, division
import numpy as np
import sympy.mpmath as mp
mp.mp.dps = 100
EPS = np.finfo(np.float64).eps
#!/usr/bin/env python
""" Detect Windows non-SSE2 machines in Firefox crash reports
Uses algorithm described in:
https://groups.google.com/d/msg/mozilla.dev.platform/GWb7C76nRqk/haR0oZkfkWgJ
and replicates results in:
https://groups.google.com/d/msg/mozilla.dev.platform/GWb7C76nRqk/w_T3nzDlVVkJ
#!/usr/bin/env python
""" Detect Windows versions in crash reports
Runs on *pub-crashdata.csv.gz files from:
https://crash-analysis.mozilla.com/crash_analysis
"""
from __future__ import division, print_function
import sys
# Vagrant file for creating travis-ci -like image for Pythons
# Use with:
#
# $ mkdir travis_vagrant
# $ cd travis_vagrant
# $ git clone https://github.com/travis-ci/travis-cookbooks cookbooks
# <copy this Vagrant file here as `Vagrantfile`>
# $ vagrant up
#
# This file slightly edited from example file in:
@matthew-brett
matthew-brett / rename_wheels.py
Created May 20, 2014 04:19
Script to rename wheel files built with MacPython, to express compatibility with 10.9 system python and homebrew.
#!/usr/bin/env python
""" Rename MacPython wheels for system python and homebrew """
from __future__ import print_function
import os
from os.path import expanduser, splitext
import sys
from wheel.install import WheelFile
POP_PLAT_TAG = 'macosx_10_6_intel'
# An install file for ATLAS SSE2-only 32-bit build
#
# Must be unix line endings
# In vim - set ff=unix
# Turn off CPU throttling
# Control panel, Hardware and sound, Power options, Select a power plan, Show
# additional plans, High perfornamce
win_home="/cygdrive/c/Users/mb312"
downloads="${win_home}/Downloads"
code_home="/cygdrive/c/code"
# An install file for ATLAS SSE2-only build on 64-bit Windows
#
# Must be unix line endings
# In vim - set ff=unix
# Turn off CPU throttling
# Control panel, Hardware and sound, Power options, Select a power plan, Show
# additional plans, High perfornamce
win_home="/cygdrive/c/Users/mb312"
downloads="${win_home}/Downloads"
code_home="/cygdrive/c/code"