This file contains hidden or 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
[TestFixture] | |
public class TestAwsSplit | |
{ | |
private const string keyValueSeparator = "="; | |
private string line = "aws_secret_access_key = =+123456789123456789123456791234567891234"; | |
private static List<string> SplitData_2_3_55(string line) | |
{ | |
var split = line | |
.Split(new string[] { keyValueSeparator }, 2, StringSplitOptions.None) |
This file contains hidden or 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
// Modelled similarly to IOwinContext | |
public interface IBusContext | |
{ | |
IDictionary<string, object> Environment { get; } | |
T Get<T>(string key); | |
IBusContext Set<T>(string key, T value); | |
} | |
// Middleware for bus pipeline. | |
// Example middlewares: |
This file contains hidden or 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 Base64UrlExtensions | |
{ | |
/// <summary> | |
/// Encodes string to base64url, as specified by rfc4648 (https://tools.ietf.org/html/rfc4648#section-5) | |
/// </summary> | |
/// <returns></returns> | |
public static string ToBase64Url(this string str) | |
{ | |
// TODO - adds reference to System.Web | |
if (str == null) |
This file contains hidden or 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 DependencyModule : NancyModule | |
{ | |
private readonly IApplicationDependency applicationDependency; | |
private readonly IRequestDependency requestDependency; | |
public DependencyModule(IApplicationDependency applicationDependency, IRequestDependency requestDependency) | |
{ | |
this.applicationDependency = applicationDependency; | |
this.requestDependency = requestDependency; |
This file contains hidden or 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
[Test] | |
public void ShouldNotAllowToOverrideConfig() | |
{ | |
Mapper.CreateMap<OrderDtoString, Order>() | |
.ForMember(y => y.Status, x => x.MapFrom(t => Status.Complete)); | |
Mapper.CreateMap<OrderDtoString, Order>(); | |
var order = new OrderDtoString | |
{ |
This file contains hidden or 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
dark@ubuntu:~$ curl -XGET 'http://localhost:9200/twitter/tweet/2?pretty=true' | |
{ | |
"_index" : "twitter", | |
"_type" : "tweet", | |
"_id" : "2", | |
"_version" : 1, | |
"exists" : true, "_source" : | |
{ | |
"user": "kimchy", | |
"postDate": "2009-11-15T14:12:12", |