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
# 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 |
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
<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" |
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
#!/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 |
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
ps -ef | grep mongod |
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 pymongo | |
import sys | |
c = pymongo.MongoClient(host=["mongodb://localhost:27017", | |
"mongodb://localhost:27018", | |
"mongodb://localhost:27019"], | |
replicaSet="m101", | |
w=1, | |
j=True) |
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
#!/usr/bin/env python | |
""" | |
Updates documents in a safe manner and catches expected errors. | |
""" | |
import pymongo | |
import time | |
# Previous code; left here for reference. |
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
// 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 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
export FLASK_APP=wsgi.py | |
export FLASK_DEBUG=1 | |
flask run |
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
Vue.component('coupon', { | |
props: ['code'], | |
template: ` | |
<input type="text" | |
:value="code" | |
@input="updateCode($event.target.value)" | |
ref="input"> | |
`, |
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
-- Assignment Data Warehouse Sql To test get data from northwind 3 and 4 | |
use northwind3 -- or 4 | |
go | |
SELECT TOP(100) c.city, sum((1-od.Discount) * od.UnitPrice * Quantity) as Amount | |
From [Order Details] od, Orders o, Customers c | |
Where od.OrderID = o.OrderID and o.CustomerID = c. CustomerID | |
GROUP BY c.CITY; |