This file contains 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
#!/bin/bash | |
# perform the data migration | |
flask db migrate | |
flask db upgrade | |
if [ "$FLASK_ENV" == "development" ]; then | |
flask run --host=0.0.0.0 --port=8080 | |
else | |
gunicorn --bind=0.0.0.0:8080 run:app |
This file contains 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.6 | |
WORKDIR /usr/src/app | |
# To avoid invalidating docker's build | |
# cache everytime we are copying the app | |
# into the image, we will copy the | |
# requirements.txt first and then in later | |
# step we will copy the entire app | |
COPY requirements.txt /usr/src/app/ | |
RUN pip install -r requirements.txt |
This file contains 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
runtime: custom | |
env: flex | |
# Replace project and instance with the values obtained when configuring your | |
# Cloud SQL instance. "INSTANCE-CONNECTION-NAME" Can be copied from | |
# https://console.cloud.google.com/sql/instances/ | |
beta_settings: | |
cloud_sql_instances: INSTANCE-CONNECTION-NAME |
This file contains 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
alembic==1.0.10 | |
bcrypt==3.1.4 | |
blinker==1.4 | |
cachetools==3.1.0 | |
captcha==0.3 | |
certifi==2019.3.9 | |
cffi==1.11.5 | |
chardet==3.0.4 | |
Click==7.0 | |
Flask==1.0.2 |
This file contains 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 face_recognition | |
from PIL import Image | |
np_image = face_recognition.load_image_file("avengers2.jpg") | |
# face_locations returns a list of locations for each face | |
# detected in the picture, each list item contains a tuple | |
# of 4 items in the format of (top, right, bottom, left) | |
face_locations = face_recognition.face_locations(np_image) |
This file contains 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
<?php | |
// Guessing this script is placed in the root wordpress directory. | |
// If not, change the require_once statements script path accordingly. | |
require_once('wp-load.php'); | |
require_once('wp-admin/includes/taxonomy.php'); | |
$conn = new mysqli('localhost', 'username', 'password', 'database'); | |
if ($conn->connect_error) { | |
die('Connection failed'); |
This file contains 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
<?php | |
// Guessing this script is placed in the root wordpress directory. | |
// If not, change the require_once statements script path accordingly. | |
require_once('wp-load.php'); | |
require_once('wp-admin/includes/taxonomy.php'); | |
// Connect to database and get data | |
$conn = new mysqli('localhost', 'username', 'password', 'databasename'); | |
if ($conn->connect_error) { |
This file contains 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
/** | |
* A simple function to sort an array of obejcts each with a string field | |
* called 'name' and and a number field called 'age'. | |
*/ | |
// | |
// Test Code | |
// | |
// var familyMembers = [ | |
// { |