This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Generates number of random geolocation points given a center and a radius. | |
| * @param {Object} center A JS object with lat and lng attributes. | |
| * @param {number} radius Radius in meters. | |
| * @param {number} count Number of points to generate. | |
| * @return {array} Array of Objects with lat and lng attributes. | |
| */ | |
| function generateRandomPoints(center, radius, count) { | |
| var points = []; | |
| for (var i=0; i<count; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| def extract_action_items(): | |
| action_items = [] | |
| with open("action_items.csv", "r") as csvFile: | |
| reader = csv.DictReader(csvFile,delimiter='\n') | |
| for row in reader: | |
| action_items.append(row['action_items']) | |
| return action_items |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import jwt from 'jsonwebtoken'; | |
| import db from '../db'; | |
| const Auth = { | |
| /** | |
| * Verify Token | |
| * @param {object} req | |
| * @param {object} res | |
| * @param {object} next | |
| * @returns {object|void} response object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/src/views/BlogpostView.py | |
| # app initiliazation | |
| ##################### | |
| # existing code remain # | |
| ###################### | |
| @blogpost_api.route('/', methods=['POST']) | |
| @Auth.auth_required | |
| def create(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/src/views/BlogpostView.py | |
| # app initiliazation | |
| ##################### | |
| # existing code remain # | |
| ###################### | |
| @blogpost_api.route('/', methods=['POST']) | |
| @Auth.auth_required | |
| def create(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/src/views/BlogpostView.py | |
| # app initiliazation | |
| ##################### | |
| # existing code remain # | |
| ###################### | |
| @blogpost_api.route('/', methods=['POST']) | |
| @Auth.auth_required | |
| def create(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/src/views/BlogpostView.py | |
| # app initiliazation | |
| ##################### | |
| # existing code remain # | |
| ###################### | |
| @blogpost_api.route('/', methods=['POST']) | |
| @Auth.auth_required | |
| def create(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/src/views/BlogpostView.py | |
| from flask import request, g, Blueprint, json, Response | |
| from ..shared.Authentication import Auth | |
| from ..models.BlogpostModel import BlogpostModel, BlogpostSchema | |
| blogpost_api = Blueprint('blogpost_api', __name__) | |
| blogpost_schema = BlogpostSchema() | |
| @blogpost_api.route('/', methods=['POST']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #src/app.py | |
| from flask import Flask | |
| from .config import app_config | |
| from .models import db, bcrypt | |
| # import user_api blueprint | |
| from .views.UserView import user_api as user_blueprint # add this line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/src/views/UserView | |
| from flask import request, json, Response, Blueprint, g | |
| from ..models.UserModel import UserModel, UserSchema | |
| from ..shared.Authentication import Auth | |
| user_api = Blueprint('user_api', __name__) | |
| user_schema = UserSchema() | |
NewerOlder