Tuesday, 11 October 2016

Angular 2

Proxy: https://jjasonclark.com/how-to-setup-node-behind-web-proxy

Disable SSL:
npm config set strict-ssl false

Set Registry
npm config set registry "http://registry.npmjs.org/"

Proxy
npm config set proxy http://localhost:53128
npm config set https-proxy http://localhost:53128
npm config set registry http://registry.npmjs.org
Angular with TypeScript
https://angular.io/docs/ts/latest/quickstart.html

WebPack:

  • https://github.com/AngularClass/angular2-webpack-starter
  • https://github.com/preboot/angular2-webpack



Angular 2

Proxy: https://jjasonclark.com/how-to-setup-node-behind-web-proxy

Disable SSL:
npm config set strict-ssl false

Set Registry
npm config set registry "http://registry.npmjs.org/"

Proxy
npm config set proxy http://localhost:53128
npm config set https-proxy http://localhost:53128
npm config set registry http://registry.npmjs.org

Angular 2

Proxy: https://jjasonclark.com/how-to-setup-node-behind-web-proxy

Disable SSL:
npm config set strict-ssl false

Proxy
npm config set proxy http://localhost:53128
npm config set https-proxy http://localhost:53128
npm config set registry http://registry.npmjs.org

Sunday, 21 August 2016

Custom Shadowbox Modal

The below code shows the Processing Image as a Modal.

You can close it by setting the processing property on the angular $scope.

 .customModal {

            position: fixed; /* Stay in place */

            z-index: 1; /* Sit on top */

            padding-top: 100px; /* Location of the box */

            left: 0;

            top: 0;

            width: 100%; /* Full width */

            height: 100%; /* Full height */

            text-align: center;

            background-color: rgb(0, 0, 0); /* Fallback color */

            background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */

        }



        /* Modal Content */

        .customModal-content {

            margin: auto;

            width: 220px;

            height: 183px;

        }
    
   

Tuesday, 9 August 2016

SMS Gateway Providers


·         TextLocal
o   They provide an API to use http://www.textlocal.com/sms-api-integrations
o   Commercial – PAYG (2.4p per text) or Monthly payments
·         ClickATell
o   Commercial (2.9p per message)
·         Twilio:
o   Commercial
·         Email to SMS Gateway (doesn’t seem to be reliable):

Dynmark:


·         There seems to be a way also with pure .NET but need to look into it if it has any drawbacks: http://www.codeproject.com/Articles/19023/Sending-SMS-using-NET

Sinch
Nexmo
Plivo



Thursday, 7 July 2016

DateTime Extensions

public static class DateTimeExtensions
    {
        /// 
        /// Includes the from and to dates so from Monday to Tuesday it returns 2
        /// 
        public static int FindBusinessDaysUntil(this DateTime from, DateTime to)
        {
            double calcBusinessDays =
                1 + ((to - from).TotalDays * 5 -
                (from.DayOfWeek - to.DayOfWeek) * 2) / 7;

            if ((int)to.DayOfWeek == 6) calcBusinessDays--;
            if ((int)from.DayOfWeek == 0) calcBusinessDays--;

            return Convert.ToInt16(calcBusinessDays);
        }

        public static DateTime NextBusinessDay(this DateTime from)
        {
            var nextDay = from.AddDays(1);

            while (true)
            {
                var numberOfBusinessDays = FindBusinessDaysUntil(from, nextDay);

                if (numberOfBusinessDays == 2)
                {
                    return nextDay;
                }

                nextDay = nextDay.AddDays(1);
            }
        }

        public static DateTime NextBusinessDay(this DateTime from, int days)
        {
            var result = from;

            for (int i = 0; i < days; i++)
            {
                result = result.NextBusinessDay();
            }

            return result;
        }        
    }
}