Skip to content

Instantly share code, notes, and snippets.

@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 )
@cloudRoutine
cloudRoutine / Microsoft.PowerShell_profile.ps1
Last active December 8, 2024 03:19
Powershell Profile for use with Cmder
# If this script is throwing an error near a Unicode symbol try resaving the file as UTF-8 with BOM
$psmodules = ";~\Documents\WindowsPowerShell\Modules"
# sometimes the module paths has been fucked before posh loads, but that won't stop us
$env:PSModulePath = $env:PSModulePath + $psmodules
# Set the OutputEncoding to Unicode so that the λ renders properly
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@cloudRoutine
cloudRoutine / unity3d.gitignore
Created August 3, 2015 08:16
Unity3d gitignore
#=====================
# Unity Project Files
#=====================
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
*.userprefs
@cloudRoutine
cloudRoutine / 01_folds.fs
Last active February 25, 2025 10:07
F# Transducers - they work for the most part
open System.Collections.Generic
open Microsoft.FSharp.Collections
[<RequireQualifiedAccess>]
module Folds =
// These are the fast implementations we actually want to use
<?xml version="1.0" encoding="utf-8"?>
<Settings>
<Shortcuts>&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfKeyShortcut xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;KeyShortcut&gt;
&lt;Value&gt;EqualsPlus&lt;/Value&gt;
&lt;Alignment&gt;(^|[\w\s])(?&amp;lt;x&amp;gt;=)&lt;/Alignment&gt;
&lt;AlignFromCaret&gt;false&lt;/AlignFromCaret&gt;
&lt;UseRegex&gt;true&lt;/UseRegex&gt;
&lt;AddSpace&gt;true&lt;/AddSpace&gt;
@cloudRoutine
cloudRoutine / msbuild-xaml.md
Last active July 24, 2017 21:10
MSBUILD XAML Reference
@cloudRoutine
cloudRoutine / fs-coreclr-build.md
Last active October 18, 2015 20:59
Build the Visual F# Compiler and Tools for .Net CoreCLR ( On Windows )

Make things easy for yourself and start by running posh as admin

If you already have dnvm installed remember to run update-self if you haven't recently

Clone and checkout the coreclr branch of Kevin Ransom's Fork of the Visual F# Compiler and Tools

Installing DNVM

You need DNVM as a starting point. DNVM enables you to acquire a (or multiple) .NET Execution Environment (DNX).