Assuming you have Python installed on your system:
pip install twisted
pip install pyOpenSSL
pip install service_identity
class MediaRequestHandler: public Poco::Net::HTTPRequestHandler | |
{ | |
public: | |
enum | |
{ | |
BUFFER_SIZE = 8192 | |
}; | |
MediaRequestHandler(const std::string& mediaPath): | |
_mediaPath(mediaPath) |
import base64 | |
import json | |
import logging | |
import os | |
import sys | |
from abc import ABC | |
import jwt | |
import tornado.escape | |
import tornado.httpserver |
import logging | |
import fcntl | |
from contextlib import contextmanager | |
@contextmanager | |
def locked_open(filename, mode='r'): | |
"""locked_open(filename, mode='r') -> <open file object> | |
Context manager that on entry opens the path `filename`, using `mode` | |
(default: `r`), and applies an advisory write lock on the file which |
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |
# -*- coding: utf-8 -*- | |
""" | |
Sessions module for the Tornado framework. | |
Milan Cermak <[email protected]> | |
This module implements sessions for Tornado. It can store | |
session data in files or MySQL databse, Memcached, Redis | |
and MongoDB. |
import cv2 | |
import time | |
CONFIDENCE_THRESHOLD = 0.2 | |
NMS_THRESHOLD = 0.4 | |
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)] | |
class_names = [] | |
with open("classes.txt", "r") as f: | |
class_names = [cname.strip() for cname in f.readlines()] |
Create React App does not provide watching build mode oficially (#1070).
This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.
Create a React app.
Put the script into scripts/watch.js
.
<!-- From: https://gist.githubusercontent.com/sorvell/48f4b7be35c8748e8f6db5c66d36ee29/raw/67346e4e8bc4c81d5a7968d18f0a6a8bc00d792e/index.html --> | |
<!doctype html> | |
<html> | |
<head> | |
<!-- Polyfills only needed for Firefox and Edge. --> | |
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script> | |
</head> | |
<body> | |
<!-- Works only on browsers that support Javascript modules like | |
Chrome, Safari, Firefox 60, Edge 17 --> |