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
const MEDIA_TYPE = "video/webm;codecs=vp9,opus" | |
//const MEDIA_TYPE = "video/webm;codecs=h264" | |
const BLOB_TYPE = "video/webm" | |
class ScreenCastRecorder { | |
constructor({ recordAudio }) { | |
this.recordAudio = recordAudio | |
this.inputStream = null |
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 streamlit.ScriptRequestQueue import RerunData | |
from streamlit.ScriptRunner import RerunException | |
from streamlit.server.Server import Server | |
import streamlit.ReportThread as ReportThread | |
def rerun(): | |
"""Rerun a Streamlit app from the top!""" | |
widget_states = _get_widget_states() | |
raise RerunException(RerunData(widget_states)) |
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 streamlit as st | |
import time | |
class TimeIt(object): | |
"""Simple timer for profiling Streamlit apps. | |
Usage | |
----- |
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
javascript:(() => { | |
const css = document.createElement('style'); | |
css.innerText = ` | |
/* Change background */ | |
.js-project-header { | |
background: #23527b!important; | |
} | |
.project-columns { | |
background: #23527b!important; |
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
javascript:(() => { | |
/* Autohide header */ | |
const header = document.querySelector('.nH.w-asV.aiw'); | |
hide = () => { | |
header.style.transition = 'opacity 300ms 300ms, transform 300ms 300ms'; | |
header.style.opacity = 0; | |
header.style.transform = 'translateY(-50px)'; |
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 streamlit as st | |
import traceback | |
class opt_echo: | |
"""Replacement for st.echo that includes a checkbox saying "show code". | |
Usage | |
----- | |
>>> with opt_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
import streamlit.ReportThread as ReportThread | |
from streamlit.server.Server import Server | |
class ThreadSafeSt(): | |
def __init__(self): | |
"""Object that write to a Streamlit app outside the main thread. | |
This object must be created from the main thread, and then passed | |
around to other threads so they can write to the Streamlit app. |
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 streamlit.ReportThread as ReportThread | |
from streamlit.server.Server import Server | |
def get_session_id(): | |
# Hack to get the session object from Streamlit. | |
ctx = ReportThread.get_report_ctx() | |
this_session = None |
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 streamlit as st | |
import os | |
import sys | |
import importlib.util | |
# Parse command-line arguments. | |
if len(sys.argv) > 1: | |
folder = os.path.abspath(sys.argv[1]) | |
else: | |
folder = os.path.abspath(os.getcwd()) |
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 os | |
import signal | |
import subprocess | |
import sys | |
# Parse command-line arguments. | |
if len(sys.argv) > 1: | |
folder = os.path.abspath(sys.argv[1]) | |
else: | |
folder = os.path.abspath(os.getcwd()) |