Skip to content

Instantly share code, notes, and snippets.

View tomravalde's full-sized avatar

Tom Ravalde tomravalde

View GitHub Profile
## Makefile to build PhD thesis
###--------------------------------------------------
### T. Ravalde ([email protected])
### Last edited: 2016/05/31
### Adapted from Keiran Healy (https://github.com/kjhealy/workflow-paper/blob/master/Makefile)
###--------------------------------------------------
## Put this Makefile in your project directory
## - Change/add the paths to at the top of the file as needed (e.g. line 37)
@tomravalde
tomravalde / thes
Last active May 17, 2016 09:26
Uses www.thesaurus.com a command-line thesaurus tool
#!/bin/bash
###--------------------------------------------------
### T. Ravalde
### Last edited: 2016/05/17
###--------------------------------------------------
# Command line thesaurus based on code from http://www.linuxhowtos.org/Tips%20and%20Tricks/cmdline_thesaurus.htm
###--------------------------------------------------
@tomravalde
tomravalde / ReporteRs-example.R
Last active October 6, 2015 08:29
Demonstration of using the ReporteRs R package to convert a plot into an editable figure in PowerPoint
# Example of using the ReporteRs package to convert R plots to editable figures in PowerPoint
## Based on article at http://www.sthda.com/english/wiki/create-an-editable-graph-from-r-software
## Data
### (Data from searching Scopus for 'open data' or 'open-data')
year <- c(1995:2014)
number <- c(5, 14, 5, 3, 4, 7, 15, 16, 13, 18, 19, 28, 29, 43, 69, 148, 230, 424, 618, 759)
open_data <- data.frame(year, number)
@tomravalde
tomravalde / make-doc.sh
Last active August 29, 2015 14:14
A shell script to build a PDF (containing version control details) from an R-markdown file, outputting a word count
sh vc # Create the version control data
Rscript knit.R # Knit the file (details below)
if [ `hostname` = "cv-tr608-01" ] # Determine which computer is being used
then
pandoc --latex-engine=xelatex --template=/home/tr608/.pandoc/templates/tom.xelatex --natbib --bibliography=/home/tr608/ImpCol/PhD/my-refs.bib -o paper.tex paper.md # Generate *.tex filer using templates and bibioligraphic data
else
pandoc --latex-engine=xelatex --template=default.latex --include-in-header=custom-local.sty --natbib -o paper.tex paper.md
fi
xelatex paper # Build PDF from *.tex source
bibtex paper
@tomravalde
tomravalde / gantt-ggplot.R
Last active June 20, 2017 18:14
Gantt chart (ggplot)
# Gantt chart based on my PhD completion timetable.
## Below is a copy of gantt.csv (built initially in a spreadsheet)
#Task,Start,End,Chapter
#"Metabolic efficiency reading (3)",2014/08/01,2014/11/30,3
#"Metabolic efficiency data analysis (3)",2014/11/01,2015/02/28,3
#"Model development (4)",2014/08/01,2014/10/30,4
#"Shann Gu case study (5)",2014/08/01,2014/10/30,5
#"Metabolic pathway database construction (6)",2014/08/01,2015/04/30,6
#"Metabolic pathaway analysis (6)",2015/03/01,2015/06/30,6
@tomravalde
tomravalde / vim-solarized.sh
Created June 5, 2014 12:45
Vim and Solarized colourscheme for the gnome-terminal fix for "S_base03"
xrdb -merge ~/.Xresources
# Source: http://askubuntu.com/questions/302736/solarized-color-name-not-defined
@tomravalde
tomravalde / install-Rgraphviz.R
Created May 19, 2014 16:10
Commands to source the Rgraphviz package
source("http://www.bioconductor.org/biocLite.R")
biocLite("Rgraphviz")
library("Rgraphviz")
@tomravalde
tomravalde / prompt_display-git-branch.sh
Last active August 29, 2015 14:01
Add to ~/.bashrc to display working directory and git branch at the prompt.
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1="\u@\h \w\[\033[01;36m\] \W\[\033[0;33m\]\$(parse_git_branch)\[\033[0m\]\$ "
\documentclass{article}
\usepackage{booktabs}
\usepackage{geometry}
\usepackage{tabularx}
\geometry{lmargin=72pt,tmargin=72pt,textwidth=350pt,marginparwidth=144pt}
\usepackage{tufte-sidenotes}
\begin{document}
Here is demo of the \verb#tufte-sidenotes# style.