Skip to content

Instantly share code, notes, and snippets.


Kevin Whinnery kwhinnery

  • Twilio
  • Saint Paul / Minneapolis
View GitHub Profile
// Install the Java helper library from
public class Example {
View example.js
var t = new twilio.TwimlResponse();
t.dial((dial) => {
View example.js
var accountSid = '{{ YOUR_ACCOUNT_SID }}';
var authToken = '{{ YOUR_AUTH_TOKEN }}';
var LookupsClient = require('twilio').LookupsClient;
var client = new LookupsClient(accountSid, authToken);
var phoneNumber = process.argv[2];
type: 'carrier'
}, (error, number) => {
var message = number ? number.national_format + ' is valid' : error;
# Download the 'Preview Release' version of the Python helper library from
from import Client
# Your Account Sid and Auth Token from
account = 'AC421124bfab3052ad108f3e8c7a119cfb'
token = 'AUTH_TOKEN'
client = Client(account, token)
# Delete the service
View actual.js
// Load user year data
$.ajax('/ga/users').then(function(data) {
// Populate raw numbers
var usersYearFormatted = humanize.numberFormat(data.usersThisYear, 0);
var usersQuarterFormatted = humanize.numberFormat(data.usersThisQuarter,
// Populate progress bar
$quarterGoal = $('.progress.current-goal .progress-bar');
View index.js
var http = require('http');
var express = require('express');
var bodyParser = require('body-parser');
var KeenClient = require('keen-js');
// 1.) create an authenticated Keen analytics client
var keen = new KeenClient({
projectId: 'your project ID here',
writeKey: 'your write key here'
View conversations.js
var client = new Twilio.Conversations.Client('token');
var convo = client.conversation('myCall');
convo.display('#them', '#me').then(function() {
console.log('now your local media is showing, as is theirs!');
}).catch(function(err) {
console.log('oops, something bad happened')
convo.on('participantJoined', function(participant) {
View sample.js
var client = new Twilio.IPMessaging.Client('token');
// Creates a reference to a channel that may or may not exist
var channel ='general');
// If there's such a thing as an online/offline channel, this serves as the way the channel
// gets updated when it's reconnected from an offline state. It could also serve as a way
// to get updated when the channel information is initially fetched from the server
// Fired when:
kwhinnery / sample_one.js
Last active Feb 19, 2016
Twilio IP Messaging is intended to help developers build chat applications, and is in public beta. Given the following options, which interface would you prefer to initialize the Twilio IP Messaging SDK and execute a few basic tasks? Vote here:
View sample_one.js
var client = new Twilio.IPMessaging.Client('token');
var channel = client.getOrCreateChannelByUniqueName('general');
channel.listMessages().then(function(messages) {
}).catch(function(err) {
View sync.js
var map ='uniqueName');
map.set('foo', { bar: 42 }).then(function() {
console.log('set it!');
}).catch(function(err) {
console.log('dang it, dont have access');
// same as above...
map.set('foo', { bar: 42 }, function(err) {