https://speakerdeck.com/jcheng5/shiny-x-ai
- Video input and audio spinner controls: {shinymedia}, for R and Python
- Video assistant example app
- R version: source
sfThemeSelector = function() { | |
# -------------------------------------------------------------------------- | |
# Allow dynamic update of bootstrap theme. | |
# -------------------------------------------------------------------------- | |
div( | |
div( | |
selectInput( | |
"shinytheme-selector", "Select theme:", | |
c("default", shinythemes:::allThemes()), |
https://speakerdeck.com/jcheng5/shiny-x-ai
from typing import Any, Dict, List, Type | |
import instructor | |
from anthropic import Anthropic | |
from config.settings import get_settings | |
from openai import OpenAI | |
from pydantic import BaseModel, Field | |
class LLMFactory: |
// 2022-04-03, tested with Chrome 99.0.4844.84 on MacBook Pro m1 | |
/* | |
Open chrome://flags/ | |
F12 open developer console, swtich to tab "Console" | |
Paste below codes | |
- input backup() to download flags backup file | |
- input restore() to select one backup to restore | |
*/ | |
function saveFile(filename, data) { |
PowerShell, as a language, is very self-discoverable.
When you Get-Command, you get a rich object about a command.
This can have a lot of metadata.
You can and should also use inline help (like this script does).
Sometimes, I want more metadata than the command or parameter can actually provide.
# @drob's version from https://twitter.com/drob/status/1501747414780239879 | |
pluck_recursive <- function(lst, name) { | |
if (is.list(lst)) { | |
if (!is.null(lst[[name]])) { | |
return(lst[[name]]) | |
} | |
return(unname(unlist(purrr::map(lst, pluck_recursive, name)))) | |
} | |
} |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
(This post was motivated by a talk by @jnolis at CascadiaRConf 2021)
Recent versions of Shiny have an undocumented feature for handling POST requests that are not associated with any specific Shiny session. (Note that this functionality is missing our normal level of polish; it's a fairly low-level hook that I needed to make some things possible, but doesn't make anything easy.)
In a nutshell, it works by replacing your traditional ui
object with a function(req)
, and then marking that function with an attribute indicating that it knows how to handle both GET
and POST
:
library(shiny)
/* -------------------------------- | |
Typography | |
-------------------------------- */ | |
:root { | |
--font-primary: sans-serif; | |
--font-secondary: serif; |
\documentclass[a4paper,twoside,11pt]{article} | |
\usepackage{delarray} | |
\usepackage{fancyhdr} | |
\usepackage[cp1250]{inputenc} | |
\usepackage[T1]{fontenc} | |
\pagestyle{fancyplain} \fancyfoot[LE,RO]{\thepage} \cfoot{} | |
\renewcommand{\headrulewidth}{0pt} | |
\headheight=14pt |