The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.
# pulling one User object
user = User.query.get(1)
| { | |
| "AWSTemplateFormatVersion": "2010-09-09", | |
| "Description": "A VPC environment in two availability zones with an NAT instance.", | |
| "Parameters": { | |
| "envPrefix": { | |
| "Description": "Environment name prefix.", | |
| "Type": "String", | |
| "Default": "Test" | |
| }, | |
| "vpcCidr": { |
| # This configuration is based on the Wizard config and also the these ones: | |
| # https://blog.dlasley.net/2013/06/initial-configuration-ubiquiti-edgerouter-lite/ | |
| # http://lg.io/2015/01/11/the-ubiquiti-edgerouter-configuring-this-extremely-lowcost-enterprisegrade-router-for-home-use.html | |
| # | |
| # Create simple firewall rules for Inbound wan to lan and local router | |
| edit firewall | |
| set all-ping enable | |
| set broadcast-ping disable | |
| set ipv6-receive-redirects disable | |
| set ipv6-src-route disable |
| import select | |
| import datetime | |
| import psycopg2 | |
| import psycopg2.extensions | |
| from sqlalchemy import create_engine, text | |
| engine = create_engine("postgresql+psycopg2://vagrant@/postgres") |
| #foreign imports | |
| from flask import Flask | |
| #domestic imports | |
| from modules.users import users, app_security, principals, login_manager, mail, user_datastore | |
| from modules.homes import homes | |
| from modules.admin import admin | |
| from modules.the_db import db | |
| """ | |
| This file is the master configuration file. |
The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.
# pulling one User object
user = User.query.get(1)
| wget http://stedolan.github.io/jq/download/linux64/jq | |
| aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
| "Name=instance-state-name,Values=running" \ | |
| | jq -r \ | |
| ".Reservations[] | .Instances[] | .InstanceId" \ | |
| aws ec2 describe-volumes --filters \ | |
| "Name=status,Values=available" \ | |
| | jq -r ".Volumes[] | .VolumeId" \ |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| """ | |
| required packages: | |
| numpy | |
| matplotlib | |
| basemap: http://matplotlib.org/basemap/users/installing.html | |
| shapely: https://pypi.python.org/pypi/Shapely | |
| descartes: https://pypi.python.org/pypi/descartes | |
| random |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Chart.js Redraw Example</title> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> | |
| <script type="text/javascript" charset="utf-8" src="chart.min.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| window.chartOptions = { | |
| segmentShowStroke: false, |
| from wsgiref.simple_server import make_server | |
| from pyramid.config import Configurator | |
| from pyramid.response import Response | |
| from pyramid.compat import text_type | |
| from sqlalchemy.orm import scoped_session | |
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.ext.declarative import declarative_base |