Skip to content

Instantly share code, notes, and snippets.

View chrismullins's full-sized avatar

Christopher Mullins chrismullins

View GitHub Profile
@chrismullins
chrismullins / video-encoding-with-ffmpeg.sh
Created March 7, 2013 01:58
Encoding video with ffmpeg for COMP715
# first, get ffmpeg
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
# next, configure it
cd ffmpeg
./configure --disable-yasm
# build it (-j<# of cores>)
make
@chrismullins
chrismullins / test-flip-functions.m
Last active December 15, 2015 21:49
Run MATLAB test with xunit
% Once XUnit is installed, you can run this test by navigating to this directory and typing "runtests" into your MATLAB prompt.
%
% Output Variable name should be "test_suite"
% | Make sure the test name either begins or ends with "test"
% | |
% | |
function test_suite = testMyFunctions
initTestSuite;
% Here is the first test!
@chrismullins
chrismullins / CMakeLists.txt
Last active December 15, 2015 21:49
A CTest example so minimalistic that it is probably not useful to anyone. Enjoy!
cmake_minimum_required(VERSION 2.8)
project(CTest-Example)
add_executable(CTest-Example CTest-Example)
enable_testing()
add_test(NAME YeahhhTest COMMAND ${CMAKE_COMMAND} -E echo 'Yeahh')
@chrismullins
chrismullins / scramble_file.sh
Created December 31, 2013 06:21
Bash script to randomly permute every occurrence of a word in a file.
#!/bin/sh
Perm () {
A=$1
i=0
while [ $i -lt ${#A} ]; do y[$i]=${A:$i:1}; i=$((i+1));done
s=`shuf -e ${y[@]}`
newString=''
s=$(sed 's|\ ||g' <<< $s)
i=0
@chrismullins
chrismullins / CMakeLists.txt
Last active August 29, 2015 14:04
superbuild-meshkit
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
include(superbuild.cmake)
@chrismullins
chrismullins / latex-dependencies-itk-software-guide.sh
Last active March 29, 2016 00:07
Install minted.sty on Ubuntu 12.04
#Download minted.sty from here:
wget http://mirrors.ctan.org/macros/latex/contrib/minted.zip
unzip minted.zip
cd minted
make
sudo mkdir /usr/share/texmf-texlive/tex/latex/minted
cp minted.sty /usr/share/texmf-texlive/tex/latex/minted/minted.sty
#Download xcolors from here:
wget http://mirrors.ctan.org/macros/latex/contrib/xcolor.zip
@chrismullins
chrismullins / setup-python-ITK.sh
Last active August 24, 2017 13:03
Setup ITK with python wrapping
BASEDIR=`pwd`
mkdir python-3.4.2 && cd python-3.4.2
PYTHONDIR=`pwd`
wget https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
tar xf Python-3.4.2.tar.xz
mkdir build && mkdir install && cd build
CFLAGS=-fPIC CPPFLAGS=-fPIC $PYTHONDIR/Python-3.4.2/configure --prefix=$PYTHONDIR/install
make
make install
cd $BASEDIR
@chrismullins
chrismullins / build-clang.sh
Created January 30, 2015 16:53
build clang trunk
basedir=`pwd`
echo $basedir
installdir=llvm-clang-install
mkdir $installdir
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
mkdir llvm-build && cd llvm-build
$basedir/llvm/configure --prefix=$basedir/$installdir && make -j8 && make install
cd $basedir
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
@chrismullins
chrismullins / scatter_roi_files.py
Created August 7, 2015 21:56
Separate filelist and roi_summary file into separate txt files.
import argparse
import os
import sys
from itertools import izip
import collections
import errno
"""
This script takes two files: a list of form 'filename,slice#', and another
tab-delimited list of mean values for each ROI. Every line should line up.
@chrismullins
chrismullins / build_python.sh
Created August 7, 2015 22:08
Build python 2.7.10 on linux
#/bin/bash
mkdir python2710 && cd python2710
wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz --no-check-certificate
gunzip Python-2.7.10.tgz
tar xf Python-2.7.10.tar
cd Python-2.7.10
./configure
make