Skip to content

Instantly share code, notes, and snippets.

Elmer Thomas thinkingserious

Block or report user

Report or block thinkingserious

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
thinkingserious / girl-scout-2019-twilio-function.js
Last active Mar 15, 2019
A Twilio Function using Twilio SendGrid to forward information from an SMS to an Email
View girl-scout-2019-twilio-function.js
exports.handler = function(context, event, callback) {
const sgMail = require('@sendgrid/mail');
msgBody = 'We just received a donation from ' + String(event.donation_from);
const msg = {
to: '',
from: '',
subject: 'Audrey just received a donation!',
text: msgBody,
html: '<strong>' + msgBody + '</strong>',
thinkingserious /
Created Mar 15, 2019
Send a SMS via Twilio and Pythonista on iOS
import requests
from requests.auth import HTTPBasicAuth
to_number = 'outgoing_number'
from_number = 'your_twilio_number'
message = 'Thank for your order, we will deliver after our cookie booth sale at around 6pm.'
account_sid = 'your_account_sid'
auth_token = 'your_auth_token'
auth = HTTPBasicAuth(account_sid, auth_token)
url = '{}/Messages'.format(account_sid)
values = {
thinkingserious / girl-scout-2019-twiml-bin
Created Mar 15, 2019
TwiML bin for generic SMS response
View girl-scout-2019-twiml-bin
<?xml version="1.0" encoding="UTF-8"?>
<Message><Body>You may place your local, Moreno Valley/Riverside, CA and surrounding areas, order and we will deliver for free (payment due upon delivery): Not local to the Inland Empire, California? No problem! Please place your order here to have your cookies shipped or you may donate boxes to deployed miliatry overseas here:
thinkingserious /
Created Oct 18, 2016
Example of Using's Prism Mock Server in a Unit Test
public void test_alerts_get() throws IOException {
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
sg.addRequestHeader("X-Mock", "200");
Request request = new Request();
request.method = Method.GET;
request.endpoint = "alerts";
Response response = sg.api(request);
thinkingserious /
Created Oct 18, 2016
Example of a Mock HTTP Server
package com.sendgrid;
import java.util.HashMap;
public class MockSendGrid extends SendGrid {
Request request;
public MockSendGrid(String apiKey) {
thinkingserious / sample_sendgrid_oai.json
Created Oct 18, 2016
Snippit of the SendGrid OAI (Swagger) Definition - /user/webhooks/parse/settings [GET]
View sample_sendgrid_oai.json
"/user/webhooks/parse/settings": {
"get": {
"consumes": [
"description": "**This endpoint allows you to retrieve all of your current inbound parse settings.**\n\nThe inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the contnet, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](",
"operationId": "GET_user-webhooks-parse-settings",
"produces": [
thinkingserious / fluent.rb
Created May 24, 2016
Fluent Interface in Ruby Using Method Chaining and Reflection
View fluent.rb
class Fluent
def initialize(cache: nil)
@cache = cache ? cache : []
# Reflection
def method_missing(name, *args, &block)
print "Hello World"
thinkingserious / Fluent.cs
Last active May 10, 2016
Fluent Interface in C# Using Method Chaining and Reflection
View Fluent.cs
using System;
using System.Dynamic;
namespace Fluent
class Client : DynamicObject
public string UrlPath;
public Client(string urlPath = null)
thinkingserious / fluent.php
Created May 9, 2016
Fluent Interface in PHP Using Method Chaining and Reflection
View fluent.php
class Fluent {
function __construct($cache) {
$this->cache = ($cache ? $cache : []);
// Build the cache, and handle special cases
public function _($name) {
array_push($this->cache, $name);
You can’t perform that action at this time.