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; | |
namespace Gists | |
{ | |
public static class ListExtensions | |
{ | |
public static T GetRandom<T>(this List<T> list, Random random = null) | |
{ | |
random = random ?? new Random(); |
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
namespace Project { | |
public static class Utilities { | |
public static string[] ByteUnits = {"kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}; | |
public static string GetPrettyFileSize(int fileSize) { | |
return GetPrettyFileSize((double)fileSize); | |
} | |
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
SELECT DB_NAME(database_id) AS DatabaseName, name AS LogicalFileName, physical_name AS PhysicalFileName | |
FROM sys.master_files AS mf |
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 Xamarin.Forms.Xaml; | |
[assembly: XamlCompilation(XamlCompilationOptions.Compile)] |
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
... | |
protected override void OnModelCreating(ModelBuilder builder) | |
{ | |
builder.Entity<User>().ForSqlServerToTable("Users"); | |
builder.Entity<IdentityRole>().ForSqlServerToTable("Roles"); | |
builder.Entity<IdentityUserRole<string>>().ForSqlServerToTable("UserRoles"); | |
builder.Entity<IdentityUserClaim<string>>().ForSqlServerToTable("UserClaims"); | |
builder.Entity<IdentityRoleClaim<string>>().ForSqlServerToTable("RoleClaims"); | |
builder.Entity<IdentityUserLogin<string>>().ForSqlServerToTable("UserLogins"); | |
builder.Entity<IdentityUserToken<string>>().ForSqlServerToTable("UserTokens"); |
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++) { |
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
.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 | |
} |