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
<# | |
.SYNOPSIS | |
Find all files excluded from a Visual Studio solution with options to delete. | |
.DESCRIPTION | |
Finds all excluded files in all projects in the provided Visual Studio solution with options to delete the files. | |
.PARAMETER Solution | |
The path to the .sln file |
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 Startup | |
{ | |
private static readonly string Realm = ConfigurationManager.AppSettings["ida:Wtrealm"]; | |
private static readonly string AdfsMetadata = ConfigurationManager.AppSettings["ida:ADFSMetadata"]; | |
public void Configuration(IAppBuilder app) | |
{ | |
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); | |
app.UseCookieAuthentication(new CookieAuthenticationOptions()); |
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 UnitOfWorkDelegatingHandler : DelegatingHandler | |
{ | |
protected override async Task<HttpResponseMessage> SendAsync( | |
HttpRequestMessage request, | |
CancellationToken cancellationToken) | |
{ | |
var response = await base.SendAsync(request, cancellationToken); | |
var isSafeMethod = request.Method == HttpMethod.Get || request.Method == HttpMethod.Head; | |
if (!response.IsSuccessStatusCode || isSafeMethod) |
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 JsonSplitter | |
{ | |
public static Result SplitShowsByGenre(string trendingShowsJson, string comedy) | |
{ | |
var trendingShows = | |
JsonConvert.DeserializeObject<List<Movie>>(trendingShowsJson); | |
var comedyShows = trendingShows.Where(m => m.Genres.Contains(comedy)); | |
var noComedyShows = trendingShows.Where(m => !m.Genres.Contains(comedy)); | |
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
//Obten una lista de clientes no repetidos sin usar el operador Distinct y en solo una línea | |
void Main() | |
{ | |
var duplicatedCustomers = new List<Customer> | |
{ | |
new Customer | |
{ | |
Id = 1, | |
Name = "Luis" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<key name="Software"> | |
<key name="ConEmu"> | |
<key name=".Vanilla" modified="2014-07-24 12:56:50" build="140707"> | |
<value name="ColorTable00" type="dword" data="00000000"/> | |
<value name="ColorTable01" type="dword" data="00800000"/> | |
<value name="ColorTable02" type="dword" data="00008000"/> | |
<value name="ColorTable03" type="dword" data="00808000"/> | |
<value name="ColorTable04" type="dword" data="00000080"/> | |
<value name="ColorTable05" type="dword" data="00800080"/> |
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 MongoDB.Driver; | |
namespace Luru.Collections | |
{ | |
public class PaginatedList<T> | |
{ | |
public int PageIndex { get; set; } |
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 TempDataDocument | |
{ | |
[BsonRepresentation(BsonType.ObjectId)] | |
public string Id { get; set; } | |
[BsonElement("key")] | |
public string Key { get; set; } | |
[BsonElement("value")] | |
[BsonSerializer(typeof(CustomSerializer))] | |
public object Value { get; set; } | |
} |
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 static T GetValue<T>(this IDictionary<string, object> dictionary, string key) | |
{ | |
if (!dictionary.ContainsKey(key)) | |
{ | |
return default(T); | |
} | |
object data = dictionary[key]; | |
return data != null && data.GetType() == typeof (T) ? (T) data : default(T); |
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 SslRequiredMessageHandler : DelegatingHandler | |
{ | |
protected override Task<HttpResponseMessage> SendAsync( | |
HttpRequestMessage request, | |
CancellationToken cancellationToken) | |
{ | |
if (!request.IsSecureConnection)) | |
{ | |
var response = | |
request.CreateErrorResponse(HttpStatusCode.Forbidden, "Https required"); |
NewerOlder