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
web: gunicorn app:app |
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
# This file is used by pip to install required python packages | |
# Usage: pip install -r requirements.txt | |
# Flask Framework | |
Flask==0.12 | |
# Gunicorn Web Server | |
gunicorn==19.7.1 |
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
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello, World!' |
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 face_recognition | |
import glob, os | |
def contains_face(filename): | |
image = face_recognition.load_image_file(filename) | |
face_locations = face_recognition.face_locations(image) | |
return len(face_locations) > 0 | |
def main(): |
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
# This script wasn't completed. There is an authentication error returned when we attempt to update | |
# a transaction. The strange thing is that we are allowed to retrieve items with no problems, | |
# also if we send an invalid write, we receive an error response which makes sense (i.e. when | |
# Sum(user_costs) != expense_cost | |
# | |
# If we were finishing this script we would need to do the following: | |
# 1) Use a proper exchange rate | |
# 2) Detect when currency == JPY, only covert then | |
# 3) Update the currency value to AUD after the conversion | |
# 4) Some kind of logging in case we mess things up |
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
// This method sends an email via Mandrill. It returns a promise chain | |
// so that it can be more neatly included as part of a promise chain. | |
var sendMandrillEmailPromise = function(message,send_at){ | |
var promise = new Parse.Promise(); | |
Mandrill.sendEmail({ | |
message: message, | |
async: true, | |
send_at: send_at | |
},{ |