Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.EventHubs;
using Newtonsoft.Json;
var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
hashSet.Add("abc");
hashSet.Add("Abc");
hashSet.Add("abc");
hashSet.Remove("ABC");
hashSet.Add("abc");
Console.WriteLine(hashSet.Count);
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis;
namespace SourceCodeSandbox
{
public static class SanboxExtensions
{
private static readonly HashSet<Type> AllowedDefaultTypes = new HashSet<Type>
@yar-shukan
yar-shukan / CollationComparer.cs
Last active August 29, 2015 14:02
CollationComparer
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using Microsoft.SqlServer.Management.SqlParser.Metadata;
public class CollationComparer : IEqualityComparer<string>, IComparer<string>
{
private readonly CollationInfo _collationInfo;
private readonly CompareOptions _compareOptions;
@yar-shukan
yar-shukan / output.txt
Last active August 29, 2015 14:01
Compare chars in all cultures
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.IO;
using System.Text;
using System.Diagnostics;
using System.Threading.Tasks;
namespace ConsoleApplication1
@yar-shukan
yar-shukan / TaskRun vs Sync
Last active August 29, 2015 13:57
TaskRun vs Sync
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Web.Http;
namespace MvcApplication1.Controllers
{
public class WaitController : ApiController
{
@yar-shukan
yar-shukan / gist:9736873
Created March 24, 2014 09:13
1-1 OData projection
using System.Linq;
using System.Web.Http;
using System.Web.Http.OData.Query;
namespace ProjectionWebApi.Controllers
{
[Route("api/projectioncheck")]
public class ProjectionCheckController : ApiController
{
private static readonly IQueryable<User> UserSet = new[]
@yar-shukan
yar-shukan / progressNotifier.js
Created March 11, 2014 10:38
ProgressNotifier
//Shows different alerts (can be used in popup or simple container mode)
(function($) {
var Widget = kendo.ui.Widget,
POPUPCONTAINER = "containerBox-popup",
TEXTCONTAINER = "notifier-text",
TEXTCONTAINERSELECTOR = "." + TEXTCONTAINER,
NOTIFYWRAPPERID = "notify-wrapper",
alertClasses = {
success: "alert-success",
inProgress: "alert-info",
@yar-shukan
yar-shukan / EnumerableExtensions.cs
Last active August 29, 2015 13:56
TakeFromGrouped
using System;
using System.Collections.Generic;
namespace TakeFromGroup
{
public static class EnumerableExtensions
{
public static IEnumerable<T> TakeFromGrouped<T, TGroup>(this IEnumerable<T> enumerable,
Func<T, TGroup> groupSelector,
Func<T, T, T> takeFunc)