Skip to content

Instantly share code, notes, and snippets.

Kevin Whinnery kwhinnery

  • Twilio
  • Saint Paul / Minneapolis
Block or report user

Report or block kwhinnery

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View queries.js
const pool = require('./config');
require('dotenv').config()
const getUsers = (request, response) => {
pool.connect().then(client => {
client.query('SELECT * FROM users ORDER BY id ASC', (error, results) => {
if (error) {
throw error
}
response.status(200).json(results.rows)
View index.js
const express = require('express')
const app = express()
app.post('/sms', (request, response) => {
let twiml = `
<Response>
<Message>hey there, thanks for checking out my demo!</Message>
</Response>
`;
View airtable_update.js
/* global module, exports, require, process, console */
'use strict'
const Airtable = require('airtable')
// Configure Airtable database
const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY}
).base(process.env.AIRTABLE_DATABASE)
View app.rb
require 'sinatra'
require 'twilio-ruby'
sid = ''
tkn = ''
app_sid = ''
capability = Twilio::Util::Capability.new sid, tkn
capability.allow_client_outgoing(app_sid)
View example.jade
html
head
title Socket.io Example
body
h1(class="something") Socket.io Example
input#msg(type="text")
button send message
#messages
@kwhinnery
kwhinnery / readme.md
Last active Sep 16, 2016
Proposal for SDK packaging
View readme.md

Proposal for JavaScript SDK packaging

Right now, the Twilio client-side SDKs feel like they are designed and shipped by dozens of people. By making some changes to the Twilio SDK CDN and our module sructure, we could address some of these issues.

Include the latest everything from CDN

For onboarding and getting started, we could include a "kitchen sink" artefact that bundles up the latest version of every Twilio client-side SDK.

<script src="//media.twiliocdn.com/js/twilio.min.js"></script>
View Example.java
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;
import com.twilio.rest.Twilio;
import com.twilio.rest.resource.api.v2010.account.call.FeedbackSummary;
public class Example {
// Find your Account Sid and Token at twilio.com/user/account
public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
public static final String AUTH_TOKEN = "your_auth_token";
View Example.java
// Install the Java helper library from twilio.com/docs/java/install
import java.net.URI;
import java.net.URISyntaxException;
import com.twilio.rest.Twilio;
import com.twilio.rest.creator.api.v2010.account.CallCreator;
import com.twilio.rest.resource.api.v2010.account.Call;
import com.twilio.rest.type.PhoneNumber;
public class Example {
View example.js
var t = new twilio.TwimlResponse();
t.dial((dial) => {
dial.number('+16518675309');
});
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];
client.phoneNumbers(phoneNumber).get({
type: 'carrier'
}, (error, number) => {
var message = number ? number.national_format + ' is valid' : error;
You can’t perform that action at this time.