Skip to content

Instantly share code, notes, and snippets.

View michaelbarton's full-sized avatar

Michael Barton michaelbarton

View GitHub Profile
BEGIN { FS = OFS = ","
print "gene", "cost", "cost-type"}
/yeast-carbon|weight/ && /0\.1/ && /nitrogen/{
gsub(/"/,"")
gsub(/yeast-carbon-/,"")
printf "%s,%3.4f,%s\n", $2, $3, $13
}
module NavigationHelpers
# Maps a name to a path. Used by the
#
# When /^I go to (.+)$/ do |page_name|
#
# step definition in webrat_steps.rb
#
def path_to(page_name)
"http://0.0.0.0:3000" + case page_name
require 'www/mechanize'
# Patches WWW::Mechanize for Cucumber + Webrat
module WWW
class Mechanize
def self.log_disabled
@@log ||= Logger.new(STDOUT)
end
#! /usr/local/bin/ruby
require 'rubygems'
require 'fastercsv'
layout = Hash.new
FasterCSV.open(ARGV.first, :headers => true).each do |row|
row.headers.each do |header|
layout[header] ||= Hash.new
\documentclass[12pt,PhD]{muthesis}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{url} % typeset URL's reasonably
\usepackage{listings}
\usepackage{phdthesis}
\usepackage{rotating}
\usepackage{subfig}
\usepackage{psfrag}
#! /usr/local/bin/ruby
#
# Short script for converting yaml file time to csv
#
require 'yaml'
require 'rubygems'
require 'fastercsv'
s/\[c\]//g
s/-L//g
s/EX_//g
s/(e)//g
s/ /,/g
s/,$//g
data(iris)
distance <- dist(1 - cor(iris[-5]))
clustering <- hclust(distance)
plot(clustering)
print.pdf <- function(figure,name,extra.width=0){
# Create file name
pdf <- paste("/Users/mike/Desktop/post/",name,".pdf",sep="")
# Convert to pdf
trellis.device("pdf", color=TRUE)
pdf(pdf,onefile=FALSE, paper = "special")
print(figure)
dev.off()