• 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...

  • Fixing Github with Chrome Plugin - GitHub.Expandinizr posted on 07 Feb 2014

    So if you've ever visited Github, and thought 'Oh, I'll browser a repository and find a file', no doubt you've probably ended up in a suituation like so:

    OH Joy, this is so readable... I honestly have no idea who at Github approved this...

    Read more...

  • If you're going to use repositories, don't have generic or base repositories... posted on 31 Jan 2014

    Repositories are one of those patterns we hate to love or love to hate, but seems to be getting more hate lately than love.

    Personally I don't have any real problem with repositories themselves, I just have a problem with the way it is used.

    If you run the following search in Google:

    BaseRepository OR GenericRepository OR IRepository site:stackoverflow.com

    You will get about 10k results on Stack Overflow for questions that contain something related to a generic repository or base repository. You end up with code snippets such as:

    public interface IRepository<TEntity> : IDisposable where TEntity : class
    {
        IUnitOfWork Session { get; }
        IList<TEntity> GetAll();
        IList<TEntity> GetAll(Expression<Func<TEntity, bool>> predicate);
        bool Add(TEntity entity);
        bool Delete(TEntity entity);
        bool Update(TEntity entity);
        bool IsValid(TEntity entity);
    }
    

    Read more...