How to define default values for pages and blocks in EPiServer CMS 7+

Source: How to define default values for pages and blocks in EPiServer CMS 7

Also see this: using [DefaultValue] attribute:
Default property values on content in EPiServer are set by overriding SetDefaultValues. In an attempt to make my model classes a bit tidier, by not having to do the override in lots of places, I wrote a little piece of code which enables the use of the DefaultValue attribute (found in System.Component)

from: http://world.episerver.com/blogs/Per-Magne-Skuseth/Dates/2014/3/Attribute-based-default-values/

SourceTree very slow when switching repository tabs

My SourceTree GIT manager was freezing for 5-10 seconds when switching between repositories.

These commands fixed the issue:

$ git config --global core.preloadindex true
$ git config --global core.fscache true
$ git config --global gc.auto 256

Also in combination with adding GIT program folder and SourceTree program folder to excluded paths for Windows Defender (antivirus scanner). The switch between tabs is now instant.

Source: SourceTree very slow with many repositories

Js string endsWith() polyfill and other string functions

When you are a C# developer and want javascript to be more like C#:

if (!String.prototype.endsWith) {
    String.prototype.endsWith = function(searchString, position) {
        var subjectString = this.toString();
        if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
            position = subjectString.length;
        }
        position -= searchString.length;
        var lastIndex = subjectString.lastIndexOf(searchString, position);
        return lastIndex !== -1 && lastIndex === position;
    };
}

From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith

Other good ones:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes

Using Self Calling Anonymous Functions and $(document).ready

This is a common pattern with jQuery extensions to ensure that they are always added to the jQuery object, but can be written using $ to keep the code tidy:

(function($){
   $(function(){
      // your code here
   });
})(jQuery);

The $ would actually reference the jQuery library inside while still referring to Prototype on the outside! This can help tidy up your code

Source: javascript – Using Self Calling Anonymous Functions and $(document).ready – Stack Overflow

One-time bindings in Angular 1.3

This is where one-time bindings come in. So what are one-time bindings? Let’s just read what the official docs say:One-time expressions will stop recalculating once they are stable, which happens after the first digest…And this is exactly what the Angular world needs to tackle the problems mentioned above. So what does it look like when we want to use one-time binding? Angular 1.3 comes with a new syntax for interpolation directives and expressions in order to tell Angular that this particular interpolated value should be bound one-time.Using this new syntax is as easy as starting an expression with ::. So if we apply the one-time expression to our example above, we change this:Hello {{name}}!To this:Hello {{::name}}!This works for all kind of typical Angular expressions you’re used to use throughout your app. Which means you can use them in ng-repeat expressions or even for directives that expose attributes that set up a two-way binding from the inside out. From the outside you’re able to just feed them with a one-time expression:

Source: One-time bindings in Angular 1.3

Show hide elements in AngularJs html template based on $scope variable has value

Show hide elements in AngularJs html template based on if $scope variable has value: (the ng-show=model.property is the trick)

    <li class="List-item" ng-repeat="row in searchResult">
        <div class="List-itemBody">
            <strong ng-show="row.doc.ContactPerson">{{row.doc.ContactPerson}}</strong>
            <strong ng-show="row.doc.ContactPerson == null">[Contact Person Missing]</strong>

 

EPPlus – C# .NET library for creating and reading Excel 2007/2010 files

Creating Reports in Excel 2007 using EPPlus (Header, Footer, Comments, Image, Formatting, Shape and Formula)

 Introduction
EPPlus is really a powerful tool to generate excel based reports on server side and it is becoming my favorite tool as I am getting more experienced with it. Previously I wrote a post about Creating advanced Excel 2007 Reports on Server. This post is update on the last post and I am sharing more advanced feature of EP Plus.

Source: Zeeshan Umar’s Blog

Chrome DevTools – Save updated js, html and css files to disk from Chrome

Set up persistent authoring in Chrome DevTools so you can both see your changes immediatedly and save those changes to disk.

Source: Set Up Persistence with DevTools Workspaces | Web Tools – Google Developers