Skip to content

Instantly share code, notes, and snippets.

@serkanberksoy
serkanberksoy / DictionaryVSRedisClientTest.cs
Created March 12, 2017 12:49
DictionaryVSRedisClientTest.cs is a performance test between ConcurrentDictionary, Dictionary and StackExchange.Redis client to redis server.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using StackExchange.Redis;
using ZeroFormatter;
namespace ConsoleApplication2
@serkanberksoy
serkanberksoy / Md5.cs
Created April 5, 2017 11:16
C# MD5 Generator same as JavaScript
// Working C# equivalent
public static string GetMD5Working(string input)
{
MD5 md5 = MD5.Create();
byte[] hash = md5.ComputeHash(Encoding.UTF8.GetBytes(input));
StringBuilder sb = new StringBuilder();
for (int j = 0; j < hash.Length; j++)
{
sb.Append(hash[j].ToString("X2"));
@serkanberksoy
serkanberksoy / cdcatalog.xsl
Last active August 22, 2018 23:10
Add a default valued node if that node does not exists in xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/*">
<xsl:copy>
@serkanberksoy
serkanberksoy / cloudSettings
Created December 1, 2018 21:15
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-12-01T21:15:43.026Z","extensionVersion":"v3.2.2"}