Skip to content

Instantly share code, notes, and snippets.

View johnrc's full-sized avatar

John Cragun johnrc

View GitHub Profile
@johnrc
johnrc / r-commands.md
Last active August 29, 2015 14:02
Useful commands for R

Installing packages

Install package and dependencies to a specific location. If you want the binaries cached, use destdir="/Rbins" option. If you want the package(s) installed to a specific location, use lib="~/Rlibs". The default location on Windows is %userprofile%\Documents\R\win-library\3.0.

install.packages("<package>", dependencies=NA, repos="http://cran.us.r-project.org")
R CMD INSTALL <package> -l ~/Rlibs

On Mac it would be something like

install.packages("<package>", dependencies=NA, type="mac.binary")
@johnrc
johnrc / bower-proxy-windows.md
Last active August 29, 2015 14:01
Setting up bower behind a proxy on Windows

Steps for installing and using bower behind a proxy:

Install git, node and add C:\Program Files (x86)\Git\bin to %path% Then run the following:

set http_proxy=http://<username>:<password>@<host>:<port>/
set https_proxy=http://<username>:<password>@<host>:<port>/
npm install -g bower

Or you can add the following to your .bowerrc file in %userprofile% or in your project

@johnrc
johnrc / app.rb
Created April 26, 2014 14:59 — forked from hendrikswan/app.rb
require 'sinatra'
require 'mongoid'
require 'json'
require "sinatra/reloader" if development?
Mongoid.load!("mongoid.yml")
class Price
include Mongoid::Document