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
kill $(ps aux | grep './ngrok' | awk '{print $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
perl -pi -e 's|execution_count": null|execution_count": 1|g' course-v4/nbs/*ipynb | |
nohup jupyter notebook --no-browser --allow-root --ip=0.0.0.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
git clone 'https://github.com/fastai/course-v4.git' | |
echo Setting up server... | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -q | |
sudo apt-get install -y nodejs -q | |
pip install jupyter jupyterlab --upgrade -q | |
pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install -q | |
pip install -r /content/course-v4/requirements.txt -q | |
wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
unzip -qq -n ngrok-stable-linux-amd64.zip |
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 starlette.applications import Starlette | |
from starlette.responses import StreamingResponse, HTMLResponse | |
from starlette.routing import Route | |
from pathlib import Path | |
VIDEO_PATH = Path('videos') | |
def stream(request): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
INF = 10 ** 9 | |
class City(object): | |
__slots__ = ('city_id', 'x', 'y') | |
def __init__(self, city_id, x, y): | |
self.city_id = int(city_id) | |
self.x = x | |
self.y = y |
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 heapq import heappop, heappush | |
class MinHeap(object): | |
def __init__(self): | |
self._items = [] | |
def push(self, item): | |
heappush(self._items, item) |