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
//Generic interface for Validators | |
public interface IValidator<T> | |
{ | |
IEnumerable<ValidationResult> Validate(T businessEntity); | |
} |
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 bool IsValid(string email) | |
{ | |
try | |
{ | |
System.Net.Mail.MailAddress address = new System.Net.Mail.MailAddress(email); | |
return true; | |
} | |
catch (Exception) | |
{ |
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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
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
/* global $ */ | |
/* global callback */ | |
var http = require('http'); | |
var cheerio = require('cheerio'); | |
var sendgrid = require('sendgrid')([SEND_GRID_KEY]); | |
var azure = require('azure-storage'); | |
function LegoChecker() { | |
this.Sender = '[SENDER_EMAIL]'; | |
this.Receivers = '[RECEIVER_EMAIL]'; |
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 System.Threading.Tasks; | |
using HelloRazor.Model; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.RazorPages; | |
namespace HelloRazor.Pages | |
{ |
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 @temptableforSP TABLE (spName varchar(100), tableName nvarchar(100)) | |
DECLARE @SP_Name as NVARCHAR(100); | |
DECLARE @SP_Cursor as CURSOR; | |
SET @SP_Cursor = CURSOR FOR | |
SELECT [name] FROM sys.objects WHERE name LIKE 'sp%' AND type='P' -- Gets SPs for specific names | |
OPEN @SP_Cursor; | |
FETCH NEXT FROM @SP_Cursor INTO @SP_Name; | |
WHILE @@FETCH_STATUS = 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
{ | |
"apiItems":[ | |
{ | |
"displayName":"Microsoft.CSharp.RuntimeBinder", | |
"url":"https://docs.microsoft.com/dotnet/api/microsoft.csharp.runtimebinder", | |
"description":"The namespace provides classes and interfaces that support interoperation between Dynamic Language Runtime and C#." | |
}, | |
{ | |
"displayName":"Microsoft.VisualBasic", | |
"url":"https://docs.microsoft.com/dotnet/api/microsoft.visualbasic", |
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 void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | |
var key = Encoding.ASCII.GetBytes(Configuration["Application:Secret"]); | |
services.AddAuthentication(x => | |
{ | |
x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | |
x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; | |
}) |
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 ExampleData | |
{ | |
public string Name { get; set; } | |
public int Age { get; set; } | |
/// <summary> | |
/// Total count of the records | |
/// </summary> | |
internal int TotalCount { 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
namespace BinarySearchTree | |
{ | |
public class Node | |
{ | |
public int Value { get; set; } | |
public Node Left { get; set; } | |
public Node Right { get; set; } | |
} |
OlderNewer