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
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
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
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
public class ProductDisplayWithPromoInfo | |
{ | |
public ProductDisplayDto CreateProductDisplayDto(Product product) | |
{ | |
//Get the PromoShoutOutService | |
var shoutOutService = PromotionContext.Current().CreatePromoShoutOutService(); | |
//Get the explicitly configured shouts outs for the product (the ones with ShoutOut in the CS discount comment field) | |
var productPromoShoutOuts = shoutOutService.GetPromoShoutOutsForProduct(product, ShoutOutSelection.ExplicitlyConfiguredForShoutOut); |
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
EnvironmentHelper.fs | |
let isUnix = System.Environment.OSVersion.Platform = System.PlatformID.Unix | |
let platformInfoAction (psi:ProcessStartInfo) = | |
if isUnix && psi.FileName.EndsWith ".exe" then | |
psi.Arguments <- psi.FileName + " " + psi.Arguments | |
psi.FileName <- "mono" | |
ProcessHelper.fs |
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
[CompilationMapping(SourceConstructFlags.RecordType)] | |
[Serializable] | |
public sealed class Person : IEquatable<Program.Person>, IStructuralEquatable, IComparable<Program.Person>, IComparable, IStructuralComparable | |
{ | |
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | |
internal string Name@; | |
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | |
internal string Surname@; | |
[CompilationMapping(SourceConstructFlags.Field, 0)] | |
public string Name |
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
(* | |
Reset Pathogen Bundles from Github and Vim.org | |
__IMPORTANT__ | |
* THIS SCRIPT WILL DELETE ALL BUNDLES IN YOUR PATHOGEN BUNDLE FOLDER. | |
* THIS SCRIPT MAY BE X-PLAT BUT I'VE NOT TESTED IT, SO I DOUBT IT IS. | |
* THERE IS NOT MUCH IN THE WAY OF ERROR RECOVER IN THIS SCRIPT. | |
__Installation__ | |
1. Install Pathogen https://github.com/tpope/vim-pathogen |
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
module IssueInvestiations | |
open Xunit | |
open Enticify.Promotions | |
[<Fact>] | |
let ``Issue 261 - item and shipping discount interaction`` () = | |
let (basket, orderForm) = | |
createBasket |
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
//install-package Autofac. | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using Autofac; | |
namespace Funcofac | |
{ | |
class Program |
OlderNewer