Skip to content

Instantly share code, notes, and snippets.

@dzimchuk
dzimchuk / gist:1e45174d3a63705b9171
Last active February 2, 2022 16:41
PowerShell script to copy Azure Table from one account to another
param (
[string]
$sourceConnectionString = $(throw "-sourceConnectionString is required."),
[string]
$sourceTableName = $(throw "-sourceConnectionString is required."),
[string]
$targetConnectionString = $(throw "-targetConnectionString is required."),
[string]
$targetTableName = $(throw "-targetTableName is required.")
)
@dzimchuk
dzimchuk / gist:5f8f4cdc2801eb22df0b
Created November 11, 2015 11:43
Converting Hex String To Corresponding Byte Array Using C#
// Origin: http://blogs.msdn.com/b/heikkiri/archive/2012/07/17/hex-string-to-corresponding-byte-array.aspx
void Main()
{
var result = ConvertToByteArray("72 0B FC".Replace(" ", string.Empty));
result.Dump();
BitConverter.ToString(result).Dump();
}
@dzimchuk
dzimchuk / QuickSort
Last active December 11, 2015 14:13
public static void QuickSort(IComparable[] elements, int left, int right)
{
int i = left, j = right;
IComparable pivot = elements[(left + right) / 2];
while (i <= j)
{
while (elements[i].CompareTo(pivot) < 0)
{
i++;
public static void BubbleSort(IComparable[] elements)
{
for (int i = 0; i < elements.Length - 1; i++)
{
for (int j = 0; j < elements.Length - 1 - i; j++)
{
if (elements[j].CompareTo(elements[j + 1]) > 0)
{
var temp = elements[j];
elements[j] = elements[j+1];
@dzimchuk
dzimchuk / convert.js
Last active March 5, 2016 08:42
Node script to convert xml/html MiniBlog post to json/markdown
var process = require('process');
var toMarkdown = require('to-markdown');
var xml2js = require('xml2js');
var fs = require('fs')
var path = require('path');
var inputDir = "";
var outputDir = "";