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
| # Editors | |
| .vscode/ | |
| .idea/ | |
| # Vagrant | |
| .vagrant/ | |
| # Mac/OSX | |
| .DS_Store |
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 requests | |
| import time | |
| import pandas as pd | |
| from json import dumps | |
| headers = { | |
| 'Content-Type': 'application/json', | |
| 'Api-Key': 'api key here' | |
| } |
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 io | |
| import os | |
| from pathlib import Path | |
| from setuptools import find_packages, setup | |
| from setuptools.command.install import install | |
| from subprocess import call | |
| # Package meta-data | |
| NAME = 'your package name' |
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
| ## Basic Instructions | |
| # ------------------- | |
| # A package is on an open repository, follow the bellow example: | |
| # Where: | |
| # vcs = the provider [git+, hg+, svn+, bzr+] | |
| # protocol = https or ssh | |
| # egg = project name | |
| # subdirectory = address to setup.py from the project root | |
| -e vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir |
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
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # C extensions | |
| *.so | |
| # Distribution / packaging | |
| .Python |
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
| const first = new Promise((resolve, reject) => setTimeout(resolve, 5000)); | |
| const second = new Promise((resolve, reject) => setTimeout(reject, 5000)); | |
| Promise.allSettled([first, second]).then(myPromises => console.log(myPromises)); | |
| /* | |
| [ | |
| { status: 'fulfilled', value: undefined }, | |
| { status: 'rejected', value: undefined }, | |
| ] |
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
| # Example of combining Flask-Security and Flask-Admin. | |
| # by Steve Saporta | |
| # April 15, 2014 | |
| # | |
| # Uses Flask-Security to control access to the application, with "admin" and "end-user" roles. | |
| # Uses Flask-Admin to provide an admin UI for the lists of users and roles. | |
| # SQLAlchemy ORM, Flask-Mail and WTForms are used in supporting roles, as well. | |
| from flask import Flask, render_template | |
| from flask.ext.sqlalchemy import SQLAlchemy |
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 datetime import datetime | |
| from sqlalchemy import Column, Integer, DateTime, ForeignKey | |
| from sqlalchemy.orm import relationship | |
| from sqlalchemy.ext.declarative import declared_attr | |
| from flask_security import current_user | |
| class AuditMixin(object): | |
| created_at = Column(DateTime, default=datetime.now) | |
| updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now) |
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 python:3.7-alpine | |
| WORKDIR /app | |
| RUN apk update && apk upgrade | |
| RUN apk add --no-cache make g++ bash git openssh postgresql-dev curl | |
| RUN apk add --no-cache jpeg-dev zlib-dev | |
| RUN apk add --no-cache gcc libc-dev fortify-headers linux-headers libxslt-dev | |
| ENV PYTHONDONTWRITEBYTECODE 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
| { | |
| "schemaVersion": 2, | |
| "dockerfilePath": "./Dockerfile" | |
| } |