Skip to content

Instantly share code, notes, and snippets.

Ewan Dennis ewandennis

Block or report user

Report or block ewandennis

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
@ewandennis
ewandennis / UnityStencilledObject.shader
Created Jan 2, 2018
A simple surface shader for Unity which honours a specific stencil buffer value
View UnityStencilledObject.shader
Shader "Custom/Stencilled" {
Properties {
_StencilMask("Stencil mask", Int) = 0
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader {
Tags { "RenderType"="Opaque" }
@ewandennis
ewandennis / UnityStencilMask.shader
Created Jan 2, 2018
A simple stencil buffer masking shader for Unity
View UnityStencilMask.shader
Shader "Custom/StencilMask" {
Properties {
_StencilMask("Stencil mask", Int) = 0
}
SubShader {
Tags {
"RenderType" = "Opaque"
"Queue" = "Geometry-100"
}
@ewandennis
ewandennis / extractRelayAttachments.js
Last active Jan 11, 2017
SparkPost relay webhooks sample
View extractRelayAttachments.js
'use strict';
/* Receive and extract email attachments using SparkPost relay webhooks.
*
* Prerequisites:
* - An inbound domain: https://developers.sparkpost.com/api/inbound-domains.html
* - A relay webhook: https://developers.sparkpost.com/api/relay-webhooks.html
*/
/*
@ewandennis
ewandennis / extractRelayAttachments.py
Created Nov 17, 2016
SparkPost relay webhooks sample
View extractRelayAttachments.py
"""Receive an extract email attachments using SparkPost relay webhooks.
Prerequisites:
- An inbound domain: https://developers.sparkpost.com/api/inbound-domains.html
- A relay webhook: https://developers.sparkpost.com/api/relay-webhooks.html
Dependencies:
- flask
"""
@ewandennis
ewandennis / extractRelayAttachments.php
Created Nov 17, 2016
SparkPost relay webhooks sample
View extractRelayAttachments.php
<?php
/* Dependencies:
* - php-mime-mail-parser (https://github.com/php-mime-mail-parser/php-mime-mail-parser)
* - The mailparse extension (http://php.net/manual/en/book.mailparse.php)
*/
require 'vendor/autoload.php';
$messages = json_decode(file_get_contents('php://input'));
foreach ($messages as $msg) {
@ewandennis
ewandennis / transmissions-speed.php
Created Nov 15, 2016
A cURL connection reuse speed test
View transmissions-speed.php
<?php
function setoptions($session) {
curl_setopt($session, CURLOPT_TCP_NODELAY, TRUE);
curl_setopt($session, CURLOPT_ENCODING, 'gzip');
// curl_setopt($session, CURLOPT_TCP_FASTOPEN, TRUE);
}
$trans = "{
\"options\": {
@ewandennis
ewandennis / sendSMSTransmission.js
Created Nov 9, 2016
Sending SMS with SparkPost Enterprise
View sendSMSTransmission.js
'use strict';
var SparkPost = require('sparkpost');
let client = new SparkPost('YOUR_API_KEY', {
endpoint: 'https://yourservice.sparkpostelite.com/'
});
client.transmissions.send({
campaign_id: "SMS notifications",
@ewandennis
ewandennis / setDynamicFromReplyTo.js
Last active Jun 13, 2016
Split fromEmail into local part and domain substitution variables
View setDynamicFromReplyTo.js
'use strict';
/*
* Update a SparkPost template to use substitution variables
* in content.from.name, content.from.email and content.reply_to
*
* Usage: node setDynamicFromReplyTo.js <API KEY> <template ID>
*
* Note: your API KEY must have template write privileges.
*
View SparkPost.md

Introduction

This integration consumes Segment events and uses them to create and maintain recipient lists within SparkPost. For example, when you send 'page' events into Segment.com, a recipient list is created for each page containing the users that visit that page.

The Recipient Lists

  • Everyone
  • Page X visited last 7 days
  • Group X members
  • Screen X visited last 7 days
View keybase.md

Keybase proof

I hereby claim:

  • I am ewandennis on github.
  • I am ewandennis (https://keybase.io/ewandennis) on keybase.
  • I have a public key whose fingerprint is C73D 48F9 0FBA 9E3F 45C9 28E0 05F5 3946 98F1 F247

To claim this, I am signing this object:

You can’t perform that action at this time.