Moved to jcheng5/elmer-assistant
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 | |
# extract_depth.sh - Extract depth map from HEIC files | |
# Usage: ./extract_depth.sh input.heic | |
# Check if argument was provided | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <heic_file>" | |
exit 1 | |
fi |
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
OTEL_SERVICE_NAME=litellm-test | |
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318/v1/traces | |
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf |
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
Experimental function to concatenate lots of HTML dependencies' JavaScript files into one single one.
A number of caveats apply:
- Strict mode: Many JavaScript files contain
"use strict";
at the top of the file. This causes slightly different behavior in the JS engine. If the concatenated JS files have different expectations regarding strict mode, there could be problems. - Hosted scripts: This script does not attempt to concatenate JS files that are hosted on CDNs. Instead, they're left in their original form. It's possible that files we do concatenate, either assume that a CDN-hosted script is loaded before it itself is, or, the opposite.
combine_js
has a parameter that lets you decide whether to put the combined script first or last, there's no way for us to decide automatically (assuming there's even a right answer). - ES6 modules: We leave
type="module"
alone, because for ES6 modules the file boundarie
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) | |
library(crew) | |
library(promises) | |
library(bslib) | |
run_task <- function(model, n, delay_secs) { | |
Sys.sleep(delay_secs) | |
model(n) | |
} |
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
# Live demo at https://shinylive.io/py/app/#code=NobwRAdghgtgpmAXGKAHVA6VBPMAaMAYwHsIAXOcpMAMwCdiYACABQEkAZJgSxlWLpkmbGFADmcADoRe-QUwgBXPtiZQAzgtTTZAoSQA2A9dnXTp9Rk3UALbhFW75dOFEJluANzh4mLgI4WDMy29tgYcAAeqC7qmk5C9qiKZL4uEAAmcHS+itzmStwYSSkA+jTcBnAAFJK0lVL4THUi4nBMFVV1AJTSecUQyWSl6gbcWXS1YDaKjb51ABKz1nY0ZHW+AAy+AEwArHtbvRAFAALpE1hG65lwNCvca3AZ1d2I0kyfTADETBzEUAyTDINnavDaHy+4IkTAAvMJRBIMMRUJRqgFqiUyBhOjVut1gJsALrAOoZKBkNAUmx1IndDAkCDeQTVADkACUAOIAIVZxy+zQgAt+AGFSMyhCCwYj2mRiAplDg1HQ6FBVDQBExRDJkgYKdxSJDPtC4KVBnCtBgoCq1ZiZfyvkaeDLSjZ1J4LYMrTbsNVgIZjKYMHQxAAjUpy13u6qobiROAGQlEgD0+0OTFj8cTAEYU2nfJmE8AdnmDt0OprCwYeEKTWbMLEbGgagBabO+ADM3TpBWFTAAyqshDMpEKoS63Z5gIgtkSLXa2lGpzOmMSmABqJiYwYpDAj15MZNMNP4pgAUiY2adTtF4uyQgW-YAakxQ24ANbA+Vc7lOush0NPUwa1VV9f1iCMOgTHUPd3QjYhSgAmM4yLYkCxQnMiXQrNizpCs6AzDCa2dRdJx7MdPhvJh2TgWxmzUTJrEIKAqiYRRUC-Y8Dj-F0AMQ2im1RIF4QXCRELDYMBObUTTS9OjUXLAAqLi9npDQyGwVFqi9PJyAADgdSiKJ+JgxSZe8FRUZVQNfD9OPYLhWgkHjF2IFIhgtJy4BxYIQNtf8w34+TnmOJ0XDIRQ6FrF03LIIZpDAABfIkgA | |
from PIL import Image | |
import nump |
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
from shiny import App, reactive, render, ui, module | |
from shiny.session import Session | |
from contextlib import redirect_stdout, redirect_stderr | |
import asyncio | |
from shiny_console import Console, console_ui, console_server | |
# == Example usage ======================================= | |
app_ui = ui.page_fluid( |
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) | |
library(bslib) | |
library(future) | |
library(promises) | |
future::plan(future::multisession) | |
ui <- page_sidebar( | |
sidebar = sidebar( | |
numericInput("x", "x", 5), |
Drop ratelimit.py
into your app directory to use in your own Shiny for Python app. See app.py
for an example of these decorators in action.
Why is this a gist instead of a PR? Because to implement this "properly" for Shiny for Python, this would need to be beefed up to include type annotations, support for async, and unit/integration tests, which would all be more effort than this has taken so far. (To be clear, we want to do all that, but in the meantime, here's this gist.)
NewerOlder