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
var Twilio = require('./index').Twilio; | |
var c = new Twilio(); | |
c.api.messages.create({ | |
to: '+16512080532', | |
from: process.env.TWILIO_NUMBER, | |
body: 'hey there' | |
}).then(function(data) { | |
console.log(data); |
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
Property.findOne({ | |
_id: propertyId | |
}).then(function (property) { | |
var reservation = new Reservation({ | |
message: req.body.message, | |
property: propertyId, | |
guest: user.id | |
}); | |
return reservation.save(); |
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
var mongoose = require('mongoose'); | |
var propertySchema = new mongoose.Schema({ | |
description: { type: String, required: true }, | |
imageUrl: { type: String, required: true }, | |
date: { type: Date, default: Date.now }, | |
owner: { | |
type: mongoose.Schema.Types.ObjectId, | |
ref: 'user' | |
} |
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 url(https://fonts.googleapis.com/css?family=Share+Tech+Mono); | |
body, | |
p { | |
padding: 0; | |
margin: 0 | |
} | |
body { | |
background: #272726 | |
} |
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
var accountSid = 'ACCOUNT_SID'; | |
var authToken = 'AUTH_TOKEN'; | |
var IpMessagingClient = require('twilio').IpMessagingClient | |
var client = new IpMessagingClient(accountSid, authToken); | |
var service = client.services('SERVICE_SID'); | |
service.channels.list().then(function(response) { | |
console.log(response); | |
}).fail(function(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
// You may want to be more specific in your imports | |
import java.util.*; | |
import com.twilio.sdk.*; | |
import com.twilio.sdk.resource.factory.*; | |
import com.twilio.sdk.resource.instance.*; | |
import com.twilio.sdk.resource.list.*; | |
public class App { | |
// Find your Account Sid and Token at twilio.com/user/account | |
public static final String ACCOUNT_SID = "AC5ef872f6da5a21de157d80997a64bd33"; |
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
var sa = require('superagent'); | |
sa.post('https://ip-messaging.twilio.com/v1/Services') | |
.auth(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN) | |
.type('form') | |
.send({ | |
FriendlyName: 'Super Awesome App' | |
}) | |
.end(function(err, res) { | |
console.log(res.body.sid); |
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
var util = require('util'); | |
var twilio = require('twilio'); | |
// Fetch a signing key from the Twilio REST API, which we'll use to mint our | |
// access tokens below in exports.generateToken | |
var SIGNING_KEY_SID, SIGNING_KEY_SECRET; | |
exports.initialize = function(callback) { | |
// Initialize Twilio REST API client with our account SID and auth token | |
var client = new twilio.RestClient( |
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
var fs = require('fs'); | |
fs.readdir('./challenges/',function(err,files){ | |
if(err) throw err; | |
for(i=0;i<files.length;i++) {( | |
function(index) { | |
fs.readFile('./challenges/' + files[index], "utf-8", function (err, data) { | |
if (err) throw err; | |
challenges.push({ 'id':j, 'markup': marked(data) }); |
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
<html> | |
<head> | |
<title>Fantasy Video API</title> | |
</head> | |
<body> | |
<video id="me"></video> | |
<video id="you"></video> | |
<button id="invite">Invite you@twilio.com</button> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> |