Skip to content

Instantly share code, notes, and snippets.

@cm6051
cm6051 / attic-backups
Last active September 30, 2016 20:56
Backup script using Attic
#!/bin/bash
set -e
MYSQL_DIR=/var/backups/mysql
ATTIC_DIR=/var/backups/attic
BACKUP_NAME=tip1.attic
BACKUP_SOURCES="/etc /home /usr/share/nginx ${MYSQL_DIR}"
REMOTE_DEST="backuptip1@scout.yoyo.org"
echo "================="
@DASpringate
DASpringate / cond.R
Last active May 19, 2017 15:24
A simple R implementation of `cond` from Lisp. Allows for arbitrary numbers of conditionals without nested if statements
#' R implementation of `cond` from Lisp
#' allows for arbitrary numbers of conditionals without ugly nested if statements
#' conditionals are entered as pairs of expressions (clauses),
#' first the expression to be evaluated and second the return value if the expression is true
#' @param ... an even number of expressions as pairs (see example)
#' @param true the `else` expression (Taken from the Lisp (T resultN) see http://www.cis.upenn.edu/~matuszek/LispText/lisp-cond.html)
#' @return The paired value of the first true conditional expression or the value of true
#' @examples
#' x <- runif(1)
#' cond(x < 0.2, "lower tail",