Skip to content

Instantly share code, notes, and snippets.

View BadgerCode's full-sized avatar
🦡

Michael Hawkins BadgerCode

🦡
View GitHub Profile
@BadgerCode
BadgerCode / CreateAndSendVoice.vb
Created September 4, 2015 14:13
Creating and sending single voice messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim singleMessage = New VoiceMessage("447123456789", "Message Body", accountReference)
messagingService.SendMessage(singleMessage)
@BadgerCode
BadgerCode / CreateAndSendMultiVoice.vb
Created September 4, 2015 14:16
Creating and sending multiple voice messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim multipleMessages = New VoiceMessageCollection
'Important! Do not forget to set the acount refence on the messages collection
'This should be the same as the account reference for the individual messages
multipleMessages.AccountReference = accountReference
multipleMessages.Items.Add(New VoiceMessage("447123456789", "Message Body", accountReference))
multipleMessages.Items.Add(New VoiceMessage("447456789123", "Message Body", accountReference))
@BadgerCode
BadgerCode / CreateAndScheduleSMS.vb
Last active September 4, 2015 14:24
Creating and scheduling single SMS messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim singleMessage = New SmsMessage("447123456789", "Message Body", accountReference)
' Schedules a message to be sent on 31/10/2015 at 15:22
messagingService.SendScheduledMessage(singleMessage, New System.DateTime(2015, 10, 31, 15, 22, 0))
:: Initial set up:
:: 1. Install firefox in Z:\Programs\Firefox
:: 2. Open up firefox and copy your profile from "C:\Users\YOUR_USERNAME_HERE\AppData\Local\Mozilla\Firefox\Profiles"
:: 2.1 Put it in Z:\Programs\Firefox
:: 2.2 Rename it to profile
:: 3. Save this script somewhere in your Z drive (the root makes this the easiest to access)
:: 3.1 Make a script in your Z drive which calls this scipt. E.g.
:: Save this as Z:\SetupProfiles.bat
:: Make Z:\Startup.bat with the following lines:
:: Z:\SetupProfiles.bat
@BadgerCode
BadgerCode / send.py
Created October 28, 2017 12:19
Sends a SMS message using Esendex's REST API using Python
# Uses requests library
# http://docs.python-requests.org/en/latest/user/install/
import requests
import base64
username = "user@domain.com"
password = "password" # Sorry no API keys!
accountReference = "EX0123456" # https://www.esendex.com/echo (on the right hand side EX12345)
@BadgerCode
BadgerCode / send.js
Created October 28, 2017 12:38
Sends a SMS message using Esendex's REST API and Node.js
var request = require('request'); // npm install request
var username = "user@domain.com";
var password = "password"; // Sorry no API keys!
var accountReference = "EX0123456"; // https://www.esendex.com/echo (on the right hand side EX12345)
var recipient = "447123456789"; // Your number
var message = "Hello world!";
request(
@BadgerCode
BadgerCode / receive-messages.js
Last active October 29, 2017 00:05
Node.js HTTP Listener for Esendex's inbound message webhook
// npm install restify
// npm install body-parser
// npm install body-parser-xml
var restify = require('restify');
var bodyParser = require('body-parser');
require('body-parser-xml')(bodyParser);
var server = restify.createServer();
server.use(bodyParser.xml());
@BadgerCode
BadgerCode / aes.cs
Created February 20, 2018 20:17
C# AES encryption and decryption example
public static class AES
{
// Keys should be 32 bytes
public static string Encrypt(string text, byte[] key)
{
using (var memoryStream = new MemoryStream())
using (var aes = Aes.Create())
using (var encryptor = aes.CreateEncryptor(key, aes.IV))
{
memoryStream.Write(aes.IV, 0, aes.IV.Length);
@BadgerCode
BadgerCode / describe-extensions.ts
Last active July 2, 2018 09:45
Jasmine describe extensions for parameterised describes
export function testCase(...testParameters: any[]) {
// Syntactic sugar function
return testParameters;
}
export function testCases(...testCases: any[]){
// Syntactic sugar function
return testCases;
}
@BadgerCode
BadgerCode / image.svg
Last active June 28, 2018 15:11
Cool SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.