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
| package com.example.android.goalchallenge; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.TextView; | |
| import android.widget.Toast; | |
| // This is an example of an implementation of inheritance | |
| public class MainActivity extends AppCompatActivity { |
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
| class Calculation { | |
| private int batteryLife = 10; | |
| int z; | |
| int w; | |
| public void addition(int x, int y) { | |
| z = x + y; | |
| System.out.println("The sum of the given numbers:"+z); | |
| } |
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
| asn1crypto==0.24.0 | |
| certifi==2018.4.16 | |
| cffi==1.11.5 | |
| chardet==3.0.4 | |
| click==6.7 | |
| cryptography==2.2.2 | |
| Flask==1.0.2 | |
| Flask-API==1.0 | |
| gspread==3.0.0 | |
| gunicorn==19.8.1 |
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 os | |
| from flask import Flask, request, make_response, render_template | |
| app = Flask(__name__) | |
| @app.route("/", methods=["GET"]) | |
| def home(): | |
| """This route renders a hello world text.""" | |
| #rendering text | |
| return 'Hello World' | |
| if __name__ == '__main__': | |
| app.run() |
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
| from os import path, environ | |
| from dotenv import load_dotenv | |
| env_path = path.join(path.dirname(__file__), path.pardir, '.env') | |
| load_dotenv(env_path, override=True) | |
| def get_env(key): | |
| return environ.get(key) |
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
| from config import get_env | |
| class EnvConfig(object): | |
| """Parent configuration class.""" | |
| DEBUG = False | |
| CSRF_ENABLED = True | |
| SECRET = get_env('SECRET') | |
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 gspread | |
| from os import path | |
| from config import get_env | |
| from oauth2client.service_account import ServiceAccountCredentials | |
| class GappsHelper: | |
| def __init__(self): | |
| # setup for google sheet - Google Drive API Instance |
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
| from slackclient import SlackClient | |
| from config import get_env | |
| class SlackHelper: | |
| def __init__(self): | |
| self.slack_token = get_env('SLACK_TOKEN') | |
| self.slack_client = SlackClient(self.slack_token) | |
| self.slack_channel = get_env('SLACK_CHANNEL') |
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
| from config import get_env | |
| from app import create_app | |
| app = create_app(get_env('APP_ENV')) | |
| if __name__ == '__main__': | |
| app.run() |
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
| from flask_api import FlaskAPI | |
| from config.env import app_env | |
| from app.utils.slackhelper import SlackHelper | |
| # from flask import request, jsonify | |
| # from re import match | |
| # from app.actions import Actions | |
| def create_app(config_name): | |
| app = FlaskAPI(__name__, instance_relative_config=False) |
OlderNewer