Skip to content

Instantly share code, notes, and snippets.

# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
# Unzip
unzip protoc-3.3.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@rvegas
rvegas / readme.md
Created January 18, 2017 22:36
keepcoding webinar 1 - resources

###Installations### sudo pip install flask
sudo pip install supervisor
sudo pip install gunicorn

###Running the microservice###

  • direct:python damage.py
  • gunicorn: gunicorn damage:app -w 4 -b 0.0.0.0:8000 --name==damage_service
  • supervisor: supervisorctl start damage_service o localhost:9001
@rvegas
rvegas / damage.py
Created January 18, 2017 22:27
keepcoding webinar 1 - damage.py
from flask import Flask, request, jsonify
import random
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route("/", methods=['GET'])
def damage():
@rvegas
rvegas / damage.py
Created December 18, 2016 22:07
Calculates final damage according to parameters
from flask import Flask, request, jsonify
import random
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route("/", methods=['GET'])
def damage():
damage_type = request.args.get('type', default='melee')
distance_to_target = request.args.get('distance', default=0, type=int)