Skip to content

Instantly share code, notes, and snippets.

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 / 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 ()
@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:81c1db4b0d75353cf6d7
Created November 9, 2014 08:50
Ace Syntax Highlighting F#
define(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 ()
{
@cloudRoutine
cloudRoutine / ReactiveExample.fs
Last active September 22, 2015 08:32
Using FSharp.Control.Reactive to recognize keyboard input
#r "PresentationCore"
#r "PresentationFramework"
#r "WindowsBase"
#r "System.Xaml"
#I "../../packages/FSharp.Control.Reactive.2.3.1/lib/net40/"
#I "../../packages/Rx-Linq.2.2.5/lib/net45"
#I "../../packages/Rx-Core.2.2.5/lib/net45"
#I "../../packages/Rx-Interfaces.2.2.5/lib/net45"
#I "../../packages/Rx-PlatformServices.2.2.5/lib/net45"
#I "../../packages/Rx-Providers.2.2.5/lib/net45"
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Scratch;assembly=App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:System="clr-namespace:System;assembly=mscorlib"
x:Name="ControlRoot"
mc:Ignorable="d" d:DesignWidth="238" d:DesignHeight="414" IsManipulationEnabled="True">
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Scratch;assembly=App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="WindowRoot" mc:Ignorable="d"
Title="Tagger" Height="518.283" Width="320.582" AllowsTransparency="True" WindowStyle="None" MinWidth="100" MinHeight="100" BorderBrush="#FF6C6C6C" Background="{x:Null}" UseLayoutRounding="True" ResizeMode="CanResizeWithGrip" IsTabStop="False" IsManipulationEnabled="True">
<Window.Resources>
<Color x:Key="ScrollBar">#FF404040</Color>
namespace Scratch
open System
open System.Windows
open FsXaml
module ScratchModel =
type CustomQueryView = XAML<"CustomQuery.xaml">
@cloudRoutine
cloudRoutine / RoughMetrics.fsx
Last active July 20, 2016 12:10
Since Visual Studio won't calculate code metrics for F# projects, this script will calculate some some rough stats.
open System
open System.IO
let find_files dir = Directory.GetFiles( dir, "*.fs?", SearchOption.AllDirectories )
let not_start (s:string) p = not <| s.StartsWith p
let has_type (s:string) = if s.Contains @"type" then 1 else 0
let has_module (s:string) = if s.Contains @"module" then 1 else 0
let has_binding (s:string) = if s.Contains @"let" ||
s.Contains @"member" then 1 else 0
@cloudRoutine
cloudRoutine / booyer-moore_knuth-morris-pratt.fs
Last active April 23, 2021 19:55
String Search Algorithms ( Boyer-Moore & Knuth-Morris-Pratt )
module StringMatching =
open System
/// Knuth-Morris-Pratt String Searching Algorithm ///
let kmp_search (text:string) (word:string) : int =
let kmp_table (word:string) =
let table = [| 1..word.Length |]
table.[0] <- -1