Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bentayloruk on github.
  • I am bentayloruk (https://keybase.io/bentayloruk) on keybase.
  • I have a public key whose fingerprint is 7373 887D 9B5F B35E DA6E BA7E 8CC9 2FEA 809C C2B8

To claim this, I am signing this object:

@bentayloruk
bentayloruk / csharp.cs
Last active August 29, 2015 13:56 — forked from ToJans/csharp.cs
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace TDDCoverage
{
public class Order
{
//install-package Autofac.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Autofac;
namespace Funcofac
{
class Program
@bentayloruk
bentayloruk / Issue261.fs
Created November 11, 2012 09:08
Issue 261 Investigation Test
module IssueInvestiations
open Xunit
open Enticify.Promotions
[<Fact>]
let ``Issue 261 - item and shipping discount interaction`` () =
let (basket, orderForm) =
createBasket
@bentayloruk
bentayloruk / reset-bundle.fsx
Created October 16, 2012 14:12
Reset Pathogen Bundles from Github and Vim.org
(*
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
@bentayloruk
bentayloruk / person.cs
Created October 15, 2012 10:58
Person Record Type Example
[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
@bentayloruk
bentayloruk / gist:3518432
Created August 29, 2012 20:27
F# Learning - Concat sequences
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
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);
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();
@bentayloruk
bentayloruk / RunOrderFormForEvents.cs
Created February 29, 2012 13:38
Enticify OrderForm.GetAllPromoEvents Extension Method Example
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!