Skip to content

Instantly share code, notes, and snippets.

View yemrekeskin's full-sized avatar
🎯
Focusing

yunus emre keskin yemrekeskin

🎯
Focusing
View GitHub Profile
@yemrekeskin
yemrekeskin / LinkCrawler.cs
Created February 11, 2014 21:08
Sample for WebCrawler
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace LinkCrawler
// 1 Way
public class Configuration
{
public string EndPoint
{
get { return ConfigurationManager.AppSettings["EndPoint"]; }
}
// other properties here//
}
@yemrekeskin
yemrekeskin / FluentTestProcessor.cs
Last active August 29, 2015 13:56
FluentTestProcessor - code sample for Fluent Interface
public class TestProcessorOutput
{
public string ScreenTestOutputMessage { get; set; }
public string StoredProcedureTestOutputMessage { get; set; }
public string RunOutPutFileValidationTestOutputMessage { get; set; }
public string RunInputFilevalidationTestOutputMessage { get; set; }
}
public interface ITestProcessor
{
GO
/****** Object: StoredProcedure [dbo].[INSERT] Script Date: ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--drop proc [dbo].[INSERT]
CREATE procedure [dbo].[INSERT]
(
public interface ILogger
{
void Write(Exception ex);
void Write(string logText);
}
public abstract class BaseLogger
: ILogger
{
public static string logFilePath = string.Empty;
@yemrekeskin
yemrekeskin / Simple.WebCrawler.cs
Created May 15, 2014 07:41
SimpleWebCrawler with 2 node deep - console app
class Program
{
static void Main(string[] args)
{
LinkCrawler crawler = new LinkCrawler();
List<string> list = crawler.Catch("http://blog.yemrekeskin.com/en/");
foreach (var item in list)
{
Console.WriteLine(item);
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using ServiceStack;
using ServiceStack.Configuration;
using ServiceStack.Redis;
using ServiceStack.Text;
namespace GithubApi
@yemrekeskin
yemrekeskin / EmbeddedStringResources.cs
Created June 12, 2014 12:24
Resource file manager in assembly
public static class EmbeddedStringResources
{
static Dictionary<string, string> stringResources = new Dictionary<string, string>();
public static string LoadResource(string name)
{
// Tüm resource .dll içinde olmalı (GetExecutingAssembly())
Assembly assembly = Assembly.GetExecutingAssembly();
string resourceName = assembly.GetName().Name + ".Resources." + name;
@yemrekeskin
yemrekeskin / CronLog.cs
Created July 21, 2014 07:21
override Equals
public class CronLog
:BaseModel
{
public int ProcessId { get; set; }
public string ProcessName { get; set; }
public DateTime RequestTime { get; set; }
public DateTime ActualRequestTime { get; set; }
public DateTime ResponseTime { get; set; }
@yemrekeskin
yemrekeskin / TurkishIdNoGenerator.cs
Created July 23, 2014 11:09
Random Turkish Identification Number Generator with c#
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Samples
{
class Program
{