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 Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Net; | |
using System.Text; | |
using System.Threading.Tasks; |
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
"use strict"; | |
const { addObserver, notifyObservers } = Cc["@mozilla.org/observer-service;1"]. | |
getService(Ci.nsIObserverService); | |
const { getEnumerator } = Cc["@mozilla.org/appshell/window-mediator;1"]. | |
getService(Ci.nsIWindowMediator); | |
const isBrowser = window => { | |
try { | |
return window.document.documentElement.getAttribute("windowtype") === "navigator:browser"; |
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.IO; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
using ClassLibraries.SiteSettings.Classes; | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Text; |
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
var app = angular.module('app',[]); | |
app.run(function ($http, $q) { | |
getExample($q) | |
.then(function(value){ | |
console.log(value); | |
}); | |
}) | |
function getExample($q) { |
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
app.run(function ($http, $q) { | |
var promise = $q.when('i m resolved'); | |
promise.then(function(value){ | |
console.log(value + " 1"); | |
}); | |
var innerPromise = promise.then(function(value){ | |
console.log(value + " 2"); | |
}) | |
var innerPromise2 = promise.then(function(value){ | |
console.log(value + " 3"); |
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
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://mail.google.com"); | |
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | |
response.Close(); | |
//retrieve the ssl cert and assign it to an X509Certificate object | |
X509Certificate cert = request.ServicePoint.Certificate; | |
//convert the X509Certificate to an X509Certificate2 object by passing it into the constructor | |
X509Certificate2 cert2 = new X509Certificate2(cert); |
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
[System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] | |
public class MultipleNameBindAttribute : Attribute | |
{ | |
public MultipleNameBindAttribute(string parameters) | |
{ | |
if (!String.IsNullOrEmpty(parameters)) | |
{ | |
AvailableName = parameters.Split(','); | |
} | |
} |
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
public class Utility | |
{ | |
public static Mock<DbSet<TEntity>> GenerateMockEntity<TEntity>(List<TEntity> entityList) where TEntity : class | |
{ | |
var list = new List<TEntity>(); | |
list.AddRange(entityList); | |
var query = list.AsQueryable(); | |
var entityMockSet = new Mock<DbSet<TEntity>>() { CallBase = true}; | |
entityMockSet.As<IQueryable<TEntity>>().Setup(m => m.Provider).Returns(query.Provider); | |
entityMockSet.As<IQueryable<TEntity>>().Setup(m => m.Expression).Returns(query.Expression); |
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
abs(checksum(NewId()) % 1000); |
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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Series | |
{ | |
public class SubMenuBuilder | |
{ |