This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tools) | |
library(assertthat) | |
#' @title Filename extension utilities | |
#' | |
#' @description Replaces, adds or removes (rm) extensions from filenames or test whether | |
#' filename has an extension or is a filename with a particular extension. | |
#' Functions are primarily wrappers | |
#' on the tools package functions \code{file_ext} and \code{file_path_sans_ext}. | |
#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew tap caskroom/cask | |
brew cask install basictex | |
sudo tlmgr update --self | |
sudo tlmgr update --all | |
sudo tlmgr install titling framed inconsolata | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First of all made sure that command line developer tools (but not XCode were installed) | |
<http://railsapps.github.io/xcode-command-line-tools.html> | |
``` | |
brew tap caskroom/cask | |
brew install Caskroom/cask/xquartz | |
brew cask install java | |
brew cask install basictex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
normalize <- function(x) { | |
if (min(x) > 0) { | |
if (max(x) < 1) { | |
x <- logit(x) | |
} else | |
x <- log(x) | |
} | |
x | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dprint <- function(x, note = NULL, do = getOption("dprint.do", TRUE)) { | |
if (!do) return(invisible()) | |
if (!is.null(note)) | |
cat("\n**", note, "**\n") | |
cat("\n", deparse(substitute(x)), ": \n", sep = "") | |
print(x) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Call this file with `bash ./project-create.sh project-name [service-name]` | |
# - project-name is mandatory | |
# - service-name is optional | |
# This will creates 4 directories and a git `post-receive` hook. | |
# The 4 directories are: | |
# - $GIT: a git repo | |
# - $TMP: a temporary directory for deployment |