Skip to content

Instantly share code, notes, and snippets.

View prof18's full-sized avatar

Marco Gomiero prof18

View GitHub Profile
public class Parser extends AsyncTask<String, Void, String> implements Observer {
private XMLParser xmlParser;
private static ArrayList<Article> articles = new ArrayList<>();
private OnTaskCompleted onComplete;
public Parser() {
xmlParser = new XMLParser();
xmlParser.addObserver(this);
}
@prof18
prof18 / rest-server.py
Created December 18, 2016 22:46 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':