Skip to content

Instantly share code, notes, and snippets.

View magic-lantern's full-sized avatar

Seth Russell magic-lantern

  • University of Colorado Anschutz Medical Campus
  • North Carolina
View GitHub Profile
@magic-lantern
magic-lantern / gc_storage_example.ipynb
Last active September 29, 2017 20:52
Google Cloud Storage upload and download example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magic-lantern
magic-lantern / gc_bigquery_example.ipynb
Last active September 29, 2017 20:50
Google Cloud BigQuery Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magic-lantern
magic-lantern / cygwin_ssh_proxy.md
Last active May 6, 2019 13:19
Setting up an SSH server to proxy connections on Windows

Setting up an SSH proxy on Windows

No administrative privileges required.

Steps:

  1. Download Cygwin setup application from https://cygwin.com

  2. Run Cygwin setup file

    • Select “Install For Just Me”
@magic-lantern
magic-lantern / ccc.R
Last active November 13, 2017 20:07
Comments and performance testing for ccc.R
# using a data.frame for output results
# base time 26 seconds with 60k rows
# this block takes 27 seconds with 100k rows
# if (sum(df[i,]))
# df$ccc_flag[i] <- 1L
# this one line takes abotut 10 seconds with 60k rows
# df$ccc_flag[i] <- ccc_flag
@magic-lantern
magic-lantern / gbq_example.R
Last active September 13, 2018 19:33
Example of using R to pull data from BigQuery
# install.packages('bigrquery')
library('bigrquery')
project <- "sandbox-nlp" # put your project ID here
sql <- "SELECT *
FROM `sandbox-nlp.MIMIC3_V1_4.ADMISSIONS`
LIMIT 100"
gbq_cursor <- bq_project_query(project, sql)
result <- bq_table_download(gbq_cursor)
@magic-lantern
magic-lantern / proxy.pac
Last active November 17, 2023 14:22
Proxy.pac file for tunneling to hosts via ssh (requires matching ~/.ssh/config to work)
function FindProxyForURL(url, host) {
// the zotero service should only be local
if ( shExpMatch(url, "http://127.0.0.1:23119/*") ) {
return "DIRECT";
}
// localhost and local stuff should go to through socks proxy
if (shExpMatch(host, "skylark.ucdenver.pvt") ||
shExpMatch(host, "rainier.ucdenver.pvt") ||
@magic-lantern
magic-lantern / ngix-config
Last active February 25, 2022 08:47
Nginx Configuration for HTTPS RStudio Server reverse proxy
##
# Customized Nginx configuration
##
server {
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name rstudio.learnclinicaldatascience.org; # managed by Certbot
access_log /var/log/nginx/rstudio.learnclinicaldatascience.org;
@magic-lantern
magic-lantern / fhir_intro.md
Last active November 6, 2018 17:11
FHIR Introduction

Introduction

Fast Healthcare Interoperability Resources (http://hl7.org/fhir) - FHIR – is a standards framework created by Health Level 7 (HL7). FHIR combines the features of HL7's previous health data interchange standards including HL7 v2 , HL7 v3 and CDA. FHIR improves on previous standards by using more modern web standards for data exchange, supports many programming languages, and promostes human readability.

Documentation

Start by reading through this first: "FHIR Drills" https://fhir-drills.github.io/index.html

@magic-lantern
magic-lantern / ubuntu_r_upgrade_instructions.md
Last active February 1, 2019 03:47
Steps to upgrade Ubuntu 16.04 LTS from R 3.4.x to R 3.5.x

Steps to upgrade r:

From linux command-line remove all existing R packages:

sudo apt-get update
sudo apt-get remove r-base r-base-dev r-base-core r-base-html r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart  r-cran-spatial r-cran-survival r-doc-html r-recommended

Next, update /etc/apt/sources.list and add these lines (comment out old R version, add new pkg list):