Skip to content

Instantly share code, notes, and snippets.

View FredrikGoransson's full-sized avatar

Fredrik Göransson FredrikGoransson

  • Google
  • Stockholm
View GitHub Profile
// serviceUri - the fabric address of the service you want to query for partitions
// this gist assumes your service has an Int64 partitioning scheme.
var fabricClient = new FabricClient();
var servicePartitionList = await fabricClient.QueryManager.GetPartitionListAsync(serviceUri);
IList<Int64RangePartitionInformation> partitionKeys = new List<Int64RangePartitionInformation>(servicePartitionList.Count);
foreach (var partition in servicePartitionList)
{
var int64PartitionInfo = partition.PartitionInformation as Int64RangePartitionInformation;
@FredrikGoransson
FredrikGoransson / .deploy
Last active February 3, 2017 22:12
Custom KUDU deployment script
[config]
command = deploy.cmd
@FredrikGoransson
FredrikGoransson / RSAController.cs
Created January 30, 2017 07:53
Test RSA Crypt container in ASP.NET
using System;
using System.Collections.Generic;
using System.Security.AccessControl;
using System.Security.Cryptography;
using System.Security.Principal;
using System.Text;
using Microsoft.AspNetCore.Mvc;
namespace Azure.SO.Answer._41615391.Controllers
{
@FredrikGoransson
FredrikGoransson / gist:5669536
Created May 29, 2013 11:12
Execute Migrations for FluentMigrator inside code (a unit test for instance)
// Runs all migrations in the assembly of specified type
private static void RunMigrations<T>(string connectionString)
{
var announcer = new NullAnnouncer();
//var announcer = new TextWriterAnnouncer(s => System.Diagnostics.Debug.WriteLine(s));
var assembly = typeof(T).Assembly;
var migrationContext = new RunnerContext(announcer);
var options = new MigrationOptions { PreviewOnly = false, Timeout = 60 };