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 interface IBehavior | |
{ | |
void Execute<T>(T data); | |
} | |
public class BehaviorGraph | |
{ | |
private readonly IList<Type> _behaviors = new List<Type>(); | |
public T Execute<T>() |
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 ProcessExtensions | |
{ | |
public static bool IsWindowsService(this Process process) | |
{ | |
return process.GetParent().ProcessName == "services"; | |
} | |
public static Process GetParent(this Process process) | |
{ | |
var parentPid = 0; |
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
<customBinding> | |
<binding name="ReachmailBuffered"> | |
<security authenticationMode="UserNameOverTransport" includeTimestamp="false"> | |
<secureConversationBootstrap /> | |
</security> | |
<textMessageEncoding messageVersion="Soap11" maxReadPoolSize="209715200"> | |
<readerQuotas maxStringContentLength="2147483647" /> | |
</textMessageEncoding> | |
<httpsTransport maxReceivedMessageSize="209715200" maxBufferPoolSize="209715200" maxBufferSize="209715200" /> | |
</binding> |
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
Handlebars.registerHelper('when', function (predicate, options) { | |
var declarations = ''; | |
for (var field in this) declarations += field + ' = this.' + field + ','; | |
if (eval(declarations + predicate)) { return options.fn(this); } | |
}); | |
{{#when 'admin || superUser'}} | |
crazy go nuts | |
{{/when}} |
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
require "fileutils" | |
def create_fubu_bottle(*args, &block) | |
body = lambda { |*args| | |
task = CreateFubuBottle.new | |
block.call(task) | |
task.run | |
} | |
Rake::Task.define_task(*args, &body) | |
end |
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 MemorySmtpServer | |
{ | |
private readonly bool _redirectSmtpConfiguration; | |
private const int Port = 62352; | |
private readonly Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | |
private MailSettingsSectionGroup _mailSettings; | |
private string _originalHost; | |
private int _originalPort; | |
private SmtpServer _server; |
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 ExpandoJsonWriter : IJsonWriter | |
{ | |
private readonly IOutputWriter _outputWriter; | |
private readonly JavaScriptSerializer _jsonSerializer; | |
public ExpandoJsonWriter(IOutputWriter outputWriter) | |
{ | |
_outputWriter = outputWriter; | |
_jsonSerializer = new JavaScriptSerializer(); | |
} |
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 Spark | |
{ | |
public const string MasterTemplate = @" | |
<html> | |
<body> | |
<h1>TMNT</h1> | |
<div>{{{Content}}} | |
</div> | |
</body> |
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 Mustache | |
{ | |
public const string MasterTemplate = @" | |
<html> | |
<body> | |
<h1>TMNT</h1> | |
<div>{{{Content}}} | |
</div> | |
</body> | |
</html>"; |
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 Person | |
{ | |
public string Name { get; set; } | |
public string Address { get; set; } | |
} | |
public class InputModel | |
{ | |
public string GroupId { get; set; } | |
public Person Person { get; set; } |