This impliments a redis cluster backend for Flask-Cache as the standard redis cache cannot handle a redis cluster.
class Config(object):
# Example of combining Flask-Security and Flask-Admin. | |
# by Steve Saporta | |
# April 15, 2014 | |
# | |
# Uses Flask-Security to control access to the application, with "admin" and "end-user" roles. | |
# Uses Flask-Admin to provide an admin UI for the lists of users and roles. | |
# SQLAlchemy ORM, Flask-Mail and WTForms are used in supporting roles, as well. | |
from flask import Flask, render_template | |
from flask.ext.sqlalchemy import SQLAlchemy |
<div id="offcanvas_side_nav" class="uk-offcanvas"> | |
<div class="uk-offcanvas-bar uk-offcanvas-bar-flip"> | |
<div class="uk-offcanvas-bar"> | |
<ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav> | |
<li class="uk-nav-header"> | |
<a class="button_link_like" | |
id="turn_off_offcanvas" |
#!/usr/bin/env python | |
import pymongo | |
import gridfs | |
# establish a connection to the database | |
connection = pymongo.MongoClient() | |
#get a handle to the test database | |
db = connection.test |
ps -ef | grep mongod |
import pymongo | |
import sys | |
c = pymongo.MongoClient(host=["mongodb://localhost:27017", | |
"mongodb://localhost:27018", | |
"mongodb://localhost:27019"], | |
replicaSet="m101", | |
w=1, | |
j=True) |
#!/usr/bin/env python | |
""" | |
Updates documents in a safe manner and catches expected errors. | |
""" | |
import pymongo | |
import time | |
# Previous code; left here for reference. |
export FLASK_APP=wsgi.py | |
export FLASK_DEBUG=1 | |
flask run |
// Unity C# Cheat Sheet | |
// I made these examples for students with prior exerience working with C# and Unity. | |
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting |
This impliments a redis cluster backend for Flask-Cache as the standard redis cache cannot handle a redis cluster.
class Config(object):
Vue.component('coupon', { | |
props: ['code'], | |
template: ` | |
<input type="text" | |
:value="code" | |
@input="updateCode($event.target.value)" | |
ref="input"> | |
`, |