• Git support in Visual Studio 2013... is actually quite cool! posted on 12 Dec 2013

    Lately I've found myself using the new Git support in Visual Studio 2013 more and more, it turns out once you get used to it, its quite handy! Initially my thoughts were its rubbish, mostly because I found it cumbersome, or maybe just that things weren't working the way I thought they were. I do fine some things strange, but it's still completely usable!

    How does it all work?

    Let's start by creating a new project:

    I ticked the Create new Git repository option in the bottom right hand corner, this just initializes the folder for you.

    Now that the project is created, we can open the Team Explorer, it should look something like this:

    I'm not entirely sure why it does this but when I create new projects, the solution file is never included by default?!?

    So the solution file is excluded, we can right click the file(s) and include them...

    Read more...

  • Snow gets Drafts! posted on 07 Nov 2013

    A special thanks goes out to @johanilsson for this new feature!

    Snow now ships with Drafts and Privates, this is a really cool feature since it allows you to create drafts, and a page to list all drafts (optional).

    What are the options

    There are three options for a published state:

    • draft
    • private
    • true

    Draft is basically a finished or rough cut blog post that you will publish soon, it will be compiled to /drafts URL and be publicly accessible (either via a known page or the direct URL)

    Private is a post that will not be compiled at all, this will stay as markdown, good for when you want to begin writing something but not have it show up online yet.

    Read more...

  • Making Nancy Modules easier to manage posted on 03 Nov 2013

    One problem I think a lot of developers have, is creating Controllers and Modules that are small and maintainable. Sometimes when you add some querying, bit of validation, pass it off to a repository or service, etc. It begins to become a little bit too big.

    Lets assume our we have an AccountModule it Gets a Login route to load the UI, and Posts to a Login route to authenticate the user, and do something.

    It also Gets a Register route to load the UI, and Posts to a Register route to register the new user.

    Without an actual implementation, something like this:

    public class AccountModule : NancyModule
    {
        public AccountModule() : base("/account")
        {
            Get["/login"] = _ => "login";
            Post["/login"] = _ => "login";
    
            Get["/register"] = _ => "register";
            Post["/register"] = _ => "register";
        }
    }
    

    To begin with, we only have 4 things to implement, its rather small, somewhat easy to manage, but what happens when we want to update an account?

    Read more...

  • Running JavaScript Unit Tests in Visual Studio with Jasmine & ReSharper posted on 24 Oct 2013

    • Running Basic Unit Tests in Visual Studio without a browser
    • Running Basic Unit Tests with a browser and separate projects

    There's so much information on the internet in terms of JavaScript Unit Testing and how to run tests etc, but when it comes to running tests in Visual Studio, without a browser, there's very little information. I had to piece information together to figure it out.

    So I'm going to do a small series on this.

    Things you will need!

    1. Jasmine
    2. PhantomJS

    Setup PhantomJS

    To run JavaScript tests without a browser, we need PhantomJS, and we need to wire it up into Resharper.

    Read more...

  • Semantic-UI & AngularJS - Basic Registration Form with Validation posted on 05 Oct 2013

    Last week I saw a tweet about Semantic-UI, which I had not heard about, I guess it's relatively new. I decided to take a look and to be honest. I love what I see.

    So to get rolling I decided to create a basic registration form for a personal project using it.

    What is Semantic UI

    Well, for starters, its a rather large library :| coming in total at a whopping 333kb for just the minified CSS an JavaScript.

    That's not including the Fonts (roughly 50kb, unless you like SVG which is 194kb, but who the hell uses that crap), Images which are about 3-10kb, though you probably only use 1 or 2 per app depending on what you're doing. These are all loading gifs, all other images are... well done using Font-Awesome. Which happens to be rolled into the library.

    But for what the library does, its pretty damn impressive.

    The idea is that Semantic is a more fluent and structured way to writing a web application, rather than naming stuff poorly like Bootstrap does with things like col-lg-4, Semantic opts for column. This is both good and bad. The examples on their homepage are more semantic, but at the cost of either writing less or more code in order to describe the UI elements in the markup.

    Reading the examples is awesome, in fact I wanted to right align a button, I started out with:

    ui blue submit button

    I thought "I want that floated right, it would look better...", and I ended up with

    ui blue submit button floated right

    You end up writing lots but instead of shifting around in CSS to figure out how to move it from left to right, I just described it. Sure enough, button sat on the right hand side!

    Read more...

  • Introducing Sandra.Snow posted on 01 Oct 2013

    I've only been blogging since 2009, and my blog had gone through multiple iterations. I began on BlogEngine.NET, moved onto Wordpress, then was introduced to Jekyll.

    I loved Jekyll, but I personally found it fiddly, and people who I've spoken to have also found it fiddly, but are quiet happy after they had set it up.

    I really liked the idea, so I thought I would recreate it in .NET :) Because reinventing the wheel is fun!

    Introducing Sandra.Snow

    With the help of @jchannon, I've managed release Snow. Using NancyFX we have created a small application that allows you to write Markdown Posts with Razor Layouts, which will be compiled static HTML files.

    Currently, besides my own, I'm aware of 3 other blogs running on Snow:

    So what is it? Basically:

    Sandra.Snow is a Jekyll inspired static site generation tool that can be run locally, as a CAAS(Compiler as a Service) or setup with Azure to build your site when your repository changes. It is built on top of NancyFX.

    Read more...

  • Instant Nancy Web Development - Book Review posted on 26 Sep 2013

    Just today, Christian Horsdal released his first book, his first topic to write a book about, only the most awesome Web Framework to exist in .NET! :)

    non affiliate links

    This book is rather short, clocking in at only 74 pages. Not to worry though, it covers quite a bit!

    Usually I don't go near Packt Publishing books after having a bad experience buying a few books, all of which were terrible. But seeing as this was a Nancy book I couldn't pass up the chance to check it out.

    Considering this is the first book Christian has written, it reads very well. I've read books from authors who have done 3 or 4 books and I struggle to read them because their style of writing. So that alone impressed me about this book.

    Read more...

  • Love the new ReSharper 8, best update to date! posted on 03 Aug 2013

    It was only little over a week ago that ReSharper 8 came out. It's not something that I really follow, but because of that I keep finding all these new features in R# 8 that are absolutely AWESOME!

    The R# team, if you see this. Congrats on such an awesome effort really pushing the boundaries of what R# can do with V8.

    ToString on Dates!

    This is simply amazing, often I would throw up Google and search "stevex string format" and pull up a pretty detailed blog post on string formatting.

    This single feature along, in my opinion, is worth the $ to upgrade to R# 8!!!!

    Read more...

  • Setting up a ServiceStack Service posted on 15 Jul 2013

    Time to setup a ServiceStack service!

    Prelude!

    ServiceStack is great, specially when you need to support .NET 3.5 and don't have the pleasure of being able to use .NET 4.0/4.5, you're not limited to .NET 3.5, ServiceStack works great with .NET 4.0/4.5 as well!

    God forbid we get subjected to having to use WCF...

    Setting this up should be super easy, we will use all the same settings as NancyFX, the only difference is we will be running ServiceStack instead.

    The ServiceStack team take real care to ensure that it works on Mono, enough so that their website; http://www.servicestack.net, runs on Linux!

    Read more...

  • Setting up a NancyFX website posted on 04 Jul 2013

    Time to setup NancyFX on Mono.

    Prelude!

    This series is done using Mono 2.10 and .NET 4.0. This wont work with a 4.5 project since we need Mono 3.0 for that, but I plan to do another series on building Mono from source since there's no package available yet.

    Also, this post assumes you've setup FTP to upload the files, I'm not going to go into detail, but you can install vsftpd and Google the setup. If you're new to Linux and followed Parts 1-3 so far, it should be easy enough to setup and install. All you need to do is authenticate using sshftp or sftp, rather than normal ftp.

    Creating a Nancy test project

    The easiest way to create a test project is to grab the Nancy Templates from the Visual Studio Gallery.

    Using this method, we can create a new project in Visual Studio and select Nancy Application.

    Read more...