👷♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImplicitConversionTest | |
{ | |
public class A | |
{ | |
public string Member { get; set; } | |
public static implicit operator string(A self) | |
{ | |
return self.Member; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class HttpClientExtensionMethods | |
{ | |
public static void SetBasicAuth(this HttpClient httpClient, string userName, string password) | |
{ | |
var byteArray = Encoding.ASCII.GetBytes(userName + ":" + password); | |
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray)); | |
} | |
public static void AcceptJson(this HttpClient httpClient) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ServiceContract] | |
class TheResolverTestService | |
{ | |
[WebGet(UriTemplate="op1/{prm1}/{prm2}")] | |
public void Oper1(string prm1, int prm2) | |
{ | |
} | |
[WebGet(UriTemplate = "op2/{prm1}/middle/{prm2}")] | |
[OperationContract(Name="op2")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typeof (Convert) | |
.GetMethods(BindingFlags.Static|BindingFlags.Public) | |
.Where(m=>m.Name.StartsWith("To")) | |
.Select(m=>m.GetParameters().First().ParameterType) | |
.Distinct() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
var configuration = ClientConfiguration.Initialize(configure => | |
{ | |
configure.WithApiKey("1234-5678"); | |
configure.WithBaseUri("http://localhost.fiddler:64511"); | |
configure.WithSiteId(1); | |
}); | |
var pages = configuration.GetPagesClient(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/aliostad/a20f0c8d6a439dcff34e63e4a6559008/raw/0e445d869eb47e525512053638489920547a7d75/azure-vm-bootstrapper.ps1')) | |
# Bootstraps the Azure VM by modyifying settings and installing below: | |
# 1. Turn off annoying Intrenet Explorer enhanced security | |
# 2. Install chocolatey | |
# 3. Install PerfView | |
# 4. Install DebugView | |
# 5. Install SuperBenchmarker | |
# 6. Install notepad++ | |
# 7. Install windbg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: different business teams building parts of a product, splitted by business domains. We are anly communicate via domain events published to a message bus and sometimes via published links. | |
As the domain events are the "contracts" between the business domains we want to declare and enforce the schemas of the events. | |
Our solution is built in node but the concept could work in any stack. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: grunt-cli v0.1.8 | |
1. Install node-inspector globally (-g) | |
npm install -g node-inspector | |
2. Add debugger statements to your code | |
3. Run your grunt task in debug mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
namespace ConsoleApp8 | |
{ | |
class Program | |
{ | |
static async Task<int> DoStuff() | |
{ | |
var x = await System.IO.File.ReadAllTextAsync("Foo"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Raven.Client.Document; | |
namespace OurNamespace | |
{ | |
public sealed class RavenStore :IDisposable | |
{ |
OlderNewer