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
| # https://gist.github.com/FranzDiebold/898396a6be785d9b5ca6f3706ef9b0bc | |
| """Hack to add per-session state to Streamlit. | |
| Works for Streamlit >= v0.65 | |
| Usage | |
| ----- | |
| >>> import SessionState | |
| >>> |
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
| """Hack to add per-session state to Streamlit. | |
| Usage | |
| ----- | |
| >>> import SessionState | |
| >>> | |
| >>> session_state = SessionState.get(user_name='', favorite_color='black') | |
| >>> session_state.user_name | |
| '' |
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
| Assume IIS is installed. My machine already had IIs 8.5. | |
| Install Python | |
| ============== | |
| 1. Download web installer (Python 3.6.3). | |
| 2. Run as Administrator. | |
| 3. Select custom installation for all users. | |
| 4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious. | |
| 5. Check the box for "Add Python 3.6 to PATH". |
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
| docker exec -it container-name redis-cli FLUSHALL |
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 sys | |
| import re | |
| import requests | |
| from hurry.filesize import size | |
| NEXT = re.compile('\<(?P<url>[^\>]+)\>; rel\=\"next\"') | |
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
| # -*- coding: utf-8 -*- | |
| u""" | |
| Beta regression for modeling rates and proportions. | |
| References | |
| ---------- | |
| Grün, Bettina, Ioannis Kosmidis, and Achim Zeileis. Extended beta regression | |
| in R: Shaken, stirred, mixed, and partitioned. No. 2011-22. Working Papers in | |
| Economics and Statistics, 2011. |
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
| # Only dependency needed | |
| import threading | |
| # Dependency for the task | |
| import datetime | |
| import time | |
| # Function wrapper | |
| def periodic_task(interval, times = -1): | |
| def outer_wrap(function): |