This file contains 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 time | |
import mido | |
import streamlit as st | |
EMPTY_DEVICE_PLACEHOLDER = "-" | |
LIGHT_PLACEHOLDER = "Light!" | |
NOTE_PLACEHOLDER = "Wait for note" | |
This file contains 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
""" | |
PS: all password entries are in cleartext between server and browser, DO NOT DEPLOY THIS ON A SERVER. EVER. | |
""" | |
from io import BufferedReader | |
from typing import Any | |
import streamlit as st | |
from construct import Container | |
from pykeepass import PyKeePass | |
from pykeepass.exceptions import CredentialsError |
This file contains 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 random | |
import time | |
import streamlit as st | |
from streamlit_echarts import st_echarts | |
MAX_ITERATIONS = 100 | |
if "iteration" not in st.session_state: | |
st.session_state["iteration"] = 0 |
This file contains 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
def set_page_title(title): | |
st.sidebar.markdown(unsafe_allow_html=True, body=f""" | |
<iframe height=0 srcdoc="<script> | |
const title = window.parent.document.querySelector('title') \ | |
const oldObserver = window.parent.titleObserver | |
if (oldObserver) {{ | |
oldObserver.disconnect() | |
}} \ |
This file contains 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 pickle | |
from pathlib import Path | |
import streamlit as st | |
from google.auth.transport.requests import Request | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from googleapiclient.discovery import build | |
This file contains 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 dataclasses import dataclass | |
from datetime import datetime | |
import streamlit as st | |
from IPython.core.history import HistoryAccessor | |
@dataclass | |
class IPythonSession: | |
session_id: int |
This file contains 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
""" | |
streamlit run st_crop_image.py | |
""" | |
import streamlit as st | |
import numpy as np | |
from pathlib import Path | |
from PIL import Image | |
from PIL import ImageDraw | |
st.title("Cropping an Image in a circular way using Python") |
This file contains 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
""" | |
pip install nbconvert | |
https://nbconvert.readthedocs.io/en/latest/nbconvert_library.html | |
""" | |
import base64 | |
import io | |
import nbformat | |
import streamlit as st | |
from PIL import Image |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 | |
from ghapi.all import GhApi | |
@st.experimental_singleton | |
def load_ghapi(): | |
return GhApi() | |