Skip to content

Instantly share code, notes, and snippets.

View vasantm's full-sized avatar

Vasant Marur vasantm

View GitHub Profile
@vasantm
vasantm / STATMooc-Chat-Resources.md
Last active February 6, 2021 17:02
Documenting what comes up during our weekly chats that might be useful to us -R packages and Learning Resources and other cool tools
@vasantm
vasantm / reprod-plot-example.R
Created May 29, 2020 21:24
How to embed script name or a hash of it on a plot to allow to track plots and the scripts thar produced it in R, based on this question : https://twitter.com/tangming2005/status/1266404192744243202?s=20
# code source for plotting
# https://www.datanovia.com/en/blog/ggplot-title-subtitle-and-caption/
# get source filename SO quest: http://stackoverflow.com/q/1815606/946850
# get source fielname answer: https://stackoverflow.com/a/20282846
# if you do use a hash, you will have to save these to a csv or write
# a DB, perhaps an sqlite file that has the entry
# for the source file and corresponding hash to keep track of the
# hashes or just use filename and proj_dir,
# and display that if you want to keep it simple,
# open and reproducible
@vasantm
vasantm / shiny-server.comf
Created June 6, 2017 18:49
shiny server configuration file
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# Define a server that listens on port 3838
server {
listen 3838 127.0.0.1;
# Define a location at the base URL
location / {
@vasantm
vasantm / nginx.conf
Last active January 20, 2021 19:45
my nginx.conf for nginx to serve shiny apps over ssl
#Here's the updated config,
#I put it all in /etc/nginx/nginx.conf.
#Earlier I had the http directive in nginx.conf and a sites.conf under /etc/nginx/conf.d.
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
@vasantm
vasantm / console.log
Created June 6, 2017 18:26
Console logs for shiny apps over http and https
#Only relevant sections shown.
#accessing sample shiny apps over http
#Shiny apps work
#check http://kristallab.bwh.harvard.edu/shiny
Firefox can’t establish a connection to the server at ws://kristallab.bwh.harvard.edu/shiny/sample-apps/rmd/__sockjs__/n=qKJv7DxEojOa0QAHtm/066/46myxph4/websocket. sockjs-0.3.4.min.js:27:17047
"Tue Jun 06 2017 14:12:19 GMT-0400 (EDT) [INF]: Connection opened. http://kristallab.bwh.harvard.edu/shiny/sample-apps/rmd/" shiny-server-client.min.js:1:21729
Tue Jun 06 2017 14:12:19 GMT-0400 (EDT) [DBG]: Open channel 0 shiny-server-client.min.js:1:5323
Firefox can’t establish a connection to the server at ws://kristallab.bwh.harvard.edu/shiny/sample-apps/hello/__sockjs__/n=hVfMnA5kmVkr0PPEt9/930/b2bl2ya6/websocket. sockjs-0.3.4.min.js:27:17047
"Tue Jun 06 2017 14:12:20 GMT-0400 (EDT) [INF]: Connection opened. http://kristallab.bwh.harvard.edu/shiny/sample-apps/hello/" shiny-server-client.min.js:1:21729
Tue Jun 06 2017 14:12:20 GMT-0400 (EDT) [DBG]: Open channel 0 shiny-server-cl