Skip to content

Instantly share code, notes, and snippets.

SELECT
s.nct_id,
s.brief_title,
s.phase,
s.enrollment,
s.start_date,
s.primary_completion_date,
s.last_update_submitted_date,
sp.name,
sp.agency_class,
@wetherc
wetherc / .bashrc
Created December 12, 2017 13:52
gitgraph
alias gitgraph="git log --graph --oneline --all --decorate --topo-order"
@wetherc
wetherc / cd
Created October 19, 2017 00:27
Pushd / Popd example
# Do some work in my home directory
chriss-MacBook-Pro:~ chris$ pwd
/Users/chris
chriss-MacBook-Pro:~ chris$ vim myAwesomeCode.py
chriss-MacBook-Pro:~ chris$ python myAwesomeCode.py
# Switch directories real quick
chriss-MacBook-Pro:~ chris$ cd /etc
chriss-MacBook-Pro:etc chris$ vim hosts
@wetherc
wetherc / groupByCoverageWindow.R
Last active September 27, 2017 17:03
Group policies by periods of continuous coverage
library(data.table)
################################################################################
#
# Generate some dummy data
#
################################################################################
data <- data.frame(
policyId = "A",
@wetherc
wetherc / app.R
Last active August 10, 2017 15:10
Dynamic Tab Panels
library(shiny)
################################################################################
#
# GLOBALS
#
################################################################################
# On application start, we'll randomly choose whether
# the viewer can see our super-secret Old Faithful tab
@wetherc
wetherc / README.md
Last active October 19, 2016 15:50
Code Review Cheat Sheet

Save Changes in Git

$ git add --all
$ git commit -a -m "My commit message"

Create A Code Review

$ arc diff --amend-all
server <- function(input, output, session) {
###
output$sliders <- renderUI({
xv <- input$xaxisGrp
# First, create a list of sliders each with a different name
sliders <- lapply(1:length(xv), function(i) {
inputName <- xv[i]
sliderInput(
inputId = inputName,
########################################
########################################
#
# Repeated Measures ANOVAs in R
#
########################################
########################################
########################################
# Construct a sample dataset
########################################
########################################
#
# Conducting t-tests in R
#
########################################
########################################
########################################
# One-sample t-tests
########################################
########################################
#
# Building barplots in R with
# error bars
#
########################################
########################################
########################################