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 st_aggrid import AgGrid, JsCode, GridOptionsBuilder | |
>>import pandas as pd | |
>>df = pd.read_csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/airline-safety/airline-safety.csv') | |
gb = GridOptionsBuilder.from_dataframe(df) | |
gb.configure_selection('single', pre_selected_rows=[], use_checkbox=False) | |
gridOptions = gb.build() | |
gridOptions['rowClassRules'] = { |
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 | |
import streamlit.components.v1 as components | |
from streamlit_extras.row import row | |
from streamlit_extras.stylable_container import stylable_container | |
with st.sidebar: | |
st.markdown(""" | |
<style> | |
:root { | |
--header-height: 50px; |
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 gtfs_realtime_OVapi_pb2 as ovapi | |
import requests | |
import urllib.request | |
from datetime import datetime | |
import time | |
from google.protobuf.json_format import MessageToJson, MessageToDict | |
from IPython import embed | |
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
cat track_bus699.geojson | jq '[([.geometry.coordinates, .properties.times] | transpose | .[] | {"coordinates": .[0], "start": .[1]}) as $features | del(.geometry.coordinates, .properties.times) | .geometry += {"coordinates": $features.coordinates} | .properties += {"start": $features.start, "end": ($features.start | (gsub("\\s"; "T") + "Z") as $date | $date | fromdate | . + 2)}] |
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
with st.sidebar: | |
st.markdown(""" | |
<style> | |
:root { | |
--header-height: 50px; | |
} | |
[data-testid="stHeader"] { | |
background-image: url(/app/static/icons8-astrolabe-64.png); | |
background-repeat: no-repeat; | |
background-size: contain; |
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 st_aggrid import AgGrid | |
import pandas as pd | |
df = pd.read_csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/airline-safety/airline-safety.csv') | |
custom_css = { | |
".ag-row-even": {"background-color": "rgba(0,0,0,0.2) !important"}, | |
".ag-header-cell": {"background-color": "orange !important"}, | |
".ag-theme-streamlit": {"--ag-borders": "none", |
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 | |
class App(): | |
def __init__(self, default=None): | |
self.page = default | |
self.args = [] | |
self.kwargs = {} | |
def goto(self, page, *args, **kwargs): | |
self.page = page |
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
eventDidMount: function (event) { | |
event.el.addEventListener('dblclick', () => { | |
console.log(event); | |
}); | |
}, |
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 pandas as pd | |
import numpy as np | |
import math | |
from datetime import datetime, timedelta | |
df1 = pd.DataFrame() | |
df1["time"] = pd.date_range('08/12/2021 00:00:01', periods=6, freq="4S") | |
df1['values'] = [1, 2, 3, 4, 5, 6] | |
df2 = pd.DataFrame() |
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 flask import Flask, request, url_for | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask.ext.admin.contrib import sqlamodel | |
from flask.ext import admin | |
# Create application | |
app = Flask(__name__) | |
# Create dummy secrey key so we can use sessions |
NewerOlder