Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
💥 shakalaka

Tugberk Ugurlu tugberkugurlu

:shipit:
💥 shakalaka
View GitHub Profile
@tugberkugurlu
tugberkugurlu / gist:3848723
Created Oct 7, 2012 — forked from benfoster/gist:3848715
Adding IServiceProvider to ValidationContext in ASP.NET MVC
View gist:3848723
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
/* usual sh** ommitted for brevity */
var resolver = new CustomDependencyResolver();
DependencyResolver.SetResolver(resolver);
DataAnnotationsModelValidatorProvider.RegisterDefaultAdapterFactory(
@tugberkugurlu
tugberkugurlu / FizzBuzz.cs
Last active Apr 5, 2022
FizzBuzz problem solution with C#.
View FizzBuzz.cs
// reference: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
static class Program {
static void Main(string[] args) {
for (int i = 1; i <= 100; i++) {
bool canBeMultipliedByFive = i.CanBeMultipliedBy(5);
bool canBeMultipliedByThree = i.CanBeMultipliedBy(3);
@tugberkugurlu
tugberkugurlu / WebApiSimplePatchSample.cs
Last active Jan 20, 2022
ASP.NET Web API Patch Sample.
View WebApiSimplePatchSample.cs
public class Car {
public int Id { get; set; }
[Required]
[StringLength(20)]
public string Make { get; set; }
[Required]
[StringLength(20)]
View bcdedit.ps1
##################################################
#resources
##################################################
#http://technet.microsoft.com/en-us/library/cc721886(v=ws.10).aspx
#http://technet.microsoft.com/en-us/library/cc709667(v=ws.10).aspx
##################################################
#resources
##################################################
####################################################################################
@tugberkugurlu
tugberkugurlu / DbGeographyTryOut.cs
Created Jun 4, 2012
System.Data.Spatial.DbGeography sample (Latitude and Longitude).
View DbGeographyTryOut.cs
class Program {
public class Db {
public static Dictionary<string, DbGeography> Locations = new Dictionary<string, DbGeography>() {
//instert the place locations here...
};
}
View my-ndc-london-2021-agenda.md
View t4g-instance-for-ecs-image.md
➜ aws ec2 describe-images --image-id ami-0a879f21e6f3b1fb2
{
    "Images": [
        {
            "Architecture": "arm64",
            "CreationDate": "2020-12-10T18:09:00.000Z",
            "ImageId": "ami-0a879f21e6f3b1fb2",
            "ImageLocation": "amazon/amzn2-ami-ecs-hvm-2.0.20201209-arm64-ebs",
            "ImageType": "machine",
@tugberkugurlu
tugberkugurlu / program.cs
Last active Mar 19, 2020
C# Atomic File Write Sample
View program.cs
using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace AtomicWriteSample
{
class Program
{
@tugberkugurlu
tugberkugurlu / Program.cs
Last active Jan 7, 2020
RavenDB BlogPost and Comments sample.
View Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Embedded;
using Raven.Client.Indexes;