Skip to content

Instantly share code, notes, and snippets.

@cloudRoutine
cloudRoutine / d6.fsx
Created November 11, 2014 15:12
D6 Type
open System
type D6 =
| One | Two | Three | Four | Five | Six
member self.Value =
match self with
| One -> 1 | Two -> 2 | Three -> 3
| Four -> 4 | Five -> 5 | Six -> 6
override self.ToString() =
match self with
@cloudRoutine
cloudRoutine / gist:3b57cc9ce47609a19c1d
Last active August 29, 2015 14:09
Ace Syntax Highlighting F# (revised)
ace.define('ace/mode/fsharp_highlight_rules', function(require, exports, module)
{
"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var FSharpHighlightRules = function ()
Capability Red - Requirements at Scale by Liz Keogh
http://www.ndcvideos.com/#/app/video/2111
----
Beyond Rectangles in Web Design - CSS Shapes and CSS Masking by Razvan Caliman
http://www.ndcvideos.com/#/app/video/2121
----
Coding Culture by Sven Peters
http://www.ndcvideos.com/#/app/video/2131
----
The Ultimate Logging Architecture - You KNOW You Want It by Michele Leroux Bustamante
@cloudRoutine
cloudRoutine / CMakeUtils.bat
Created December 13, 2014 04:39
XMP Toolkit CMake script update for VS 2013
:: =================================================================================================
:: Copyright 2013 Adobe Systems Incorporated
:: All Rights Reserved.
::
:: NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
:: of the Adobe license agreement accompanying it.
:: =================================================================================================
REM Available Arguments:
REM [64|32] Bit Architecture (optional, 64 is default)
@cloudRoutine
cloudRoutine / GenerateXMPToolkitSDK_vc12.bat
Created December 13, 2014 04:41
XMP Toolkit Generate Visual Studio Solution Script updated for VS 2013
:: =================================================================================================
:: Copyright 2013 Adobe Systems Incorporated
:: All Rights Reserved.
::
:: NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
:: of the Adobe license agreement accompanying it.
:: =================================================================================================
echo OFF
cls
@cloudRoutine
cloudRoutine / struct_lens.fsx
Last active August 29, 2015 14:12
Struct Lens
[<Struct>]
type Lens<'Struct,'Prop> =
val Get : 'Struct -> 'Prop
val Set : 'Prop -> 'Struct -> 'Struct
member lens.Update func prop =
let value = lens.Get prop
let result = func value
lens.Set result prop
@cloudRoutine
cloudRoutine / gridcontroller.cs
Created December 24, 2014 06:12
Grid Controller - Unity Editor Extensions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEditor;
using HexMap;
using ExtensionMethods;
@cloudRoutine
cloudRoutine / 01querylistboxhelpers.fs
Last active August 29, 2015 14:12
Polymorphic WPF GUI Controls with F#
namespace ViewModels
open System.Windows
open System.Windows.Controls
open System.Windows.Documents
open System.Windows.Media
open GUIControls.Extensions
open GUIControls.Patterns
open System.Windows.Interactivity
@cloudRoutine
cloudRoutine / morphisms.fs
Created December 24, 2014 08:10
Morphisms
module Morphisms =
/// Hylomorphism that composes an unfold into a fold
/// folding an unfold
// ( fold o unfold )(x) = fold (unfold(x))
let hylomorphism
(ufstepfn:#seq<'b>->'b->#seq<'b>)(ufacc:#seq<'b>)(pred:'a->bool)(mapElm:'a->'b) (inc:'a->'a)
(fstepfn:'c->'b->'c) (foldAcc :'c) : 'a -> 'c =
(Folds.unfold ufstepfn ufacc pred mapElm inc ) >> (Folds.foldl fstepfn foldAcc )