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 OMR.Core.Helpers | |
{ | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class EventAggregator | |
{ | |
public IDictionary<Type, IList> Subscribers; |
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 Sample | |
{ | |
using System.Collections.Concurrent; | |
public class FixedSizedQueue<T> | |
{ | |
ConcurrentQueue<T> q = new ConcurrentQueue<T>(); | |
public int Limit { get; internal 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
CREATE FUNCTION [dbo].[SplitString] | |
( | |
@string NVARCHAR(MAX), | |
@delimiter CHAR(1) | |
) | |
RETURNS @output TABLE(splitdata NVARCHAR(MAX) | |
) | |
BEGIN | |
DECLARE @start INT, @end INT | |
SELECT @start = 1, @end = CHARINDEX(@delimiter, @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
public class RouteConfig | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.MapRoute( | |
"Sub", // Route name | |
"{controller}/{action}/{id}", // URL with parameters | |
new { controller = "SubdomainController", action = "AnyActionYouLike", id = UrlParameter.Optional }, |
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 interface IIdentifierGenerator | |
{ | |
Guid SequentialGuid(); | |
} | |
public class GuidCombGenerator | |
: IIdentifierGenerator | |
{ | |
public Guid SequentialGuid() | |
{ |
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 abstract class DataProcessor | |
{ | |
public abstract void SetDataSource(string url); | |
public abstract bool IsValid(); | |
public abstract void Parse(); | |
public abstract void SaveData(); | |
// template method | |
public void GetResult() | |
{ | |
if (IsValid()) |
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.Text; | |
using System.Text.RegularExpressions; | |
public static class SeoHelper | |
{ | |
public static string[] GetKeywords(string input, bool cultureInvariant) | |
{ |
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 Benchmark | |
{ | |
public static BenchmarkResult Run(Action action) | |
{ | |
return Run(action, null, null); | |
} | |
public static BenchmarkResult Run(Action action, string name, string message) | |
{ | |
var dateStarted = DateTime.Now; |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Samples | |
{ | |
class Program | |
{ |
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
<!-- | |
Random Turkish Identification Number Generator | |
--> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
</head> | |
<body> |