This file contains hidden or 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 static class EnumerableExtensions | |
{ | |
public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> enumerable, Func<TSource, TSource, bool> comparer) | |
{ | |
return enumerable.Distinct(new LambdaComparer<TSource>(comparer)); | |
} | |
public static IEnumerable<TSource> Except<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second, Func<TSource, TSource, bool> comparer) | |
{ | |
return first.Except(second, new LambdaComparer<TSource>(comparer)); |
This file contains hidden or 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
$CurrentValue = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine") | |
[Environment]::SetEnvironmentVariable("PSModulePath", $CurrentValue + ";E:\Powershell", "Machine") |
This file contains hidden or 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
declare @TableName sysname = 'DBTableName' | |
declare @result varchar(max) = 'public class ' + @TableName + ' | |
{' | |
select @result = @result | |
+ CASE WHEN ColumnDesc IS NOT NULL THEN ' | |
/// <summary> | |
/// ' + ColumnDesc + ' | |
/// </summary>' ELSE '' END | |
+ ' | |
public ' + ColumnType + ' ' + ColumnName + ' { get; set; }' |
This file contains hidden or 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
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> | |
<title ng-bind="title"></title> | |
<base href="/"> | |
<style> |
This file contains hidden or 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.DirectoryServices.AccountManagement; | |
using System.Linq; | |
using System.Security.Claims; | |
using System.Threading.Tasks; | |
using Thinktecture.IdentityServer.Core; | |
using Thinktecture.IdentityServer.Core.Models; | |
using Thinktecture.IdentityServer.Core.Services; |
This file contains hidden or 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
{ | |
"directory": "lib", | |
"scripts": { | |
"postinstall": "gulp wiredep" | |
} | |
} |
This file contains hidden or 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
interface IStateInherit extends ng.ui.IStateService { | |
$current: IResolvedStateInherit; | |
} | |
interface IResolvedStateInherit extends ng.ui.IResolvedState { | |
data: IUrlDataContainer; | |
} | |
interface IUrlDataContainer { | |
title: string; |
This file contains hidden or 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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
This file contains hidden or 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 removeNullIn(prop, obj) { | |
console.info('We dont want nulls..', prop, obj); | |
var pr = obj[prop]; | |
if (pr === null || pr === undefined) { | |
delete obj[prop]; | |
} | |
else if (typeof pr === 'object') { | |
for (var i in pr) { | |
removeNullIn(i, pr) | |
} |
This file contains hidden or 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.Linq; | |
using System.Web.Http; | |
using System.Web.OData; | |
using System.Web.OData.Routing; | |
using Web.ODataApi.Views; | |
namespace Web.ODataApi.Controllers | |
{ | |
public class PrismSalesSummaryViewController : ODataController | |
{ |
OlderNewer