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
# non-negotiable | |
usethis::use_rstudio_preferences( | |
save_workspace = "never", | |
load_workspace = FALSE, | |
auto_append_newline = TRUE | |
) | |
# spicy | |
usethis::use_rstudio_preferences( | |
new_proj_use_renv = TRUE, |
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
project: | |
title: "connect-marimo" | |
external-env: true |
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
# adapted from | |
# https://fastapi.tiangolo.com/advanced/websockets/#await-for-messages-and-send-messages | |
import os | |
from fastapi import FastAPI, WebSocket | |
from fastapi.responses import HTMLResponse | |
app = FastAPI() |
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
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser | |
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression | |
scoop install git | |
scoop bucket add extras | |
scoop bucket add r-bucket https://github.com/cderv/r-bucket.git | |
scoop install rig |
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
import gradio as gr | |
def get_user_info(text, request: gr.Request): | |
user_info = request.headers["RStudio-Connect-Credentials"] | |
return { | |
"user_info": user_info | |
} | |
demo = gr.Interface(get_user_info, "text", "json") | |
demo.launch() |
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
--- | |
format: revealjs | |
--- | |
## purrr | |
::: r-fit-text | |
`map(.x, .f, ...)` | |
::: |
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 | |
set -e | |
BCYAN='\033[1;36m' | |
BRED='\033[1;31m' | |
NC='\033[0m' # No Color | |
BOLD='\033[1m' | |
print_heading() { | |
echo "" |
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/Rscript | |
get_nodes <- function(nodes = Sys.getenv("RSTUDIO_NODES")) { | |
unlist(strsplit(nodes, ",", fixed = TRUE)) | |
} | |
get_health_check <- function(node_address) { | |
con <- url(sprintf("http://%s/health-check", node_address)) | |
on.exit(close(con)) | |
readLines(con) |
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) | |
ui <- fluidPage( | |
# Application title | |
titlePanel("clippers"), | |
sidebarLayout( | |
sidebarPanel( | |
textAreaInput("text_input", "enter text:"), | |
# using submit button makes the copy less of a lie (but still a lie) because |
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(shinydashboard) | |
library(dplyr) | |
library(dbplyr) | |
library(purrr) | |
library(shiny) | |
library(highcharter) | |
library(DT) | |
library(htmltools) | |
# Use the `config` package to get the credentials |
NewerOlder