Skip to content

Instantly share code, notes, and snippets.

Avatar

Ardrian ardrian

View GitHub Profile
View requirements.txt
# 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
@ardrian
ardrian / app.py
Created Apr 16, 2018
Basic Flask Example
View app.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
View MoveNonFaces.py
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():
@ardrian
ardrian / UpdateExpenses.py
Last active Feb 8, 2018
Update Splitwise group expenses
View UpdateExpenses.py
# 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
@ardrian
ardrian / gist:dcb47afeb59cad0234eb
Last active Aug 29, 2015
Parse.com Mandrill Send with Promise
View gist:dcb47afeb59cad0234eb
// 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
},{