Skip to content

Instantly share code, notes, and snippets.

View SimonGreenhill's full-sized avatar
🐒

Simon J Greenhill SimonGreenhill

🐒
View GitHub Profile
@SimonGreenhill
SimonGreenhill / crashplan.sh
Created June 25, 2012 23:47
Shell script to start and stop crashplan
#!/bin/sh
USER=~/Library/LaunchAgents/com.crashplan.engine.plist
SYSTEM=/Library/LaunchDaemons/com.crashplan.engine.plist
if [ -f $SYSTEM ]
then
PLIST=$SYSTEM
elif [ -f $USER ]
then
import random
def shotgun(iterable, size=12):
""" """
start = random.choice(range(0, len(iterable)-size))
return(start, iterable[start:start+size])
def paired_end(iterable, read_size=10, gap_size=15):
""" """
start = random.choice(range(0, len(iterable)-(read_size+gap_size)))
PAPER=my-paper
BIBFILE=my-paper
OUTPUTDIR=build
.PHONY: pdf refs bib pdflatex wordcount clean
all: build/plos2015.bst bib pdf diff figures
build/plos2015.bst:
@cp plos2015.bst build/plos2015.bst
@SimonGreenhill
SimonGreenhill / compare_sessions.py
Created May 29, 2017 07:47
Python code to compare the loaded packages in two R sessions
#!/usr/bin/env python3
#coding=utf-8
"""
Save the output of R's `sessionInfo()` into a text file.
"""
__author__ = 'Simon J. Greenhill <[email protected]>'
__copyright__ = 'Copyright (c) 2017 Simon J. Greenhill'
__license__ = 'New-style BSD'
import re