Skip to content

Instantly share code, notes, and snippets.

View PeerChristensen's full-sized avatar

Peer Christensen PeerChristensen

View GitHub Profile
@PeerChristensen
PeerChristensen / video_in_PsychoPy.txt
Last active May 11, 2017 07:04
Handling video stimuli in PsychoPy
myVideo= visual.MovieStim2(win, filename) #where i is the filename
while myVideo.status != visual.FINISHED:
myVideo.draw()
win.flip()
@PeerChristensen
PeerChristensen / stockPortfolioShiny
Created December 30, 2020 13:16
Code for s shiny app monitoring a stock portfolio and comparing stock performance
# A shiny app for monitoring a stock portfolio and comparing stock performance
# January 2021
# Peer Christensen
# [email protected]
library(shiny)
library(shinyWidgets)
library(shinythemes)
library(plotly)
library(tidyverse)
@PeerChristensen
PeerChristensen / mount_blob_databricks.py
Created November 15, 2021 09:25
mount blob storage in Databricks
dbutils.fs.mount(
source = "wasbs://<container-name>@<storage-account-name>.blob.core.windows.net",
mount_point = "/mnt/Input/",
extra_configs = {"fs.azure.account.key.<storage-account-name>.blob.core.windows.net":"<access-key>"})
# Find csv files in container
os.chdir(r'/dbfs/mnt/Input')
allFiles = glob.glob("Input/*.csv",recursive=True)
@PeerChristensen
PeerChristensen / app.r
Last active September 25, 2022 14:42
Code for a simple Shiny that exposes a transformer model
library(tidyverse)
library(shiny)
library(reticulate)
Sys.setenv(RETICULATE_PYTHON="/your-path/miniconda3/envs/my_env/bin/python")
reticulate::use_condaenv("my_env")
reticulate::py_run_file("python_functions.py")
model <- py$get_model()
FROM continuumio/miniconda3
# INSTALL DEPENDENCIES
RUN apt-get update -y; apt-get upgrade -y; \
apt-get install -y vim-tiny vim-athena ssh r-base-core \
build-essential gcc gfortran g++
# SETUP ENVIRONMENT
COPY environment.yml environment.yml
RUN conda env create -f environment.yml