First we'll make a simple function that determines whether or not someone is awesome:
is_awesome <- function(name) {
#!/bin/bash | |
convert "$1" \( +clone -background grey25 -shadow 60x15+5+10 \) +swap -background transparent -layers merge +repage "${1%.*}-shadow.png" |
#!/bin/sh | |
## Enables ligatures in RStudio. This is for Windows. You will need to open this in a shell with admin priveleges (with sed available). | |
## On other OSes you will need to change the path to 'www/index.htm' and possibly run with sudo. | |
## source: https://github.com/tonsky/FiraCode/wiki/RStudio-instructions | |
sed -e "s/<body>/<body><style>*{text-rendering: optimizeLegibility;}<\/style>/" "c:\Program Files\Rstudio\www\index.htm" > \ | |
"c:\Program Files\Rstudio\www\index.htm.tmp" && \ | |
mv "c:\Program Files\Rstudio\www\index.htm.tmp" "c:\Program Files\Rstudio\www\index.htm" |
Commands that got postgres (installed via homebrew) running for me: | |
$ rm -rf /usr/local/var/postgres | |
$ initdb /usr/local/var/postgres -E utf8 | |
$ pg_ctl -D /usr/local/var/postgres -l logfile start | |
$ createuser -s postgres | |
$ python designatedlands.py create_db | |
From: | |
http://stackoverflow.com/questions/7975556/how-to-start-postgresql-server-on-mac-os-x |
#' Search for packages that are dependent on a particular package | |
#' | |
#' @param pkg The name of the package | |
#' @param size Maximum number of dependencies to search for | |
#' @param ... Additional argumentst passed on to \link{seer}{see} | |
#' | |
#' @return A \code{tibble} with columns \code{package} and \code{relationship} | |
#' @export | |
#' | |
#' @examples |
These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.
Download and install the git command-line client (if required).
Open the git bash window and introduce yourself to git (if required):
git config --global user.name 'Firstname Lastname'
git config --global user.email '[email protected]'
# Inspired by Aman Verma's work in rcaaqs | |
rolling_mean <- function(x, width, thresh = width) { | |
avail <- !is.na(x) | |
x[is.na(x)] <- 0 | |
rolled_sum <- cumsum(x) - dplyr::lag(cumsum(x), width, default = 0) | |
rolled_avail <- cumsum(avail) - dplyr::lag(cumsum(avail), width, default = 0) | |
ret <- rolled_sum / rolled_avail | |
ret[rolled_avail < thresh] <- NA | |
ret |
#' Convert a date to a day of year, optionally setting an arbitrary date as the | |
#' first day in a year. | |
#' | |
#' @param date a vector of dates in a standard unambigous format ("YYYY/MM/DD") | |
#' @param start_doy the first day of the year ("mm/dd"). Default January 1 ("01/01"), but can be set | |
#' to any month/day to set an arbitrary start date from which to calculate day of year | |
#' | |
#' @return integer vector with values from 1:365 (or 366 if a leap year) | |
#' @export | |
#' |