Skip to content

Instantly share code, notes, and snippets.

Avatar

Chloe Condon ChloeCodesThings

View GitHub Profile
View thisgist
________ _ _ __
/_ __/ /_ (_)____ ____ _(_)____/ /_
/ / / __ \/ / ___/ / __ `/ / ___/ __/
/ / / / / / (__ ) / /_/ / (__ ) /__
/_/ /_/ /_/_/____/ \__, /_/____/\__( )
__ __ _ /____/ _ _|/ __
/ /_/ /_ (_)____ ____ _(_)____/ /_/ /
/ __/ __ \/ / ___/ / __ `/ / ___/ __/ /
/ /_/ / / / (__ ) / /_/ / (__ ) /_/_/
@ChloeCodesThings
ChloeCodesThings / package.json
Created Oct 18, 2019
Dependencies for using Twilio in Azure (for Mean Girls Day app)
View package.json
{
"name": "twilio-azure-functions-node",
"version": "1.0.0",
"description": "Receive SMS and calls with Azure Functions and Node.js",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Twilio and your-name",
"license": "MIT",
@ChloeCodesThings
ChloeCodesThings / index.js
Created Sep 29, 2019
Function sample for Alerting App
View index.js
const functions = require('firebase-functions')
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
// exports.helloWorld = functions.https.onRequest((request, response) => {
// response.send("Hello from Firebase!");
// });
// Init Twilio
@ChloeCodesThings
ChloeCodesThings / function.json
Created Jun 3, 2019
The bindings for our pill reminder function (phone call)
View function.json
{
"bindings": [
{
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 10 19 * * *"
},
{
"type": "twilioSms",
@ChloeCodesThings
ChloeCodesThings / index.js
Created Jun 3, 2019
Reminder app sample code (phone call)
View index.js
const accountSid = process.env.TWILIO_SID;
const authToken = process.env.TWILIO_TOKEN;
const client = require('twilio')(accountSid, authToken);
module.exports = async function (context, myTimer) {
var timeStamp = new Date().toISOString();
if (myTimer.IsPastDue)
{
context.log('JavaScript is running late!');
@ChloeCodesThings
ChloeCodesThings / index.js
Last active Jun 4, 2019
Reminder app sample code
View index.js
const accountSid = process.env.TWILIO_SID;
const authToken = process.env.TWILIO_TOKEN;
const client = require('twilio')(accountSid, authToken);
module.exports = async function (context, myTimer) {
var timeStamp = new Date().toISOString();
if (myTimer.IsPastDue)
{
context.log('JavaScript is running late!');
View detect-face.py
import requests
import json
subscription_key = '<YOUR-SUBSCRIPTION-KEY>'
assert subscription_key
face_api_url = '<YOUR-FACEAPI-URL>'
image_url = 'https://pm1.narvii.com/5826/48f03a0d21f56888f42babb86d07459d09638d75_hq.jpg'
View AstrologyData.json
{
"name": "Lemmy",
"image": "https://www.mariowiki.com/images/thumb/f/fc/MK8_Lemmy_Icon.png/64px-MK8_Lemmy_Icon.png",
"text": "You're pretty chill, and have your moments of happiness. A tiny part of you loves to break the rules",
"msftvintage": "https://bit.ly/2w3JIwF",
"faceapidata": "sadness: 0.0, neutral: 0.27, contempt: 0.001, disgust: 0.0, anger: 0.0, surprise: 0.0, fear: 0.0, happiness: 0.729"
},
View mario_faceapi_sample_code.py
import requests
import json
subscription_key = '<YOUR-SUBSCRIPTION-KEY>'
assert subscription_key
face_api_url = '<YOUR-FACEAPI-URL>'
image_url = '<URL-OF-IMAGE>'
@ChloeCodesThings
ChloeCodesThings / index.js
Last active Mar 29, 2019
An Ambivert's Guide to Azure Functions Sample Code- Call Example
View index.js
const accountSid = process.env.TWILIO_SID;
const authToken = process.env.TWILIO_TOKEN;
const client = require('twilio')(accountSid, authToken);
// This can also be accomplished with a Twilio output binding- you can read more on this at http://aka.ms/AA4n3j
module.exports = async function (context){
const twilioOptions = {
url: process.env.TWIML_URL,
to: process.env.RECIPIENT_NUMBER,