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
MERGE INTO [TABLE_NAME] | |
USING (VALUES | |
(1, 'some text', 'some value'), | |
(2, 'some text', 'some value') | |
) | |
AS Source ([ID], [Text], [Value]) | |
ON [TABLE].[ID] = Source.[ID] | |
-- update matched rows | |
WHEN MATCHED THEN |
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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
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
namespace WCFBehaviorExtension | |
{ | |
using System.ServiceModel; | |
using System.ServiceModel.Description; | |
using System.ServiceModel.Dispatcher; | |
using BBR.WebService.Shared.Infrastructure.BehaviorExtensions.Validation; | |
public sealed class CustomValidationOperationInvoker : CustomValidationOperationInvokerBase | |
{ |
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
namespace WCFBehaviorExtension | |
{ | |
using System; | |
using System.Collections.ObjectModel; | |
using System.Diagnostics; | |
using System.ServiceModel; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Description; | |
using System.ServiceModel.Dispatcher; |
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
<Themes> | |
<Theme Name="SonOfObsidian R#(krho)" GUID="{31615139-e60b-4d1d-ab8b-1ae07148d94a}"> | |
<Category Name="Autos" GUID="{a7ee6bee-d0aa-4b2f-ad9d-748276a725f6}"> | |
<Color Name="ChangedText"> | |
<Background Type="CT_INVALID" Source="00000000" /> | |
<Foreground Type="CT_RAW" Source="FFF7A1A1" /> | |
</Color> | |
<Color Name="Plain Text"> | |
<Background Type="CT_INVALID" Source="00000000" /> | |
<Foreground Type="CT_INVALID" Source="00000000" /> |
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
@import "../Scripts/lib/bootstrap/less/mixins/grid-framework.less"; | |
/*col-sm-w-* is for setting with only without other properties. It uses bootstrap internal mixin*/ | |
.loop-grid-columns(@grid-columns, xs-w, width); | |
@media (min-width: @screen-sm-min) { | |
.loop-grid-columns(@grid-columns, sm-w, width); | |
} | |
@media (min-width: @screen-md-min) { |
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 async Task<TResult> OperationAsync<TResult>(Func<TResult> operation) | |
{ | |
return await Task.Run(operation).ConfigureAwait(false); | |
} | |
public async Task<object> UsageExample() | |
{ | |
return await this.OperationAsync(() => new object()); | |
} |
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
private static List<T> ConvertEnumerableToListSafe<T>(IEnumerable<T> enumerable) | |
{ | |
if (enumerable == null) | |
{ | |
return Enumerable.Empty<T>().ToList(); | |
} | |
List<T> resultList = enumerable.ToList(); | |
////if (resultList.Any() == false) | |
////{ |
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
//Eager loading. When the entity is read, related data is retrieved along with it. | |
//This typically results in a single join query that retrieves all of the data that's needed. | |
//You specify eager loading by using the Include method. | |
//Query: All department rows and all related rows in one query | |
var departments = db.Departments.Include(d => d.Courses); | |
foreach (var department in departments) | |
{ | |
foreach (var course in department.Courses) |
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
//#JS #bookmarkelt | |
(function($) { | |
$('iframe[src^="http://youtube"],iframe[src^="http://www.youtube"]').each(function(){ | |
var attr = $(this).attr("src"); | |
attr = attr.replace('http', 'https'); | |
$(this).attr("src", attr); | |
//var a = document.createElement("a"); | |
//a.href = attr; | |
//a.innerHTML = attr; | |
//$(this).parent().get(0).appendChild(a); |