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 RavenDbBehavior : IActionBehavior | |
{ | |
private readonly IDocumentSession _session; | |
public IActionBehavior InsideBehavior { get; set; } | |
public RavenDbBehavior(IDocumentSession session) | |
{ | |
_session = session; | |
} |
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 FeatureViewLocationRazorViewEngine : RazorViewEngine | |
{ | |
public FeatureViewLocationRazorViewEngine() | |
{ | |
ViewLocationFormats = new[] | |
{ | |
"~/Features/{1}/{0}.cshtml", | |
"~/Features/{1}/{0}.vbhtml", | |
"~/Features/Shared/{0}.cshtml", | |
"~/Features/Shared/{0}.vbhtml", |
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
====================================================== | |
====================================================== | |
//File toggle.js | |
// All the logic for getting toggle information | |
exports = function FeatureToggle(toggleName, offFunc, onFunc) { | |
return function() { | |
if (toggleOn(toggleName)) |
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 interface IAmAFeature { | |
public void Blah(); | |
} | |
public interface WelcomeEmailFeature { | |
public void Blah() { | |
// Send email with no jobs. | |
} | |
} |
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
=========================== | |
=========================== | |
// file1.js | |
var a = function() { | |
} | |
exports.b = function() { | |
var a = function() { |
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
#haskell | |
foldr (.) id [inc, inc, inc] $ 0 | |
data Event | |
= AccountCreated Email | |
| AccountLoggedIn | |
| Start |
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
case class State(emailAddress: String, loginCount: Int, failedLoginCount: Int, locked: Boolean) { | |
/* Login to go here */ | |
} | |
abstract class Event() { | |
def apply(s: State): State | |
} | |
case class AccountCreated(emailAddress: String) extends Event { |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Linq; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Filters; |
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
// http_conventions.js | |
var Backbone = require('Backbone'); | |
var postOnUpdate = function(method, model, options) { | |
return Backbone.sync('create', model, options); | |
} | |
var postOnGet = // whatever here | |
export.postOnUpdate = postOnUpdate; | |
export.postOnGet = postOnGet; |
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 Program | |
{ | |
public HttpResponse BuildDeleteRequest(Action<HttpRequest> action) | |
{ | |
var @object = new HttpRequest() | |
{ | |
Method = "GET" | |
}; | |
action(@object); | |
return @object.Execute(); |
OlderNewer