Skip to content

Instantly share code, notes, and snippets.

Szymon Kulec Scooletz

Block or report user

Report or block Scooletz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Scooletz / sas.cs
Created Mar 17, 2018
Blob SAS Token
View sas.cs
public static string GetBlobReadonlySasToken(CloudStorageAccount account)
var now = DateTimeOffset.Now;
// to address emulator running on http
var nonHttps = account.BlobEndpoint.ToString().StartsWith("http:");
var sas = account.GetSharedAccessSignature(new SharedAccessAccountPolicy
Services = SharedAccessAccountServices.Blob,
Scooletz / TFChunk.cs
Last active Feb 15, 2018
EventStore's TFChunk writing a reversable entry
View TFChunk.cs
var workItem = _writerWorkItem;
var buffer = workItem.Buffer;
var bufferWriter = workItem.BufferWriter;
buffer.Position = 4;
var length = (int) buffer.Length - 4;
bufferWriter.Write(length); // length suffix
buffer.Position = 0;
Scooletz /
Created Feb 2, 2018
JSON.NET serializers Guid
public override void WriteValue(Guid value)
string text = null;
text = value.ToString("D", CultureInfo.InvariantCulture);
text = value.ToString("D");
Scooletz / perf-counter-timer-1h.cs
Created Aug 17, 2017
This gist provides a test showing that AverageTimer32 handles ticks greater than int.MaxValue
View perf-counter-timer-1h.cs
namespace Tests
using System;
using System.Diagnostics;
using System.Security;
using System.Threading;
using NUnit.Framework;
public class PerformanceCounterCategoryTest
Scooletz / Program.cs
Last active Apr 25, 2017
ProtofbufRaw vs regular protobuf-net
View Program.cs
using System;
using System.IO;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using ProtoBuf;
namespace Locals
class Program
Scooletz / Program.cs
Last active Apr 21, 2017
ThreadStatic vs stackalloc
View Program.cs
using System;
using System.Buffers;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace Locals
class Program
Scooletz / CodeCopPossibleBug.cs
Last active Mar 2, 2016
Both tests don't work. When a struct is turned into a class, they start to work
View CodeCopPossibleBug.cs
using System;
using CodeCop.Core;
using CodeCop.Core.Fluent;
using NUnit.Framework;
namespace CodeCop.Tests
public class CodeCopStructBugTests
public unsafe struct WithPtr
View PowerShell
IFS=' '
while read local_ref local_sha remote_ref remote_sha
if [ "$local_sha" = $z40 ]
Scooletz / SqlClientSqlCommandSet.cs
Created Sep 11, 2015
System.Data.SqlClient.SqlCommandSet extracted from Data internals, better than NHibernate, as no delegates creation is required beside the first static ctor
View SqlClientSqlCommandSet.cs
public class SqlClientSqlCommandSet : IDisposable
private static readonly Type SqlCmdSetType;
private readonly object _instance;
private int _countOfCommands;
private readonly static Action<object, SqlConnection> SetConnection;
private readonly static Func<object, SqlConnection> GetConnection;
private readonly static Action<object, SqlTransaction> SetTransaction;
private readonly static Func<object, SqlCommand> GetCommand;
View gist:9b78bd52451f76ba0eea
public class TestX
public void T()
You can’t perform that action at this time.