View project-create.sh
#!/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 |
View update_git_repos.sh
#!/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 |
View dprint.R
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) | |
} | |
View normalize.R
normalize <- function(x) { | |
if (min(x) > 0) { | |
if (max(x) < 1) { | |
x <- logit(x) | |
} else | |
x <- log(x) | |
} | |
x | |
} |
View osx_install.sh
#!/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)" |
View brewR
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 |
View brewbasictex
brew tap caskroom/cask | |
brew cask install basictex | |
sudo tlmgr update --self | |
sudo tlmgr update --all | |
sudo tlmgr install titling framed inconsolata | |
View ext.R
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}. | |
#' |