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
// Usage: <img ng-src="{{imageurl || '//:0'}}" ng-fallback="holder.js/210x140/text:No Image" /> | |
'use strict'; | |
(function(angular, Holder){ | |
var fallbackDirective = function () { | |
return { | |
link: function (scope, element, attrs) { | |
element.bind('error', function () { | |
if (attrs.src !== attrs.ngHolder && Holder != null) { | |
var src = null; |
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
param( | |
[Parameter(Mandatory = $true, Position = 0)] | |
[string]$ServiceName = $(throw "Service name is required."), | |
[Parameter(Mandatory = $true, Position = 1)] | |
[string]$BinPath = $(throw "The service's binary path is required."), | |
[Parameter(Mandatory = $true, Position = 1)] | |
[string]$ServiceDisplayName = $(throw "The service's display name is required."), |
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
param( | |
[Parameter(Mandatory = $true, Position = 0)] | |
[string]$ServiceName, | |
[Parameter(Mandatory = $false, Position = 1)] | |
[string]$DeploymentServer | |
) | |
function Get-RemoteService( | |
[string]$serviceName = $(throw "serviceName is required"), | |
[string]$targetServer = $(throw "targetServer is required")) |
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.Collections; | |
using System.Collections.Generic; | |
namespace Demo.Utility | |
{ | |
public static class IsNullOrEmptyExtension | |
{ | |
public static bool IsNullOrEmpty(this IEnumerable source) | |
{ | |
if (source != null) |
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
// usage: var app = angular.module('app', ['app.filters']); | |
// {{ expression | plaintext }} | |
'use strict'; | |
(function(angular) { | |
var plaintext = function() { | |
return function(text) { | |
return String(text).replace(/<[^>]+>/gm, ''); | |
}; | |
}; |
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
# Usage: Update-Version.ps1 -Version [-Path] [-Verbose] | |
# Example: .\Update-Version.ps1 -Version "1.2.3.4" -Path ..\Path\To\Sln -Verbose | |
param( | |
[Parameter(Mandatory = $false)] | |
[string]$Path, | |
[Parameter(Mandatory = $true)] | |
[string]$Version) | |
function Update-AssemblyInfo( | |
[string]$FilePath = $(throw "FilePath is required"), |
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; | |
public class Program | |
{ | |
public static int GetFirstMissingNumber(int[] positions) | |
{ | |
int maxPositions; | |
var posMax = 0; | |
var posCount = 0; |
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
<ItemGroup> | |
<AdditionalPublishFile Include="$(OutputPath)\**\*.jpg"> | |
<Visible>False</Visible> | |
</AdditionalPublishFile> | |
</ItemGroup> | |
<Target Name="BeforeBuild"> | |
<Touch Files="@(IntermediateAssembly)" /> | |
<CreateItem Include="@(AdditionalPublishFile)" AdditionalMetadata="TargetPath=%(FileName)%(Extension);IsDataFile=false"> | |
<Output TaskParameter="Include" ItemName="_DeploymentManifestFiles" /> | |
</CreateItem> |
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.Data.Entity; | |
using System.Linq; | |
using NSubstitute; | |
using NUnit.Framework; | |
using ProjectPersons.Business.Engines; | |
using ProjectPersons.Business.Helpers.Abstract; | |
using ProjectPersons.Business.Helpers.Concrete; | |
using ProjectPersons.Data.Abstract; |
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 MyDbContext : DbContext | |
{ | |
public DbSet<MyClass> MyClasses { get; set; } | |
protected override void OnModelCreating (DbModelBuilder modelBuilder) | |
{ | |
base.OnModelCreating (modelBuilder); | |
modelBuilder.Conventions.Remove<System.Data.Entity.ModelConfiguration.Conventions.PluralizingTableNameConvention> (); | |
// Add any configuration or mapping stuff here |
OlderNewer