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.ComponentModel.DataAnnotations; | |
using Microsoft.AspNet.Identity.EntityFramework; | |
using Newtonsoft.Json; | |
namespace Project.Models | |
{ | |
[MetadataType(typeof (ApplicationUserMetaData))] | |
public class ApplicationUser : IdentityUser | |
{ |
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 Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Routing; | |
namespace Example | |
{ | |
public class ByteRangesRouteConstraint : IRouteConstraint | |
{ | |
public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection) | |
{ | |
if (!values.TryGetValue("url", out var url) || url == 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
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
namespace MediaHotkeys | |
{ | |
internal class Program | |
{ | |
[DllImport("user32.dll", SetLastError = true)] | |
private static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); |
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
dotnet dev-certs https -ep "dev-cert.pfx" -p "d@nK3w1lhELm" | |
dotnet dev-certs https --trust |
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
.easteregg { | |
animation: rainbow 1s infinite linear; | |
-moz-animation: rainbow 1s infinite linear; | |
-webkit-animation: rainbow 1s infinite linear; | |
-o-animation: rainbow 1s infinite linear; | |
-webkit-transition: color; | |
-moz-transition: color; | |
-o-transition: color; | |
transition: color | |
} |
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.Security.Cryptography; | |
using System.Text; | |
using Microsoft.AspNet.Identity; | |
namespace Project | |
{ | |
public class CustomPasswordHasher<TUser> : ICustomPasswordHasher<TUser> where TUser : class , IUser<string> | |
{ |
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
DECLARE @t1 DATETIME; | |
DECLARE @t2 DATETIME; | |
SET @t1 = GETDATE(); | |
-- Query to measure | |
SET @t2 = GETDATE(); | |
SELECT DATEDIFF(millisecond,@t1,@t2) AS elapsed_ms; |
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.Data.Entity; | |
using ProjectName.Models; | |
namespace ProjectName { | |
public class DataContext : DbContext { | |
internal DbSet<ElmahError> ElmahErrors { 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
using System.Collections; | |
using System.Web; | |
using Elmah; | |
namespace Project | |
{ | |
/// <summary> | |
/// A custom implementation of the elamh provided <see cref="SqlErrorLog" />. | |
/// </summary> | |
public class CustomSqlErrorLog : SqlErrorLog |
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
class TaxonomySearchResult { | |
id: string; | |
label: string; | |
termSetId: string; | |
parentTermId: string; | |
constructor(resultValue: string) { | |
const informationParts = resultValue.split(";"); | |
for (let i = 0; i < informationParts.length; i++) { |
NewerOlder