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
# more extensive check intended for scenerios such as pulling an existing repo you're unfamiliar with, pulling down changes | |
# and wanting to ensure your current node_modules/ is up-to-date with any package.json changes, etc. | |
# you will automatically be prompted to install the two required global npm modules | |
nodecheck() { | |
printf "\n\n" | |
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - | |
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' . | |
printf "ENVIRONMENT:\n" |
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
is_dir() { | |
DIR=$1 | |
if [ -d $DIR ]; then | |
echo "YES"; | |
exit; | |
fi | |
echo "NO"; | |
} | |
switch_check_current_exists() { | |
#check if cache already exists, ask to overwite if so |
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
export const oauth_redirect = functions.https.onRequest(async (request, response) => { | |
if (request.method !== "GET") { | |
console.error(`Got unsupported ${request.method} request. Expected GET.`); | |
return response.send(405, "Only GET requests are accepted"); | |
} | |
if (!request.query && !request.query.code) { | |
return response.status(401).send("Missing query attribute 'code'"); | |
} |
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 tensorflow as tf, sys | |
image_path = sys.argv[1] | |
def read_tensor_from_image_file(file_name, | |
input_height=299, | |
input_width=299, | |
input_mean=0, | |
input_std=255): | |
input_name = "file_reader" | |
output_name = "normalized" |
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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
// Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/ | |
/** | |
* Fetch and log a request | |
* @param {Request} request | |
*/ |