Skip to content

Instantly share code, notes, and snippets.

View mmchugh's full-sized avatar

Michael McHugh mmchugh

  • St. Catharines, Ontario
View GitHub Profile
from flask import Flask, jsonify, request
from sparkpost import SparkPost
app = Flask(__name__)
SPARKPOST_KEY = '<SPARKPOST_API_KEY>'
VALIDATION_CODE = '<OPEN_CHANNEL_PLATFORM_VALIDATION>'
@app.route('/message/push', methods=['POST'])
@mmchugh
mmchugh / obj_loader.py
Last active August 29, 2015 14:26
loads a wavefront .obj file and returns vertices and indices (if indices requested)
def load_obj(filename, indexed=True):
vertices = []
textures = []
normals = []
out_vertices = []
out_indices = []
vertex_map = {}
with open(filename) as obj_file:
<!doctype html>
<body><a href="ua-demo:/?key=5wRE6Z5fQsWsQoEykf4SUw&secret=9ObS64LCStOCRqDJelkfZw">try now</a></body>
@mmchugh
mmchugh / cube.obj
Created July 9, 2015 21:07
simple obj file cube
g cube
v 0.0 0.0 0.0
v 0.0 0.0 1.0
v 0.0 1.0 0.0
v 0.0 1.0 1.0
v 1.0 0.0 0.0
v 1.0 0.0 1.0
v 1.0 1.0 0.0
v 1.0 1.0 1.0
var rAS = require('request-animation-stream');
var canvas_el = document.getElementById('main-canvas');
var context = canvas_el.getContext('2d');
var render_stream = rAS(true, true);
var blue = 0;
var red = 0;