Skip to content

Instantly share code, notes, and snippets.

View aliozgur's full-sized avatar
🎯
Focusing

Ali Özgür aliozgur

🎯
Focusing
View GitHub Profile
@aliozgur
aliozgur / IQueryableExtensions.cs
Last active March 19, 2020 10:22
Queryable OrderBy Extensions
public enum OrderDirection
{
Asc = 1,
Desc = -1
}
public class OrderDefinition
{
public string PropertyName { get; set; }
public OrderDirection OrderDir { get; set; } = OrderDirection.Asc;
@aliozgur
aliozgur / DevKahvesi_Bio_CodeOfConduct.md
Last active March 10, 2020 18:02
Developer Kahvesi Bio Etik Kuralları (Code of Conducts)

Developer Kahvesi Bio Etik Kuralları (Code of Conduct)

Developer Kahvesi Bio, konuklarına ve dinleyicilerine cinsiyet, yaş, din, dil ve ırkına bakılmaksızın her türlü taciz, baskı ve hakaretten uzak sesli bir paylaşım platformu ve deneyimi sunmayı amaçlayan ve ağırlıklı olarak Türkçe yazılım geliştirme içeriği yayını yapan bir platformdur.

Yayınlarımızda veya yayınlarımız ile ilgili paylaşımlarda taciz, baskı veya hakaret içeren unsurlar hiç bir şekilde hoş görülmez. Yukarıda belirttiğimiz olumsuz unusurların tespit edilmesi durumunda kayıt sonlandırılır ve/veya kayıt paylaşım kanallarımız vasıtasıyla yayınlanmaz.

Taciz, baskı ve hakaret kişi veya kişilerin cinsiyeti, yaşı, dini, dili, ırkı veya fiziksel görünümü ile her türlü olumsuz ifadeyi kapsar.

@aliozgur
aliozgur / PasswordGenerator.cs
Last active December 4, 2019 11:03
Strong password generator with C#
public static class PasswordGenerator
{
[Flags]
public enum PasswordGenerationOptions
{
HasDigit = 0b0001,
HasLowerLetter = 0b0010,
HasUpperLetter = 0b0100,
HasSpecialChar = 0b1000,
@aliozgur
aliozgur / AbstractFactory.cs
Created May 21, 2018 16:29
GoF-Abstract Factory
using System;
namespace GofFactory_Revisited
{
public enum PlatformType
{
Mobile,
Desktop
}
interface IDrawable
@aliozgur
aliozgur / Singleton.cs
Last active May 21, 2018 16:43
GoF-Singleton
/// <summary>
/// Singleton class
/// </summary>
public sealed class SiteStructure
{
/// <summary>
/// Static instance property
/// </summary>
/// <value>The instance.</value>
public static SiteStructure Instance { get { return Nested._instance; } }
@aliozgur
aliozgur / Prototype.cs
Last active May 21, 2018 16:42
GoF-Prototype
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace GofPrototype
{
[Serializable]
@aliozgur
aliozgur / BulkInsert.cs
Created March 28, 2018 08:12
SqlBulk Insert with SqlBulkCopy
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
@aliozgur
aliozgur / railway.fs
Last active January 29, 2017 16:24
Railway oriented programming
// Taken from http://fsharpforfunandprofit.com/posts/recipe-part2/
// the two-track type
type Result<'TSuccess,'TFailure> =
| Success of 'TSuccess
| Failure of 'TFailure
// convert a single value into a two-track result
let succeed x =
Success x
@aliozgur
aliozgur / SqlParameterHelper.cs
Created January 19, 2016 13:41
Convert objects to SqlParameter array or list
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Collections;
using System.Data;
namespace SqlParameterHelper
{
/// <summary>
@aliozgur
aliozgur / perfectcookie.fsx
Created January 6, 2016 23:05
Advent of Code F# Day 15 : perfect-cookie
(*
Sprinkles: capacity 5, durability -1, flavor 0, texture 0, calories 5
PeanutButter: capacity -1, durability 3, flavor 0, texture 0, calories 1
Frosting: capacity 0, durability -1, flavor 4, texture 0, calories 6
Sugar: capacity -1, durability 0, flavor 0, texture 2, calories 8
*)
let myIngredientsNoCalories =
[|[|5L; -1L; 0L; 0L|];
[|-1L; 3L; 0L; 0L|];