• Using AWS's API Gateway to recieve Sendgrid event hooks and shove them in SQS posted on 03 Jan 2016

    Sendgrid hooks allow you to recieve notifications of events that occur to the emails that you send, such as, was the email clicked, was it bounced, was it unsubscribed, etc.

    A list of events can be found here

    When sendgrid send the events, they send an array of events, so it may not be ideal to process those as they come in, and rather just accept them and process them when you can. To do that you can use AWS's API Gateway to accept the request and push the JSON body to SQS.

    Steps:

    1. Setting up the Queue
    2. Setting up the Policy
    3. Setting up the Role
    4. Creating the API Gateway
    5. Test with Console
    6. Test with Postman

    Read more...

  • GZip with scriptcs in Octopus Deploy posted on 21 Oct 2015

    I had this crazy problem tonight. I wanted to upload all my assets for my website into AWS S3, but I needed to gzip them first before sending them.

    Usually I do this in Team City with Grunt, but all my variable replacement is done in Octopus Deploy depending on the environment.

    • Staging = S3 URLs
    • Production = CloudFront URLs

    If the compression is done in Team City, variable replacement cannot happen on the GZipped file.

    I decided to move it to Octopus Deploy, my first thought was, could I run a node.js task in Octopus Deploy, the more I thought about it tho, I realised I don't want to install a dependency on node.js on the server.

    Second thought was to use Powershell... but I'm a real powershell no0b.

    Read more...

  • Permament redirect to HTTPS with IIS posted on 16 Aug 2014

    Google has just recently updated their search results to give higher ranking to sites with an SSL Certificate, than to sites without, which is one of the best changes Google has made in recent years. There really is no excuse for not having a cert now. (note, this is limited to small portion of sites but lets assume that this will be rolled out if Google proves it to be worth while)

    googleonlinesecurity - https-as-ranking-signal_6.html

    Unfortuntely for me it seems Github Pages does not support Certificates on custom domain names, yet... :( hopefully they will support this eventually so that I can avoid moving my blog.

    So one thing that pops up in the Nancy channel on JabbR every-now-n-then, is how to make all modules require SSL.

    From within a module you can call:

    this.RequiresHttps()
    

    And this will push the site into https, but having to write this everywhere is rather annoying, and during development on your local machine this is a bit of a hassle. Despite Visual Studio supporting an HTTPS url...

    Read more...

  • Taking snap shots of a Video & displaying it posted on 09 Jun 2014

    Now we've loaded an image/video, we've captured the drop event, we've displayed it...

    But what about taking screen grabs of a video?

    To start with I'll go back to the code we used in Part 1, so we have an input, a load button, and a video control:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>      
        <div>
            <input type="file" id="video-input">
            <input type="button" value="Load Selected Video" id="load-video" />
        </div>
    
        <div>
            <video id="video-container" controls></video>
        </div>
    </body>
    </html>
    

    Racing ahead we load that up:

    Read more...

  • Managing your Azure Storage account with Zudio posted on 03 May 2014

    Messing around with Azure Queues, using the C# library to create a queue, add messages, read them, delete them... all is well and good...

    But at some point I wanted to view what I was putting into the queue...

    The Azure blog has a recent post listing a few Azure Storage explorers. I tried a couple of them, but they were so buggy!

    Infact, I'm sorry to say... Azure Storage Explorer was the worst. When I attempted to refresh a queue, nothing happened. I had to add a second queue, then swap between each queue in order to review the list. Most of the buttons don't seem to do anything at all.

    Then I remember Mark Rendle tweeted me about his Zudio site. Funnily enough he got a mention on the blog post. I decided to login and check it out again.

    Read more...

  • Creating a drop area to drop a file in HTML 5 posted on 01 May 2014

    In the first post we uploaded a file and viewed it in the browser without sending it to a server, now we are going to create a drop area so that you can drag a file from a folder, into the website.

    Using the same HTML as before, lets add a drop area:

    <div>
        <input type="file" id="image-input">
        <input type="button" value="Load Selected Image" id="load-image" />
    </div>
    
    <div id="drop-area">
        Drop File Here...
    </div>
    
    <div>
        <img id="image-container" width="360" />
    </div>
    

    And add a bit of CSS to make it a little more visible:

    Read more...

  • Loading an Image or Video from a File Input control. posted on 29 Apr 2014

    So you've got an input control, and you want to display the video/image before the user uploads, maybe so they can verify it first...

    The File API allows you to get more information from a <input type="file"... control than we could get before.

    So lets start with Video:

    Video

    Ok so we have a basic HTML page with an <input type="file"..., <video..., and <input type="button'...

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>      
        <div>
            <input type="file" id="video-input">
            <input type="button" value="Load Selected Video" id="load-video" />
        </div>
    
        <div>
            <video id="video-container" controls></video>
        </div>
    </body>
    </html>
    

    So if we load up a file, our UI should look something like this:

    Read more...

  • Levelling up your logging. (part 2) posted on 28 Apr 2014

    Part 2: Levelling up your Logging.

    Make sure you've read Part 1: If you're not logging, you're doing it all wrong before you continue.

    Production logging : This.Changes.Everything ™

    Localhost development is easy. Live/production logging is where This.Changes.Everything. ™
    Instead of sending all the logging information to your localhost Sentinal app we now send it to LogEntries.

    Why LogEntries (or any other Logging Service as a Service)?

    1. You can access this information any time.
    2. You local computer cannot be online 24/7
    3. When you need to triage a problem, the problem as already occured. Therefore, the problem is already historical. As such, you can't suddenly turn 'on' logging. You need to go back into time and look at what has already happened.

    Read more...

  • Fixing OSX as a Windows User... posted on 26 Apr 2014

    I'm slowly in the process of moving away from my huge desktop computer and moving to my good old 15" Mac Book Pro w/ Retina, as my main computer. Running windows in parallels. But moving to OSX is really hard, things that I take for granted in Windows are just hard in OSX, even after 2 years of having this laptop, and having used OSX for a few years when I lived in New Zealand....

    Sooo I'm making this blog post, mostly as a reference for the future, on what I've done to make life a little easier.

    Fixing Home / End keys

    Ahhh I know you can use cmd + and cmd + , but I just prefer the Windows key mapping.

    Read more...

  • If you're not logging, you're doing it all wrong. (part 1) posted on 23 Apr 2014

    Part 1: If you're not logging, you're doing it all wrong.

    Really? Seriously?

    Synopsis: Simple way to start logging your .NET application.

    Maintaining some production software is most overlooked until a problem arises ... which by then it could be more costly to support and fix if some simple, basic procedures were not considered from day zero. In my opionion, adding the ability to get acess to the internal runnings of your system is crutial to seeing what is going on under the hood and helping you get some facts to help problem solve a production issue.

    Logging is one of these mechanisms and should be considered and planned before you even start any coding.

    Read more...