pr0g33k

 collapse all
  1. Learning Knockout.JS

    Learning Knockout.JS

    My video course, Learning Knockout.JS, was released on August 31, 2015. I hope that you will check it out. I had a lot of fun making the course and I think it turned out really well.

    Among the various JavaScript libraries available to developers, Knockout.JS really stands out due to the diverse features it provides and also because it promotes the use of the Model-View-ViewModel (MVVM) design pattern to build data-driven web applications. Construct power-packed apps without compromising on its flexibility and build rich user interfaces, which will update in real-time when the data model state changes, eliminating the need to refresh pages.

    Learning Knockout.JS will walk you through all of the key features of Knockout.JS and make it easy for you to quickly and easily build feature-and data-rich web applications that are easy to extend and maintain.

    We start off with a brief introduction to Knockout.JS, and its various benefits, and explore the different design patterns in context of Knockout.JS to make your JavaScript code cleaner and more manageable. After that, we will walk through and understand the relationship between Models, Views, and ViewModels, as well as creating them.

    Along with that, you will also learn how we can use the different data binding attributes to manipulate the output. We will also discuss and implement various important concepts such as two way data binding and dependency tracking to update your UI in real-time and to separate the components of your application into logical parts.

    We will analyze Knockout’s template feature to help you deal with data context in most scenarios. Then, we will take a look at how to track the changes in dependencies and subscribe to them using computed observables and subscriptions. Furthermore, you will also learn how to customize bindings and functions as well as using extenders to create our own set of Knockout tools. Finally, we will take a look at some advanced features of Knockout.JS to take your knowledge to the next level!

    Learning Knockout.JS is more than just an introduction; it’s a complete course on one of JavaScript’s innovative libraries.

  2. Microsoft Visual Studio 2015 Installer Projects

    Microsoft released an installer project extension for Visual Studio 2015 that brings back the installer projects that were available in Visual Studio 2010. If you don't want to use the InstallShield Limited Edition setup and deployment project, this is a good alternative.

    https://visualstudiogallery.msdn.microsoft.com/f1cc3f3e-c300-40a7-8797-c509fb8933b9

  3. Reinstalling All NuGet Packages in a Solution

    I just did a fresh install of Windows 10 and Visual Studio 2015. When I pulled down my projects from TFS Online and opened several VS solutions, however, many references were missing from the projects and nothing would build. It turns out that NuGet packages are referenced relative to the solution and not the individual projects. If you have a library that you want to share across multiple solutions and you add that library to a new solution, the NuGet packages for that shared project will have to be set up again for the new solution because the path to the "packages" folder will have changed due to the new, relative path of the new solution.

    To get things going again, I ran the following command from the Package Manager Console:

    Update-Package -Reinstall

    That uninstalled and then reinstalled every package in the solution.

    You can also target a specific project in the solution if you want:

    Update-Package -Project "My.Project.Name" -Reinstall

    I hope that helps!

  4. jQuery Collapsible Panel

    I recently had a need for a JavaScript-driven collapsible panel and noticed that jQuery doesn't have one. I investigated using a jQuery accordion but wasn't satisfied with what it took to get it a single accordion panel to work. So I created my own:

    (function ($) {
        $.fn.extend({
            collapsiblePanel: function () {
                var s = document.createElement('SPAN');
                $(this).each(function () {
                    var i = $(s), h = $(this).find('.ui-widget-header').first(), c = $(this).find('.ui-widget-content').first();
                    if (h && c) {
                        i.text("+").css({ 'display': 'inline-block', 'margin-right': '10px' }).addClass('ui-icon ui-expander ui-icon-triangle-1-e');
                        c.css({ 'padding': '10px' }).hide();
                        h.prepend(i).css({ 'padding': '5px' }).click(function () {
                            c.slideToggle(250, function () {
                                c.is(':visible') ? i.removeClass('ui-icon-triangle-1-e').addClass('ui-icon-triangle-1-s') : i.removeClass('ui-icon-triangle-1-s').addClass('ui-icon-triangle-1-e');
                            });
                        });
                    }
                });
            }
        });
    })(jQuery);

    The markup would look like this:

    <div class="ui-widget collapsible-panel">
        <div class="ui-widget-header">Lorum Ipsum</div>
        <div class="ui-widget-content">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dignissim pharetra ultricies. Nullam a nisl ligula. Integer at lacus a dui volutpat facilisis in at lacus. Mauris nec vestibulum ipsum. In hac habitasse platea dictumst. Vestibulum et justo at urna tempus porttitor et tincidunt dui. Pellentesque hendrerit consequat felis eu sodales. Donec tincidunt laoreet lacus dapibus ullamcorper. Duis ut rutrum orci, ultrices lobortis ipsum.</p>
        </div>
    </div>
    <script>
        $(document).ready(function () {
            $('.collapsible-panel').collapsiblePanel();
        });
    </script>

    Enjoy!

    Posted on 6/5/2015 at 06:06 PM , Edited on 6/5/2015 at 08:06 PM
    Tags: jQuery
  5. Web App Testing Using Knockout.JS

    Web App Testing Using Knockout.JS

    I was very pleased to serve as a reviewer on this book. It is very well-written and is packed with a ton of useful information and practical techniques. The Knockout.JS sections are very clear and approachable to beginners and advanced developers alike. The book especially shines when it comes to unit testing Web apps using Jasmine and the sections on Node.JS, Gulp.JS, Karma, and Phantom.JS are equally impressive.

    Using the libraries and techniques described in this book have definitely improved my daily development workflows. I highly recommend this book!