Skip to content

Instantly share code, notes, and snippets.


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
# Gunicorn Web Server
ardrian /
Created Apr 16, 2018
Basic Flask Example
from flask import Flask
app = Flask(__name__)
def hello_world():
return 'Hello, World!'
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 /
Last active Feb 8, 2018
Update Splitwise group expenses
# 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 / gist:dcb47afeb59cad0234eb
Last active Aug 29, 2015 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();
message: message,
async: true,
send_at: send_at