Skip to content

Instantly share code, notes, and snippets.

View MatthewRalston's full-sized avatar
🤒
Out sick

Matt Ralston MatthewRalston

🤒
Out sick
View GitHub Profile
@MatthewRalston
MatthewRalston / cabal-install.stderr
Created September 21, 2017 17:19
cabal-install error
Using gcc for C compiler. If this is not what you want, set CC.
Using /usr/libexec/gcc/xxxx/4.4.7/collect2 instead.
src/Hackage/Security/TUF/Layout/Repo.hs:8:1: error:
Could not find module ‘Distribution.Package’
Perhaps you haven't installed the profiling libraries for package ‘Cabal-2.0.0.2’?
Use -v to see a list of the files searched for.
|
8 | import Distribution.Package
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@MatthewRalston
MatthewRalston / citations.txt
Last active May 10, 2017 19:56
Reproducible_citations
Ioannidis, John PA, et al. "Repeatability of published microarray gene expression analyses." Nature genetics 41.2 (2009): 149-155.
Nekrutenko, Anton, and James Taylor. "Next-generation sequencing data interpretation: enhancing reproducibility and accessibility." Nature Reviews Genetics 13.9 (2012): 667-672.
Peng, Roger D. "Reproducible research in computational science." Science (New York, Ny) 334.6060 (2011): 1226.
Baggerly, Keith. "Disclose all data in publications." Nature 467.7314 (2010): 401.
Van Noorden, Richard. "The trouble with retractions." Nature 478.7367 (2011): 26-28.
Begley, C. Glenn, and Lee M. Ellis. "Drug development: Raise standards for preclinical cancer research." Nature 483.7391 (2012): 531-533.
@MatthewRalston
MatthewRalston / _service.md
Created April 7, 2017 14:35 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@MatthewRalston
MatthewRalston / Hello.rb
Created December 19, 2016 22:23
Adelle
partner = Object.new
def my_most_sincere_apology
"I'm sorry for everything that I've done. But when I call you never seem to be home."
end
try:
1000.times do |t|
partner.call(:my_most_sincere_apology)
end
catch e:
@MatthewRalston
MatthewRalston / ml-ruby.md
Created May 5, 2016 21:43 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

Resources for Machine Learning in Ruby

Gems

@MatthewRalston
MatthewRalston / hamming_match.py
Created April 29, 2016 22:27
Hamming distance match
'''
When you want to match files that only differ by one character: sample_1.fastq.gz sample_2.fastq.gz
'''
def is_hamming_match(seq1, seq2):
if len(seq1) == len(seq2): # The sequences must be of equal length
zipped = zip(seq1, seq2)
is_mismatch = list([c1 != c2 for c1, c2 in zipped])
if sum(is_mismatch) == 1: # The sequences must have only one mismatch
mismatches = list([[c1, c2] for c1, c2 in zipped if c1 != c2])
if mismatches[0] == ['1', '2'] or mismatches[0] == ['2', '1']: # The mismatch must only be the numbers 1 and 2
@MatthewRalston
MatthewRalston / fancy_scientific.R
Created March 21, 2016 16:16
Scientific notation (5x10^5)
fancy_scientific <- function(l) {
# turn in to character string in scientific notation
l <- format(l, scientific = TRUE)
# quote the part before the exponent to keep all the digits
l <- gsub("^(.*)e", "'\\1'e", l)
# turn the 'e+' into plotmath format
l <- gsub("e", "%*%10^", l)
# return this as an expression
parse(text=l)
}
@MatthewRalston
MatthewRalston / .bash_profiile
Last active August 11, 2017 15:53
Mac bash profile
#set -x
##
# Your previous /Users/Matthew/.bash_profile file was backed up as /Users/Matthew/.bash_profile.macports-saved_2013-04-01_at_23:07:38
##
export PATH=/usr/local/bin/:$PATH
# MacPorts Installer addition on 2013-04-01_at_23:07:38: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:/Users/Matthew/Documents/Bash_scripts:/Applications/circos-0.66/bin/:$PATH
@MatthewRalston
MatthewRalston / Autogen.log
Created November 24, 2015 16:13
Slurm-drmaa compilation logs
>./autogen.sh
checking for aclocal... yes
checking for autoheader... yes
checking for autoconf... yes
checking for libtoolize... yes
checking for automake... yes
running aclocal -I m4 (/opt/slurm-drmaa-slurm-drmaa-1.2.0-clusters)
running libtoolize --automake --copy --force (/opt/slurm-drmaa-slurm-drmaa-1.2.0-clusters)
running autoheader --warnings=all (/opt/slurm-drmaa-slurm-drmaa-1.2.0-clusters)
running automake --foreign --add-missing --copy --warnings=all (/opt/slurm-drmaa-slurm-drmaa-1.2.0-clusters)
@MatthewRalston
MatthewRalston / example.rb
Created November 16, 2015 17:08
log4r YAML configuration
require 'log4r'
require 'log4r/yamlconfigurator'
include Log4r
ycfg = YamlConfigurator
ycfg["LOGFILE"] = "/home/matt/logs/myapp.log"
ycfg.load_yaml_file("/home/matt/.config/ruby/logger.yaml")
root_logger = Logger['root_logger']