This file contains hidden or 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 upgrade rbenv | |
| $ rbenv -v | |
| rbenv 0.4.0 | |
| $ brew upgrade ruby-build | |
| $ ruby-build --version | |
| ruby-build 20130628 | |
| $ rbenv install --list | grep 2.0.0-p | |
| 2.0.0-p0 | |
| 2.0.0-p195 | |
| 2.0.0-p247 |
This file contains hidden or 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 | |
| # | |
| # Install Postgres 9.2, PostGIS and create PostGIS template on an Ubuntu 12.04 Server | |
| # add official postgresql.org ubuntu repos (http://wiki.postgresql.org/wiki/Apt) | |
| # Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. | |
| echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg2.list | |
| # Import the repository key from http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc, update the package lists, and start installing packages: |
This file contains hidden or 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
| sudo add-apt-repository ppa:pitti/postgresql | |
| sudo apt-get update | |
| sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2 | |
| sudo su -l postgres | |
| psql -d template1 -p 5433 | |
| CREATE EXTENSION IF NOT EXISTS hstore; | |
| CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
| service postgresql stop | |
| /usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf" |
This file contains hidden or 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
| #! /usr/bin/env Rscript | |
| #start an instance | |
| startup <- system("ec2-run-instances ami-b232d0db -k ec2ApiTools", intern=T) | |
| Sys.sleep(45) #rather random but 45 seconds is typically long enough to boot | |
| #query running instances | |
| instances <- system("ec2-describe-instances", intern=T) | |
| instancesParsed <- sapply(instances, strsplit, "\t") |
This file contains hidden or 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
| <script src="https://github.com/livereload/livereload-js/raw/master/dist/livereload.js?host=localhost"></script> |
This file contains hidden or 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
| #proxy { | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| display: none; | |
| } | |
| #notebook { | |
| position: absolute; | |
| width: 600px; |
This file contains hidden or 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
| # Here a set of instructions corresponding to each code lesson is made into a dataset codelist | |
| ID=as.numeric() # id of code lesson | |
| instruct=as.character() # instructions for code lesson | |
| subhead=as.character() # subheading for code lesson | |
| i=1 | |
| ID[i]=i | |
| subhead[i]="Simple R Expressions: Addition" | |
| instruct[i]=paste('Try simple math','Type the command below','','1+1','',sep="\n") |
This file contains hidden or 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
| ############################################### | |
| ## | |
| ## Attempt no 2 at building a shiny web app | |
| ## for AB Testing use - using global.R | |
| ## | |
| ## global.R - loading and defining variables for the global environment | |
| ## | |
| ############################################### | |
| # Pallette used in some charts as a general indicator color for better or worse that the control group |
This file contains hidden or 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(shiny) | |
| shinyServer(function(input, output) { | |
| output$intense <- reactivePrint(function() { | |
| if(input$panel==2){ | |
| Sys.sleep(10) | |
| return('Finished') | |
| }else({return(NULL)}) | |
| }) |
This file contains hidden or 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(shiny) | |
| # load a very small projects file | |
| # Eventually the idea is to have a database link to SQLite or access | |
| projects=data.frame(pid=c(1,2,3,4,5),project=c("proj1","proj2","proj3","proj4","proj5")) | |
| # Define server logic | |
| shinyServer(function(input, output) { | |
| # if Projects -> View Projects is selected, this outputs the lists in dataframe projects |