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
# Nginx configuration server block for static frontend and websocket backend | |
# For example - React and Gunicorn or Angular and Rack | |
# | |
# Setup: | |
# sudo cp nginx.conf /etc/nginx/sites-available/mynewconfig | |
# sudo ln -s /etc/nginx/sites-available/mynewconfig /etc/nginx/sites-enabled | |
# sudo rm /etc/nginx/sites-enabled/default | |
# sudo service nginx restart | |
# |
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
# The docs say "Unfortunately, there is no easy way of applying HTTP Basic Auth just to your admin interface." | |
# But this is not true :) | |
# First: | |
# pip install flask-admin | |
# pip install flask-basicauth | |
from flask_admin import Admin | |
from flask_admin.contrib.sqla import ModelView | |
from flask_admin.base import expose, AdminIndexView | |
from flask_basicauth import BasicAuth |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
export default class ReactiveIframe extends React.Component { | |
static propTypes = { | |
origin: PropTypes.string.isRequired, | |
src: PropTypes.string.isRequired, | |
onMessage: PropTypes.func.isRequired, | |
title: PropTypes.string, | |
frameBorder: PropTypes.number |
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
/* global chrome */ | |
const MEMORY_KEY_PREFIX = '@BackgroundStorage:'; | |
let dataMemory = {}; | |
export default class BackgroundStorage { | |
static syncPromise = null; |