This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"browser": true | |
}, | |
"globals": { | |
"angular": false, // IE Cannot overwrite angular | |
"agGrid": false, | |
"$": false, | |
"_": false, | |
"require" : false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Visual Studio has a binding of BeforeBuild: main | |
// This means that when you build the app the main task will run. | |
// | |
// References | |
// 1. [https://gist.github.com/spboyer/96339ce687b0c79b8258](https://gist.github.com/spboyer/96339ce687b0c79b8258) | |
// 1. [http://stackoverflow.com/questions/32824381/parse-main-bower-files-js-css-scss-images-to-distribution-via-gulp](http://stackoverflow.com/questions/32824381/parse-main-bower-files-js-css-scss-images-to-distribution-via-gulp) | |
'use strict'; | |
// The following dependencies are installed by | |
// ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2017-04-26T10:10:35.981Z","extensionVersion":"v2.6.2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_gravatar(email, size) { | |
// MD5 (Message-Digest Algorithm) by WebToolkit | |
// | |
var MD5 = function(s) { function L(k, d) { return (k << d) | (k >>> (32 - d)); } function K(G, k) { var I, d, F, H, x; F = (G & 2147483648); H = (k & 2147483648); I = (G & 1073741824); d = (k & 1073741824); x = (G & 1073741823) + (k & 1073741823); if (I & d) { return (x ^ 2147483648 ^ F ^ H); } if (I | d) { if (x & 1073741824) { return (x ^ 3221225472 ^ F ^ H); } else { return (x ^ 1073741824 ^ F ^ H); } } else { return (x ^ F ^ H); } } function r(d, F, k) { return (d & F) | ((~d) & k); } function q(d, F, k) { return (d & k) | (F & (~k)); } function p(d, F, k) { return (d ^ F ^ k); } function n(d, F, k) { return (F ^ (d | (~k))); } function u(G, F, aa, Z, k, H, I) { G = K(G, K(K(r(F, aa, Z), k), I)); return K(L(G, H), F); } function f(G, F, aa, Z, k, H, I) { G = K(G, K(K(q(F, aa, Z), k), I)); return K(L(G, H), F); } function D(G, F, aa, Z, k, H, I) { G = K(G, K(K(p(F, aa, Z), k), I)); return K |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data; | |
using Dapper; | |
using Dapper.Contrib.Extensions; | |
using NUnit.Framework; | |
using ServiceStack.Text; | |
//using Dommel; | |
namespace DataAccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ref: [mythz](https://groups.google.com/forum/#!topic/servicestack/bb95kGpDcEo) | |
using System; | |
using System.Configuration; | |
using System.Data; | |
using System.Data.Common; | |
namespace Clear2Pay.OTS.UTP.Data.Tests | |
{ | |
public class Database : IDisposable | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Format as per flot requirements | |
var flotData = new[] | |
{ | |
new {label = "Quantity Required", data = partAvailability.Select(x => new[] {x.TimeStamp, x.QuantityRequired})}, | |
new {label = "Quantity Available", data = partAvailability.Select(x => new[] {x.TimeStamp, x.QuantityAvailable})} | |
}; | |
// Timestamp created as follows | |
private static long GetJavascriptTimestamp(DateTime date) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ref: http://stackoverflow.com/questions/3738748/create-an-array-or-list-of-all-dates-between-two-dates | |
void Main() | |
{ | |
var requirements = GetRequirements(); | |
// TODO: Add a margin at the start and end | |
// Get a range of dates | |
var start = requirements.Select (x =>x.DtFm).Min(); | |
var end =requirements.Select (x =>x.DtTo).Max(); | |
var dateRange = Enumerable.Range(0, 1 + end.Subtract(start).Days) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: Build a url with query params | |
angular.module('app').factory('UrlBuilder', function () { | |
function sortedKeys(obj) { | |
var keys = []; | |
for (var key in obj) { | |
if (obj.hasOwnProperty(key)) { | |
keys.push(key); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ref: http://odetocode.com/Articles/739.aspx | |
// Using LINQ to simplify business rules | |
Employee employee = | |
new Employee { ID = 1, Name = | |
"Poonam", DepartmentID = 1 }; | |
Func<Employee, bool>[] validEmployeeRules = | |
{ | |
e => e.DepartmentID > 0, |