Skip to content

Instantly share code, notes, and snippets.

@bentayloruk
bentayloruk / music-to-code-by.md
Created January 10, 2020 12:02
Music to Code By - Compiled by @bentayloruk
@bentayloruk
bentayloruk / SleepingGame.fs
Created September 15, 2018 17:49
Poppy Graham's Sleeping Game
open System
open System
open System.ComponentModel
let readLine () =
Console.ReadLine().ToLower()
let exit () =
printfn "\r\nByyyyyyyyyyeeeeeeeeeeeeeee zzzzzzzzzzzzzzzzzzzz\r\n"
0
@bentayloruk
bentayloruk / AmazingElmInsight.md
Created June 22, 2017 09:34
Amazing Elm Insight!
module ReactQueryBuilder
open Fable.Core
open Fable.Import
open Fable.Import.React
open Fable.Core.JsInterop
open Fable.Helpers.React.Props
open System
// TODO
//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);