- Death to Optimise - Not sure if this is relevant to the .NET port or not.
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 Microsoft.CommerceServer.Catalog; | |
using Microsoft.CommerceServer.Runtime.Profiles; | |
namespace Enticify.CommerceServer.Tests.Scenarios | |
{ | |
public class PromoInfoSourceApi | |
{ | |
public void GetPromoInfoForProductAndDoSomething(Product csProduct, Profile csUserProfile) | |
{ | |
var promotionQueryService = new PromotionQueryService(); |
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 orderForm = // OrderForm you get by running pipeline containing Enticify.Promotions | |
// Get all of the Enticify Promotion Events | |
var promoEvents = orderForm.GetAllPromoEvents(); | |
// Filter for those that partially qualified | |
var partiallyQualified = promoEvents.OfType<PromoPartiallyQualified>(); | |
// Loop through the events looking at quantity and money distances? Or whatever! |
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
require "rack/jekyll" | |
require "rack-rewrite" | |
use Rack::Rewrite do | |
rewrite %r{^\/(.+)\/(\?.*)?$}, '/$1$2' | |
r301 %r{.*}, 'http://bentaylor.org$&', :if => Proc.new {|rack_env| | |
rack_env['SERVER_NAME'] != 'bentaylor.org' | |
} |
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 IEnumerable<T> Promise<T>(this IEnumerable<T> enumerable) | |
{ | |
return enumerable ?? Enumerable.Empty<T>(); | |
} |
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
// Safely get Some head of Seq or None. | |
let maybeHead = someSeq |> Seq.tryPick Some |
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
namespace Newtonsoft.Json.Converters | |
open Microsoft.FSharp.Reflection | |
open Newtonsoft.Json | |
open System | |
type IdiomaticDuConverter() = | |
inherit JsonConverter() | |
[<Literal>] |
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
namespace System.Web.Http | |
open System.Reflection | |
open System.Web.Http.Filters | |
open System.Web.Http.Controllers | |
open System.Runtime.InteropServices | |
/// Responsible for populating missing action arguments from DefaultParameterValueAttribute values. | |
/// Created to handle this issue https://github.com/aspnet/Mvc/issues/1923 | |
/// Note: This is for later version of System.Web.Http but could be back-ported. |
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
namespace Peelio.ZonePlayer.ZoneGroupTopology | |
open System | |
open System.Linq | |
open System.Xml.Linq | |
open Peelio | |
/// Union types for those state vars with a set of allowed values. | |
type A_ARG_TYPE_UpdateType = | All | Software | |
with |