- Address: 16565 SW Wright st. 97007 Aloha, OR
- Phone: +1 210 941 5778
- Email: [email protected]
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
| (ns rao.rum | |
| (:require [rum.core :as rum])) | |
| (defn wiree | |
| "Mixin that creates a dispatch, `d!`, that triggers a state transition and updates the component. | |
| On startup (will-mount): | |
| 0. It adds an atom rao/local from the value of `initial-state`. | |
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 numpy as np | |
| from csbdeep.utils import normalize | |
| def norm_minmse(gt, x, normalize_gt=True): | |
| """ | |
| normalizes and affinely scales an image pair such that the MSE is minimized | |
| Parameters | |
| ---------- | |
| gt: ndarray |
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
| sudo add-apt-repository -y ppa:apt-fast/stable | |
| sudo add-apt-repository -y ppa:graphics-drivers/ppa | |
| sudo apt-get update | |
| sudo apt-get -y install apt-fast | |
| # prompts | |
| sudo apt-fast -y upgrade | |
| sudo apt-fast install -y python3-pip ubuntu-drivers-common libvorbis-dev libflac-dev libsndfile-dev cmake build-essential libgflags-dev libgoogle-glog-dev libgtest-dev google-mock zlib1g-dev libeigen3-dev libboost-all-dev libasound2-dev libogg-dev libtool libfftw3-dev libbz2-dev liblzma-dev libgoogle-glog0v5 gcc-6 gfortran-6 g++-6 doxygen graphviz libsox-fmt-all parallel exuberant-ctags vim-nox python-powerline python3-pip ack lsyncd | |
| sudo apt-fast install -y tigervnc-standalone-server firefox mesa-common-dev |
Serverless infrastructure like AWS Lambda and Google Cloud Functions have made it much cheaper for developers to offer server-side code for public consumption without keeping a server always running.
If these functions could be declared as stateless or deterministic, costs can be brought down even more because only the first invocation needs to be executed. Cached response could be returned for future invocations with the same input arguments.
All modern browsers support URL lengths of thousands of characters, even on mobile. A lot of data can be embedded and passed around directly in the URLs (instead of passing identifiers which requires a look-up which costs server time).
So here's a thought:
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
| # Based on the example from https://www.activestate.com/blog/dash-vs-bokeh/ | |
| import dash | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| import pandas as pd | |
| import plotly.graph_objs as obj | |
| import uvicorn as uvicorn | |
| from dash.dependencies import Input, Output | |
| from fastapi import FastAPI | |
| from starlette.middleware.wsgi import WSGIMiddleware |
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
| # WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned. | |
| # Docker | |
| sudo apt-get update | |
| sudo apt-get remove docker docker-engine docker.io | |
| sudo apt install docker.io | |
| sudo systemctl start docker | |
| sudo systemctl enable docker | |
| docker --version |
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 | |
| from persist import persist, load_widget_state | |
| def main(): | |
| if "page" not in st.session_state: | |
| # Initialize session state. | |
| st.session_state.update({ | |
| # Default page. | |
| "page": "home", |
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 asyncio | |
| import streamlit as st | |
| from httpx_oauth.clients.google import GoogleOAuth2 | |
| st.title("Google OAuth2 flow") | |
| "## Configuration" | |
| client_id = st.text_input("Client ID") |
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 asyncio | |
| import psycopg2 | |
| # dbname should be the same for the notifying process | |
| conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example") | |
| conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
| cursor = conn.cursor() | |
| cursor.execute(f"LISTEN match_updates;") |