Skip to content

Instantly share code, notes, and snippets.

View Codesleuth's full-sized avatar

David Wood Codesleuth

View GitHub Profile
@Codesleuth
Codesleuth / insert-output-select.sql
Last active September 22, 2015 08:40
Example of an INSERT, OUTPUT and SELECT transaction
DECLARE @a uniqueidentifier
DECLARE @b uniqueidentifier
SET @a = newid()
SET @b = newid()
DECLARE @t TABLE
(
a uniqueidentifier,
b uniqueidentifier
See: https://github.com/esendex/esendex-node-sdk
@Codesleuth
Codesleuth / GetInboxMessages.cs
Last active December 22, 2015 15:39 — forked from EsendexDev/GetInboxMessages.cs
Getting Inbox messages using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
using com.esendex.sdk.inbox;
...
const int pageNumber = 1;
const int pageSize = 20;
var inboxService = new InboxService(USERNAME, PASSWORD);
try
{
@Codesleuth
Codesleuth / CreateAndSendSMS.cs
Last active December 22, 2015 15:39 — forked from EsendexDev/CreateAndSendSMS.cs
Creating and Sending SMS messages using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
using com.esendex.sdk;
using com.esendex.sdk.messaging;
...
var credentials = new EsendexCredentials(USERNAME, PASSWORD);
var messagingService = new MessagingService(true, credentials);
try
{
var message = new SmsMessage("447123456789", "This is a test message...", "<myAccountReference>");
@Codesleuth
Codesleuth / GetSentMessages.cs
Last active December 22, 2015 15:39 — forked from EsendexDev/GetSentMessages.cs
Getting sent messages using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
using com.esendex.sdk.sent;
...
const int pageNumber = 1;
const int pageSize = 20;
var sentService = new SentService(USERNAME, PASSWORD);
try
{
@Codesleuth
Codesleuth / GetSentMessageBodies.cs
Last active December 22, 2015 15:39
Getting sent message body texts using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
using com.esendex.sdk.messaging;
using com.esendex.sdk.sent;
...
const int pageNumber = 1;
const int pageSize = 20;
var credentials = new EsendexCredentials(USERNAME, PASSWORD);
var sentService = new SentService(credentials);
@Codesleuth
Codesleuth / Retryable SQL Script.md
Last active January 26, 2016 13:09
Retryable SQL

Retryable SQL Script

Allows retrying a SQL script until a lock can be achieved necessary to do the work.

@Codesleuth
Codesleuth / incrementing_list.sql
Created January 28, 2016 10:47
SQL Server Create Incrementing List
DECLARE @s VARCHAR(8000)
SELECT @s = COALESCE(@s + ',', '') + '@Thing' + CONVERT(nvarchar,[number])
FROM [master].[dbo].[spt_values]
WHERE [name] is null and [number] between 0 and 197
SELECT @s
@Codesleuth
Codesleuth / httpreceiver.js
Created February 2, 2016 08:40
A simple HTTP server which prints request information and returns 200
var http = require('http');
var server = http.createServer(function (req, res) {
var datas = [];
req.on('data', function (data) {
datas.push(data);
});
req.on('end', function () {
console.log('>-------------------->');
console.log(new Date);
console.log(req.method + " " + req.url);
@Codesleuth
Codesleuth / README.md
Last active February 3, 2016 08:42
Require dev branch in PHP with composer

Require dev branch in PHP with composer

  1. Initialise your composer

    $ php composer.phar init
  2. Require the package as normal - for this, we're demonstrating with esendex/sdk