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.ComponentModel.Composition; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using Common; | |
using Funq; | |
using ServiceStack.ServiceHost; | |
using ServiceStack.ServiceInterface; |
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.ComponentModel.Composition; | |
using System.ComponentModel.Composition.Hosting; | |
using System.IO; | |
using System.Linq; | |
using System.Configuration; | |
using System.Collections.Generic; | |
using System.Web.Mvc; | |
using Common; | |
using ServiceStack.Mvc; |
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 System.Threading; | |
using Microsoft.SqlServer.Management.Common; | |
using Microsoft.SqlServer.Management.Smo; | |
public class Restorinator{ | |
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 AwsExtensions | |
{ | |
public static string Upload(this AmazonS3 client,UploadImageRequest request) | |
{ | |
var uploadRequest = new PutObjectRequest { InputStream = request.Image }; | |
uploadRequest.WithBucketName(request.Bucket).WithKey(request.FileIdentifier); | |
var response = client.PutObject(uploadRequest); |
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
var resetEvent = new ManualResetEvent(false); | |
ThreadPool.QueueUserWorkItem( | |
arg => | |
{ | |
var task = new MyTaskRunner(); | |
task.Run(data); | |
resetEvent.Set(); | |
}); |
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
class LoginFormViewModel | |
constructor: -> #from my many attempts, things works out best when you set them up from the constructor | |
@email= ko.observable("") | |
@pass= ko.observable("") | |
@logon= => #notice the fat arrow here | |
$.post '/Account/Login', | |
userId: @email() | |
password: @pass() | |
(data) -> $('body').append "Successfully posted to the page." |
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
<form class="form-horizontal" method="POST" id="login-form" action="/Account/Login"> | |
<div class="control-group"> | |
<label class="control-label" for="userId">Email</label> | |
<div class="controls"> | |
<input id="userId" name="userId" data-bind="value: email" type="text" placeholder="Email"> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label" for="password">Password</label> | |
<div class="controls"> |
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 AccountModule : NancyModule | |
{ | |
private readonly IAuthenticationServiceClient m_authenticationService; | |
public AccountModule(IAuthenticationServiceClient authenticationService) | |
: base("/Account") | |
{ | |
m_authenticationService = authenticationService; | |
Post["/Login"] = args => | |
{ |
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 BlogBootstrapper : AutofacNancyBootstrapper | |
{ | |
protected override void ApplicationStartup(Autofac.ILifetimeScope container, Nancy.Bootstrapper.IPipelines pipelines) | |
{ | |
base.ApplicationStartup(container, pipelines); | |
#if DEBUG | |
StaticConfiguration.DisableErrorTraces = false; | |
#endif | |
CookieBasedSessions.Enable(pipelines); |
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 BloggerModule : SecureModule | |
{ | |
private readonly IBlogServiceClient m_blogService; | |
public BloggerModule(IBlogServiceClient blogService) | |
: base("/blog") | |
{ | |
m_blogService = blogService; | |
Get["/{Id}"] = parameters => | |
{ |