Skip to content

Instantly share code, notes, and snippets.

View ChloeCodesThings's full-sized avatar

Chloe Condon ChloeCodesThings

View GitHub Profile
________ _ _ __
/_ __/ /_ (_)____ ____ _(_)____/ /_
/ / / __ \/ / ___/ / __ `/ / ___/ __/
/ / / / / / (__ ) / /_/ / (__ ) /__
/_/ /_/ /_/_/____/ \__, /_/____/\__( )
__ __ _ /____/ _ _|/ __
/ /_/ /_ (_)____ ____ _(_)____/ /_/ /
/ __/ __ \/ / ___/ / __ `/ / ___/ __/ /
/ /_/ / / / (__ ) / /_/ / (__ ) /_/_/
@ChloeCodesThings
ChloeCodesThings / package.json
Created October 18, 2019 22:36
Dependencies for using Twilio in Azure (for Mean Girls Day app)
{
"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 September 29, 2019 19:21
Function sample for Alerting App
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 June 3, 2019 21:48
The bindings for our pill reminder function (phone call)
{
"bindings": [
{
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 10 19 * * *"
},
{
"type": "twilioSms",
@ChloeCodesThings
ChloeCodesThings / index.js
Created June 3, 2019 21:28
Reminder app sample code (phone call)
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 June 4, 2019 19:30
Reminder app sample code
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!');
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'
{
"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"
},
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 March 29, 2019 05:15
An Ambivert's Guide to Azure Functions Sample Code- Call Example
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,