As configured in my dotfiles.
start new:
tmux
start new with session name:
| fun main(args: Array<String>) { | |
| val server = embeddedServer(Netty, port = 9000) { | |
| intercept(ApplicationCallPipeline.Infrastructure) { | |
| val requestId = UUID.randomUUID() | |
| log.attach("req.Id", requestId.toString(), { | |
| log.info("Interceptor[start]") | |
| proceed() | |
| log.info("Interceptor[end]") | |
| }) | |
| } |
| public class Startup | |
| { | |
| public void Configure(IApplicationBuilder app) | |
| { | |
| app.UseStaticFiles(); | |
| app.UseServices(services => | |
| { | |
| services.AddMvc(); | |
| services.SetupOptions<MvcOptions>(x => |
| public class ViewDataForActivation | |
| { | |
| [Activate] | |
| public ViewDataDictionary ViewData { get; set; } | |
| } |
| using MvcSample.Web.Models; | |
| namespace MvcSample.Web | |
| { | |
| public class HomeController | |
| { | |
| public User Index() | |
| { | |
| var user = new User | |
| { |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| module CustomerEndpoints | |
| let ``GET /customers/list`` (repository: ICustomerRepository) = | |
| repository.List | |
| |> Seq.map customerToViewRecord | |
| type GetCustomerInput = {Id: int;} | |
| let ``GET /customers/{Id}`` (repository: ICustomerRepository) (input: GetCustomerInput) = | |
| repository.Get input.Id |> customerToViewRecord |
| public class SendEmailNowBehavior<TResponse> : IActionBehavior | |
| where TResponse : RenderEmailBase | |
| { | |
| private readonly IOutputWriter _outputWriter; | |
| private readonly IFubuRequest _fubuRequest; | |
| private readonly IMailer _mailer; | |
| public SendEmailNowBehavior(IOutputWriter outputWriter, IFubuRequest fubuRequest, IMailer mailer) | |
| { | |
| _outputWriter = outputWriter; |
| public class FeatureToggleRegistry : Registry | |
| { | |
| public FeatureToggleRegistry() | |
| { | |
| Scan(x => | |
| { | |
| x.TheCallingAssembly(); | |
| x.Convention<SettingsConvention>(); | |
| }); | |
| } |
| public class FeatureSettings | |
| { | |
| public bool SpecialFeatureEnabled { get; set; } | |
| public bool SomeOtherFeatureEnabled { get; set; } | |
| } |
| @model FeatureToggleSample.HomeModel | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Toggling Features</title> | |
| </head> | |
| <body> | |
| <div> |